Don't let a player create a new table or join an existing table if they're

already sitting at a table. We also enforce this in the UI (though not in
certain cases in MSOY at the moment which is how this was uncovered).


git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@577 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2008-03-24 23:00:09 +00:00
parent c0ce0d188b
commit 29460ce450
2 changed files with 16 additions and 2 deletions
@@ -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) {