Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XlrStats: !xlrstats command silently fails on a 1st time seen map #88

Closed
thomasleveil opened this issue Jul 19, 2012 · 1 comment
Closed

Comments

@thomasleveil
Copy link

from a support request on the forums:
on the log below, a player uses the !xlrstats command right after the bot starts.
B3 knows the map name but the is no line in the xlrstatsmap stat table for this map, hence the get_PlayerMaps method is called with None for the map id parameter and fails.

  • the get_PlayerMaps could check the validity of its mandatory parameter and fails with a debug/error log message.
  • the Xlrstats plugin could create the map stats table for the current map (if it does not exists in database) at plugin start, hence ensuring any call to method get_MapStats returns a MapStats object with map id
120717 00:55:58 BOT     'Starting Plugin xlrstats'
120717 00:55:58 DEBUG   'AdminPlugin: Command "xlrhide (None)" registered with cmd_xlrhide for level (60, 100)'
120717 00:55:58 DEBUG   'AdminPlugin: Command "xlrstats (stats)" registered with cmd_xlrstats for level (1, 100)'
120717 00:55:58 DEBUG   'AdminPlugin: Command "xlrtopstats (topstats)" registered with cmd_xlrtopstats for level (2, 100)'
120717 00:55:58 DEBUG   'Register Event: Client Join Team: XlrstatsPlugin'
120717 00:55:58 DEBUG   'Register Event: Client Kill: XlrstatsPlugin'
120717 00:55:58 DEBUG   'Register Event: Client Team Kill: XlrstatsPlugin'
120717 00:55:58 DEBUG   'Register Event: Client Suicide: XlrstatsPlugin'
120717 00:55:58 DEBUG   'Register Event: Game Round Start: XlrstatsPlugin'
120717 00:55:58 DEBUG   'Register Event: Client Action: XlrstatsPlugin'
120717 00:55:58 DEBUG   'Register Event: Client Damage: XlrstatsPlugin'
120717 00:55:58 DEBUG   'XlrstatsPlugin: Got client id for B3: 1; World'
120717 00:55:58 DEBUG   'XlrstatsPlugin: No Webfront Url available, using defaults'
120717 00:55:58 DEBUG   'XlrstatsPlugin: Calculating kill_bonus'
120717 00:55:58 DEBUG   'XlrstatsPlugin: kill_bonus set to: 2.0'
120717 00:55:58 DEBUG   'XlrstatsPlugin: assist_bonus set to: 0.666666666667'
120717 00:55:58 VERBOSE 'Added crontab <bound method XlrstatsPlugin.calculateKillBonus of <xlrstats.XlrstatsPlugin instance at 0x030D0D50>> (51313104) - 0s [0, 10, 20, 30, 40, 50]m -1h -1d -1M -1DOW'
120717 00:55:58 DEBUG   'Register Event: Client Authenticated: CtimePlugin'
120717 00:55:58 DEBUG   'Register Event: Client Disconnect: CtimePlugin'
120717 00:55:58 DEBUG   u'CtimePlugin: 05:00 EST => 10:00 UTC'
120717 00:55:58 INFO    u'CtimePlugin: everyday at  5: 0 EST, connection info older than 31 days will be deleted'
120717 00:55:58 VERBOSE 'Added crontab <bound method CtimePlugin.purge of <xlrstats.CtimePlugin instance at 0x030F4F80>> (51313040) - 0s 0m 10h -1d -1M -1DOW'
120717 00:55:58 DEBUG   'Register Event: Stop Process: XlrstatscontrollerPlugin'
120717 00:55:58 DEBUG   'Register Event: Program Exit: XlrstatscontrollerPlugin'
120717 00:55:58 DEBUG   'Starting SubPlugin: XlrstatsControllerPlugin'
120717 00:55:58 DEBUG   'Register Event: Client Join Team: XlrstatscontrollerPlugin'
120717 00:55:58 DEBUG   'Register Event: Game Round Start: XlrstatscontrollerPlugin'
120717 00:55:58 BOT     'Starting Plugin publist'
120717 00:55:58 DEBUG   'Set cvar _B3 = [B3 v1.8.1 [nt]]'
120717 00:55:59 DEBUG   'Data was a string'
120717 00:55:59 VERBOSE 'RCON sending (127.0.0.1:28961) \'set _B3 "B3 v1.8.1 [nt]"\''
120717 00:55:59 DEBUG   'Data was a string'
120717 00:55:59 DEBUG   'PublistPlugin: publist will send heartbeat at 01:40 every day'
120717 00:55:59 VERBOSE "RCON sending (127.0.0.1:28961) 'say ^0(^2b3^0)^7: XLRstats v. 2.7.1 by Tim ter Laak / Mark Weirath started.'"
120717 00:55:59 VERBOSE 'Added crontab <bound method PublistPlugin.update of <b3.plugins.publist.PublistPlugin instance at 0x00CC85A8>> (51311568) - 0s 40m 1h -1d -1M -1DOW'
120717 00:55:59 INFO    'PublistPlugin: initial heartbeat will be sent to B3 master server at 00 minutes'
120717 00:55:59 VERBOSE 'Added crontab <bound method PublistPlugin.update of <b3.plugins.publist.PublistPlugin instance at 0x00CC85A8>> (51313008) - 0s 0m -1h -1d -1M -1DOW'
120717 00:55:59 BOT     'all plugins started'
120717 00:55:59 BOT     'starting event dispatching thread'
120717 00:55:59 BOT     'start reading game events'
120717 00:55:59 DEBUG   'AUTODOC: saving html documentation'
120717 00:55:59 DEBUG   'AUTODOC: get commands with level <= 100'
120717 00:55:59 DEBUG   'Writing to b3_doc.htm'
120717 00:55:59 CONSOLE '1455:00 say;0110000100018db3;2;[DCa] Mor9heus;\x15!stats'
120717 00:55:59 DEBUG   'No client - attempt join'
120717 00:55:59 DEBUG   '[DCa] Mor9heus connected, waiting for Authentication...'
120717 00:55:59 DEBUG   "Our Authentication queue: {'2': 1}"
120717 00:56:00 DEBUG   'Data was a string'
120717 00:56:00 VERBOSE "RCON sending (127.0.0.1:28961) 'say ^0(^2b3^0)^7: ^2Big Brother Bot is watching you... www.BigBrotherBot.net'"
120717 00:56:01 DEBUG   'newClient: 2, 0110000100018db3, [DCa] Mor9heus'
120717 00:56:01 DEBUG   'Data was a string'
120717 00:56:01 VERBOSE "RCON sending (127.0.0.1:28961) 'status'"
120717 00:56:02 VERBOSE "connectClient() = {'2': {'slot': '2', 'last': '50', 'name': '[DCa] Mor9heus^7', 'ip': '99.74.202.244', 'ping': '24', 'pbid': None, 'score': '0', 'guid': '0110000100018db3', 'port': '28960'}}"
120717 00:56:02 DEBUG   '[DCa] Mor9heus^7 found in status/playerList'
120717 00:56:02 DEBUG   "Client Connected: [2] [DCa] Mor9heus - 0110000100018db3 ({'codguid': '0110000100018db3'})"
120717 00:56:02 DEBUG   'Storage: getClient Client<2>'
120717 00:56:02 BOT     'Client found in storage 2, welcome back [DCa] Mor9heus'
120717 00:56:02 DEBUG   'Storage: setClient Client<2>'
120717 00:56:02 DEBUG   "Storage: setClient data {'time_add': 1341953646, 'time_edit': 1342500962, 'name': '[DCa] Mor9heus', 'group_bits': 128, 'ip': '99.74.202.244', 'auto_login': 1, 'greeting': u'Welcome to the ^2Matrix!', 'pbid': '', 'connections': 42, 'mask_level': 0, 'guid': '0110000100018db3', 'id': 2}"
120717 00:56:02 DEBUG   'Client Authorized: [2] [DCa] Mor9heus - 0110000100018db3'
120717 00:56:02 VERBOSE 'Queueing event Client Authenticated Client<2>'
120717 00:56:02 VERBOSE 'Queueing event Client Join Team None'
120717 00:56:02 VERBOSE 'Parsing Event: Client Authenticated: CensorPlugin'
120717 00:56:02 VERBOSE 'Parsing Event: Client Authenticated: WelcomePlugin'
120717 00:56:02 DEBUG   'WelcomePlugin: not welcoming player because the bot started less than 5 min ago'
120717 00:56:02 VERBOSE 'Parsing Event: Client Authenticated: CtimePlugin'
120717 00:56:02 DEBUG   u'CtimePlugin: CTIME CONNECTED: Player [DCa] Mor9heus^7 started playing at: 2012-07-17 00:56:02.706000'
120717 00:56:02 VERBOSE 'Parsing Event: Client Join Team: XlrstatsPlugin'
120717 00:56:02 ERROR   '[SELECT * from xlr_playermaps WHERE map_id = None AND player_id = 1 LIMIT 1] None'
120717 00:56:02 ERROR   'handler XlrstatsPlugin could not handle event Client Join Team: OperationalError: (1054, "Unknown column \'None\' in \'where clause\'") [(\'b3\\\\parser.pyo\', 1002, \'handleEvents\', None), (\'b3\\\\plugin.pyo\', 158, \'parseEvent\', None), (\'C:\\\\Public\\\\Servers\\\\BB\\\\extplugins\\\\xlrstats.py\', 530, \'onEvent\', None), (\'C:\\\\Public\\\\Servers\\\\BB\\\\extplugins\\\\xlrstats.py\', 1376, \'join\', None), (\'C:\\\\Public\\\\Servers\\\\BB\\\\extplugins\\\\xlrstats.py\', 740, \'get_PlayerMaps\', None), (\'b3\\\\storage\\\\database.pyo\', 319, \'query\', None)]'
120717 00:56:02 VERBOSE 'Parsing Event: Client Join Team: XlrstatscontrollerPlugin'
120717 00:56:02 DEBUG   'XlrstatscontrollerPlugin: Checking number of players online. Minimum = 3, Current = 1'
120717 00:56:02 DEBUG   'XlrstatscontrollerPlugin: Nothing to do at the moment. XLRstats is already Enabled'
120717 00:56:08 CONSOLE '1455:12 say;0110000100018db3;2;[DCa] Mor9heus;\x15!stats'
120717 00:56:08 VERBOSE u'Queueing event Say !stats'
120717 00:56:08 VERBOSE 'Parsing Event: Say: AdminPlugin'
120717 00:56:08 DEBUG   u'AdminPlugin: OnSay handle 5:"!stats"'
120717 00:56:08 DEBUG   u'AdminPlugin: Handle command !stats'
120717 00:56:08 DEBUG   'Data was a string'
120717 00:56:08 VERBOSE "RCON sending (127.0.0.1:28961) 'tell 2 ^0(^2b3^0)^7: ^3[pm]^7 ^3XLR Stats: ^7[DCa] Mor9heus^7 ^7: K ^20 ^7D ^30 ^7TK ^10 ^7Ratio ^50.00 ^7Skill ^3999.50'"
markweirath added a commit that referenced this issue Jul 22, 2012
@thomasleveil
Copy link
Author

for reference, also see cf9301a

markweirath pushed a commit that referenced this issue Aug 11, 2013
[URT42] Add EVT_CLIENT_GOTO
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants