Use error message names that make sense. Differentiate between not allowing
something because the requester is not the owner of the table and trying to boot onesself from the table. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@764 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
@@ -278,7 +278,7 @@ public class TableManager
|
||||
if (table == null) {
|
||||
throw new InvocationException(NO_SUCH_TABLE);
|
||||
} else if (starter.getOid() != table.bodyOids[0]) {
|
||||
throw new InvocationException(INVALID_TABLE_POSITION);
|
||||
throw new InvocationException(MUST_BE_CREATOR);
|
||||
} else if (!table.mayBeStarted()) {
|
||||
throw new InvocationException(INTERNAL_ERROR);
|
||||
}
|
||||
@@ -302,10 +302,10 @@ public class TableManager
|
||||
int position = ListUtil.indexOf(table.players, target);
|
||||
if (position < 0) {
|
||||
throw new InvocationException(NOT_AT_TABLE);
|
||||
} else if (booter.getOid() != table.bodyOids[0] ||
|
||||
booter.getOid() == table.bodyOids[position]) {
|
||||
// Must be head of the table, and can't self-boot
|
||||
throw new InvocationException(INVALID_TABLE_POSITION);
|
||||
} else if (booter.getOid() != table.bodyOids[0]) {
|
||||
throw new InvocationException(MUST_BE_CREATOR);
|
||||
} else if (booter.getOid() == table.bodyOids[position]) {
|
||||
throw new InvocationException(NO_SELF_BOOT);
|
||||
}
|
||||
|
||||
// Remember to keep him banned
|
||||
|
||||
Reference in New Issue
Block a user