As declared in line 36, it appears data is supposed to be a dict, but on line 94 (if the file does not exist), it writes an empty list into the file (there's also just an empty list in the default config) which yaml interprets as a Python list and loads into memory.
However, this causes issues down the line because some places call user_data[key] where key is of type str, being a TypeError. An example where user_data is clearly called with a str index is
Where ipid is of type str when it's called (seems to be a hash of the IP address).
How to reproduce: I just cloned, copied config_default to config, started it and tried to join with a client then got TypeErrors on the statement above.
Python version is 3.6.6 and AO client version is 2.4.10
There appears to be some type confusion in the field Database.user_data as evidenced by
https://github.com/AttorneyOnlineVidya/tsuserver3/blob/32657d5dce03bb0aeda5e745b8bc9dc2647ff5e6/server/database.py#L85-L97
As declared in line 36, it appears data is supposed to be a dict, but on line 94 (if the file does not exist), it writes an empty list into the file (there's also just an empty list in the default config) which yaml interprets as a Python list and loads into memory.
However, this causes issues down the line because some places call user_data[key] where key is of type str, being a TypeError. An example where user_data is clearly called with a str index is
https://github.com/AttorneyOnlineVidya/tsuserver3/blob/32657d5dce03bb0aeda5e745b8bc9dc2647ff5e6/server/database.py#L140-L142
Where ipid is of type str when it's called (seems to be a hash of the IP address).
How to reproduce: I just cloned, copied config_default to config, started it and tried to join with a client then got TypeErrors on the statement above.
Python version is 3.6.6 and AO client version is 2.4.10