diff --git a/src/java/com/threerings/parlor/data/ParlorCodes.java b/src/java/com/threerings/parlor/data/ParlorCodes.java index 2d08dc66..fd588b76 100644 --- a/src/java/com/threerings/parlor/data/ParlorCodes.java +++ b/src/java/com/threerings/parlor/data/ParlorCodes.java @@ -55,7 +55,11 @@ public interface ParlorCodes extends InvocationCodes * occupied. */ public static final String TABLE_POSITION_OCCUPIED = "m.table_position_occupied"; - /** An error code returned when a user requests to leave a table that - * they were not sitting at in the first place. */ + /** An error code returned when a user requests to creat or join a table but they're already + * sitting at another table. */ + public static final String ALREADY_AT_TABLE = "m.already_at_table"; + + /** An error code returned when a user requests to leave a table that they were not sitting at + * in the first place. */ public static final String NOT_AT_TABLE = "m.not_at_table"; } diff --git a/src/java/com/threerings/parlor/server/TableManager.java b/src/java/com/threerings/parlor/server/TableManager.java index 1b4d887b..9e96a7d7 100644 --- a/src/java/com/threerings/parlor/server/TableManager.java +++ b/src/java/com/threerings/parlor/server/TableManager.java @@ -116,6 +116,11 @@ public class TableManager public Table createTable (BodyObject creator, TableConfig tableConfig, GameConfig config) throws InvocationException { + // make sure the caller is not already in a table + if (_boidMap.containsKey(creator.getOid())) { + throw new InvocationException(ALREADY_AT_TABLE); + } + // create a brand spanking new table Table table; try { @@ -182,6 +187,11 @@ public class TableManager { BodyObject joiner = (BodyObject)caller; + // make sure the caller is not already in a table + if (_boidMap.containsKey(joiner.getOid())) { + throw new InvocationException(ALREADY_AT_TABLE); + } + // look the table up Table table = _tables.get(tableId); if (table == null) {