From cfe2e3126aced578a2eedc678db5b2e92e3f8e6b Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 1 May 2009 21:01:24 +0000 Subject: [PATCH] Publish our table after we create the game if we're going to immediately create the game. Also factor that out into tableCreated() for easy subclass listening. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@832 c613c5cb-e716-0410-b11b-feb51c14d237 --- .../parlor/server/TableManager.java | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/java/com/threerings/parlor/server/TableManager.java b/src/java/com/threerings/parlor/server/TableManager.java index 9c8fe8bd..a85912f9 100644 --- a/src/java/com/threerings/parlor/server/TableManager.java +++ b/src/java/com/threerings/parlor/server/TableManager.java @@ -166,12 +166,7 @@ public class TableManager notePlayerAdded(table, creator); } - // stick the table into the table lobby object - if (shouldPublish(table)) { - _tlobj.addToTables(table); - } - - // also stick it into our tables tables + // stick the table into our tables tables _tables.put(table.tableId, table); // if the table has only one seat, start the game immediately @@ -179,6 +174,9 @@ public class TableManager createGame(table); } + // wire our table into our bits + tableCreated(table); + return table; } @@ -335,6 +333,19 @@ public class TableManager updateTable(table); } + /** + * Puts a newly created table into our internal tables and publishes it to the lobby object. + * Can also be overridden by custom managers that want to react to table creation. + */ + protected void tableCreated (Table table) + throws InvocationException + { + // publish the table in the lobby object if desired + if (shouldPublish(table)) { + _tlobj.addToTables(table); + } + } + /** * Removes the table from all of our internal tables and from its lobby's distributed object. */