Add player ID to redis set in join server handler

This commit is contained in:
Ben 2019-08-19 02:21:12 +01:00
parent 864268afff
commit 8b33390acf

View File

@ -41,6 +41,8 @@ async def handle_join_server(p, penguin_id: int, login_key: str):
p.joined_world = True p.joined_world = True
server_key = '{}.players'.format(p.server.server_config['Id'])
await p.server.redis.sadd(server_key, p.data.id)
await p.server.redis.hincrby('population', p.server.server_config['Id'], 1) await p.server.redis.hincrby('population', p.server.server_config['Id'], 1)