try:\r
# find one by that name, if it exists\r
server = session.query(Server).filter_by(name=name).one()\r
- log.debug("Found server id {0} with name {1}.".format(\r
- server.server_id, server.name))\r
+ log.debug("Found server id {0}: {1}".format(\r
+ server.server_id, server.name.encode('utf-8')))\r
except NoResultFound, e:\r
server = Server(name=name)\r
session.add(server)\r
session.flush()\r
- log.debug("Created server id {0} with name {1}".format(\r
- server.server_id, server.name))\r
+ log.debug("Created server id {0}: {1}".format(\r
+ server.server_id, server.name.encode('utf-8')))\r
except MultipleResultsFound, e:\r
# multiple found, so use the first one but warn\r
log.debug(e)\r
servers = session.query(Server).filter_by(name=name).order_by(\r
Server.server_id).all()\r
server = servers[0]\r
- log.debug("Created server id {0} with name {1} but found \\r
+ log.debug("Created server id {0}: {1} but found \\r
multiple".format(\r
- server.server_id, server.name))\r
+ server.server_id, server.name.encode('utf-8')))\r
\r
return server\r
\r
try:\r
# find one by the name, if it exists\r
gmap = session.query(Map).filter_by(name=name).one()\r
- log.debug("Found map id {0} with name {1}.".format(gmap.map_id, \r
+ log.debug("Found map id {0}: {1}".format(gmap.map_id, \r
gmap.name))\r
except NoResultFound, e:\r
gmap = Map(name=name)\r
session.add(gmap)\r
session.flush()\r
- log.debug("Created map id {0} with name {1}.".format(gmap.map_id,\r
+ log.debug("Created map id {0}: {1}".format(gmap.map_id,\r
gmap.name))\r
except MultipleResultsFound, e:\r
# multiple found, so use the first one but warn\r
gmaps = session.query(Map).filter_by(name=name).order_by(\r
Map.map_id).all()\r
gmap = gmaps[0]\r
- log.debug("Found map id {0} with name {1} but found \\r
- multiple.".format(gmap.map_id, gmap.name))\r
+ log.debug("Found map id {0}: {1} but found \\r
+ multiple".format(gmap.map_id, gmap.name))\r
\r
return gmap\r
\r
server_id=server_id, map_id=map_id, winner=winner)\r
session.add(game)\r
session.flush()\r
- log.debug("Created game id {0} on server {1}, map {2} at time \\r
- {3} and on map {4}".format(game.game_id, \r
- server_id, map_id, start_dt, map_id))\r
+ log.debug("Created game id {0} on server {1}, map {2} at \\r
+ {3}".format(game.game_id, \r
+ server_id, map_id, start_dt))\r
\r
return game\r
\r
hashkey=hashkey).one()\r
player = session.query(Player).filter_by(\r
player_id=hashkey.player_id).one()\r
- log.debug("Found existing player {0} with hashkey {1}.".format(\r
+ log.debug("Found existing player {0} with hashkey {1}".format(\r
player.player_id, hashkey.hashkey))\r
except:\r
player = Player()\r
\r
hashkey = Hashkey(player_id=player.player_id, hashkey=hashkey)\r
session.add(hashkey)\r
- log.debug("Created player {0} with hashkey {1}.".format(\r
- player.player_id, hashkey.hashkey))\r
+ log.debug("Created player {0} ({2}) with hashkey {1}".format(\r
+ player.player_id, hashkey.hashkey, player.nick.encode('utf-8')))\r
\r
return player\r
\r
# if the nick we end up with is different from the one in the\r
# player record, change the nick to reflect the new value\r
if pgstat.nick != player.nick and player.player_id > 1:\r
- log.debug('Registering new nick for {0}: {1}'.format(player.nick, \r
- pgstat.nick))\r
register_new_nick(session, player, pgstat.nick)\r
\r
# if the player is ranked #1 and it is a team game, set the game's winner\r
# to be the team of that player\r
# FIXME: this is a hack, should be using the 'W' field (not present)\r
if pgstat.rank == '1' and pgstat.team:\r
- log.debug('Found rank 1. Logging.')\r
game.winner = pgstat.team\r
session.add(game)\r
\r