markweirath/big-brother-bot

homefront escape " in playername

Opened this issue · 1 comments

We need to escape " characters in homefront playernames somehow.

110416 03:17:15 CONSOLE [Message: SERVER_TRANSMISSION], [Channel: SERVER], [Data: PLAYER: 76561197960934414 0 LAN1 Grodan_Boll_^4"^3"^4 4 1]
110416 03:17:15 DEBUG   Storage: getClientAlias 
110416 03:17:15 ERROR   (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'"Grodan_Boll_"" && `client_id` = 704 LIMIT 1\' at line 1')
Traceback (most recent call last):
  File "/home/b3/b3/parsers/homefront/protocol.py", line 195, in handle_read
    handler(p)
  File "/home/b3/b3/parsers/homefront/__init__.py", line 161, in routePacket
    event = func(data)
  File "/home/b3/b3/parsers/homefront/__init__.py", line 440, in onServerPlayer
    client.name = match.group('name')
  File "/home/b3/b3/clients.py", line 421, in _set_name
    self.makeAlias(self._name)
  File "/home/b3/b3/clients.py", line 628, in makeAlias
    alias = self.console.storage.getClientAlias(Alias(clientId=self.id,alias=name))
  File "/home/b3/b3/storage.py", line 495, in getClientAlias
    cursor = self.query(QueryBuilder(self.db).SelectQuery('*', 'aliases', { 'alias' : alias.alias, 'client_id' : alias.clientId }, None, 1))
  File "/home/b3/b3/storage.py", line 302, in query
    raise e
ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'"Grodan_Boll_"" && `client_id` = 704 LIMIT 1\' at line 1')

fixed in SHA: dd009e1