Skip to content

"Out of avatars" error after refreshing the lobby repeatedly #14

@tbroadley

Description

@tbroadley
  File "/home/thomas/Documents/src/Codenames/lobby_handlers.py", line 84, in client_connect
    data=cookie
  File "/home/thomas/Documents/src/Codenames/game_manager.py", line 57, in handle_client_event
    client, events = client_manager.handle_event(self.game_code, client_id, client_event, data)
  File "/home/thomas/Documents/src/Codenames/client_manager.py", line 74, in handle_event
    client = self.restore_client(existing_id)
  File "/home/thomas/Documents/src/Codenames/client_manager.py", line 212, in restore_client
    avatar = Player._get_avatar(self.used_avatars, pref=player.avatar)
  File "/home/thomas/Documents/src/Codenames/player.py", line 40, in _get_avatar
    raise ValueError('Out of avatars')
ValueError: Out of avatars

I think this happens because, every time the page is refreshed, all players tied to the device are assigned a new avatar by the server but don't end up using it on the client.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions