Skip to content

Commit

Permalink
Merge pull request #12 from termac/parse_nickname_in_custom_games
Browse files Browse the repository at this point in the history
parse player names in custom games
  • Loading branch information
acarapetis authored Oct 20, 2024
2 parents dede28b + 729fb43 commit 265f34a
Show file tree
Hide file tree
Showing 13 changed files with 192 additions and 163 deletions.
13 changes: 13 additions & 0 deletions shroudstone/replay/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,19 @@ def process(self, chunk: pb.ReplayChunk):
f"Putting player {client_id} in pre-assigned slot {client.slot_number}"
)

elif isinstance(msg, pb.PlayerAlt):
client = self.clients[client_id]
if msg.name.nickname and client.nickname is None:
client.nickname = msg.name.nickname
logger.debug(
f"Filling in player {client_id} nickname: {client.nickname} {client.uuid}"
)
if msg.name.discriminator and client.discriminator is None:
client.discriminator = msg.name.discriminator
logger.debug(
f"Filling in player {client_id} discriminator: {client.discriminator} {client.uuid}"
)

elif isinstance(msg, pb.ClientConnected):
if not msg.HasField("uuid"):
# We should have already filled in the player details in handle_player,
Expand Down
101 changes: 47 additions & 54 deletions shroudstone/replay/stormgate_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 265f34a

Please sign in to comment.