Drive-by logging varargification.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@825 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Ray Greenwell
2009-04-28 21:57:02 +00:00
parent 8fd0dc1cbb
commit f0b800d75c
@@ -114,9 +114,8 @@ public class GameManager extends PlaceManager
// sanity-check the player index
if (pidx == -1) {
log.warning("Couldn't find free player index for player [game=" + where() +
", player=" + player +
", players=" + StringUtil.toString(_gameobj.players) + "].");
log.warning("Couldn't find free player index for player",
"game", where(), "player", player, "players", StringUtil.toString(_gameobj.players));
return -1;
}
@@ -136,31 +135,31 @@ public class GameManager extends PlaceManager
{
// make sure the specified player index is valid
if (pidx < 0 || pidx >= getPlayerSlots()) {
log.warning("Attempt to add player at an invalid index [game=" + where() +
", player=" + player + ", pidx=" + pidx + "].");
log.warning("Attempt to add player at an invalid index",
"game", where(), "player", player, "pidx", pidx);
return false;
}
// make sure the player index is available
if (_gameobj.players[pidx] != null) {
log.warning("Attempt to add player at occupied index [game=" + where() +
", player=" + player + ", pidx=" + pidx + "].");
log.warning("Attempt to add player at occupied index",
"game", where(), "player", player, "pidx", pidx);
return false;
}
// make sure the player isn't already somehow a part of the game to avoid any potential
// badness that might ensue if we added them more than once
if (_gameobj.getPlayerIndex(player) != -1) {
log.warning("Attempt to add player to game that they're already playing " +
"[game=" + where() + ", player=" + player + "].");
log.warning("Attempt to add player to game that they're already playing",
"game", where(), "player", player);
return false;
}
// get the player's body object
BodyObject bobj = _locator.lookupBody(player);
if (bobj == null) {
log.warning("Unable to get body object while adding player [game=" + where() +
", player=" + player + "].");
log.warning("Unable to get body object while adding player",
"game", where(), "player", player);
return false;
}
@@ -194,9 +193,8 @@ public class GameManager extends PlaceManager
// sanity-check the player index
if (pidx == -1) {
log.warning("Attempt to remove non-player from players list [game=" + where() +
", player=" + player +
", players=" + StringUtil.toString(_gameobj.players) + "].");
log.warning("Attempt to remove non-player from players list",
"game", where(), "player", player, "players", StringUtil.toString(_gameobj.players));
return false;
}
@@ -427,8 +425,8 @@ public class GameManager extends PlaceManager
{
// complain if we're already started
if (_gameobj.state == GameObject.IN_PLAY) {
log.warning("Requested to start an already in-play game", "game", where(),
new Exception());
log.warning("Requested to start an already in-play game",
"game", where(), new Exception());
return false;
}
@@ -437,9 +435,9 @@ public class GameManager extends PlaceManager
// make sure everyone has turned up
if (!allPlayersReady()) {
log.warning("Requested to start a game that is still awaiting players " +
"[game=" + where() + ", pnames=" + StringUtil.toString(_gameobj.players) +
", poids=" + StringUtil.toString(_playerOids) + "].");
log.warning("Requested to start a game that is still awaiting players",
"game", where(), "pnames", StringUtil.toString(_gameobj.players),
"poids", StringUtil.toString(_playerOids));
return false;
}
@@ -449,12 +447,12 @@ public class GameManager extends PlaceManager
if (_postponedStart) {
// We've already tried postponing once, doesn't do us any good to throw ourselves
// into a frenzy trying again.
log.warning("Tried to postpone the start of a still-ending game multiple times " +
"[game=" + where() + "].");
log.warning("Tried to postpone the start of a still-ending game multiple times",
"game", where());
_postponedStart = false;
return false;
}
log.info("Postponing start of still-ending game [game=" + where() + "].");
log.info("Postponing start of still-ending game", "game", where());
_postponedStart = true;
// TEMP: track down weirdness
final Exception firstCall = new Exception();
@@ -529,7 +527,7 @@ public class GameManager extends PlaceManager
// END TEMP
if (!_gameobj.isInPlay()) {
log.info("Refusing to end game that was not in play [game=" + where() + "].");
log.info("Refusing to end game that was not in play", "game", where());
return;
}
@@ -837,8 +835,8 @@ public class GameManager extends PlaceManager
BodyObject bobj = _locator.lookupBody(_gameobj.players[ii]);
if (bobj == null) {
log.warning("Unable to deliver game ready to non-existent player [game=" + where() +
", player=" + _gameobj.players[ii] + "].");
log.warning("Unable to deliver game ready to non-existent player",
"game", where(), "player", _gameobj.players[ii]);
continue;
}
@@ -898,7 +896,7 @@ public class GameManager extends PlaceManager
{
super.placeBecameEmpty();
// log.info("Game room empty. Going away. [game=" + where() + "].");
// log.info("Game room empty. Going away.", "game", where());
// if we're in play then move to game over
if (_gameobj.state != GameObject.PRE_GAME && _gameobj.state != GameObject.GAME_OVER &&
@@ -957,9 +955,9 @@ public class GameManager extends PlaceManager
// if there's no one in the room, go ahead and clear it out
if (_plobj.occupants.size() == 0) {
log.info("Cancelling total no-show [game=" + where() +
", players=" + StringUtil.toString(_gameobj.players) +
", poids=" + StringUtil.toString(_playerOids) + "].");
log.info("Cancelling total no-show",
"game", where(), "players", StringUtil.toString(_gameobj.players),
"poids", StringUtil.toString(_playerOids));
placeBecameEmpty();
} else {
@@ -992,15 +990,15 @@ public class GameManager extends PlaceManager
if ((humansHere == 0) && !startWithoutHumans()) {
// if there are no human players in the game, just cancel it
log.info("Canceling no-show game [game=" + where() +
", players=" + StringUtil.toString(_playerOids) + "].");
log.info("Canceling no-show game",
"game", where(), "players", StringUtil.toString(_playerOids));
cancelGame();
} else {
// go ahead and report that everyone is ready (which will start the game);
// gameDidStart() will take care of giving the boot to anyone who isn't around
log.info("Forcing start of partial no-show game [game=" + where() +
", poids=" + StringUtil.toString(_playerOids) + "].");
log.info("Forcing start of partial no-show game",
"game", where(), "players", StringUtil.toString(_playerOids));
playersAllHere();
}
}
@@ -1109,8 +1107,7 @@ public class GameManager extends PlaceManager
// any players who have not claimed that they are ready should now be given le boote royale
for (int ii = 0; ii < _playerOids.length; ii++) {
if (_playerOids[ii] == -1) {
log.info("Booting no-show player [game=" + where() +
", player=" + getPlayerName(ii) + "].");
log.info("Booting no-show player", "game", where(), "player", getPlayerName(ii));
_playerOids[ii] = 0; // unfiddle the blank oid
endPlayerGame(ii);
}