Allow tables of one player which are started immediately.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@3297 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
@@ -136,6 +136,11 @@ public class TableManager
|
|||||||
// also stick it into our tables tables
|
// also stick it into our tables tables
|
||||||
_tables.put(table.getTableId(), table);
|
_tables.put(table.getTableId(), table);
|
||||||
|
|
||||||
|
// if the table has only one seat, start the game immediately
|
||||||
|
if (table.shouldBeStarted()) {
|
||||||
|
createGame(table);
|
||||||
|
}
|
||||||
|
|
||||||
// finally let the caller know what the new table id is
|
// finally let the caller know what the new table id is
|
||||||
return table.getTableId();
|
return table.getTableId();
|
||||||
}
|
}
|
||||||
@@ -178,11 +183,7 @@ public class TableManager
|
|||||||
|
|
||||||
// if the table is sufficiently full, start the game automatically
|
// if the table is sufficiently full, start the game automatically
|
||||||
if (table.shouldBeStarted()) {
|
if (table.shouldBeStarted()) {
|
||||||
// fill the players array into the game config
|
|
||||||
table.config.players = table.getPlayers();
|
|
||||||
// and create the game
|
|
||||||
createGame(table);
|
createGame(table);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// make a mapping from this occupant to this table
|
// make a mapping from this occupant to this table
|
||||||
_boidMap.put(joiner.getOid(), table);
|
_boidMap.put(joiner.getOid(), table);
|
||||||
@@ -263,6 +264,9 @@ public class TableManager
|
|||||||
protected void createGame (final Table table)
|
protected void createGame (final Table table)
|
||||||
throws InvocationException
|
throws InvocationException
|
||||||
{
|
{
|
||||||
|
// fill the players array into the game config
|
||||||
|
table.config.players = table.getPlayers();
|
||||||
|
|
||||||
PlaceRegistry.CreationObserver obs =
|
PlaceRegistry.CreationObserver obs =
|
||||||
new PlaceRegistry.CreationObserver() {
|
new PlaceRegistry.CreationObserver() {
|
||||||
public void placeCreated (PlaceObject plobj, PlaceManager pmgr) {
|
public void placeCreated (PlaceObject plobj, PlaceManager pmgr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user