Skip to content

Commit

Permalink
Fixed an issue with players who share the same username (thanks guys,…
Browse files Browse the repository at this point in the history
… lol; such a specific bug)
  • Loading branch information
EternalWraith committed Feb 29, 2024
1 parent be1c0d4 commit fed1309
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion palworld_pal_edit/PalInfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,21 @@ def GetPlayerslist(self):
{'uid': x['key']['PlayerUId'],
'value': x['value']['RawData']['value']['object']['SaveParameter']['value']
} for x in self._data['properties']['worldSaveData']['value']['CharacterSaveParameterMap']['value']]))
return {x['value']['NickName']['value']: str(x['uid']['value']) for x in players}

out = {}
for x in players:
g = str(x['uid']['value'])
if g.replace("0", "").replace("-", "") == "1":
out[x['value']['NickName']['value'] + " (HOST)"] = g
elif not x['value']['NickName']['value'] in out:
out[x['value']['NickName']['value']] = g
else:
v = 2
while f"{x['value']['NickName']['value']} #{v}" in out:
v += 1
out[x['value']['NickName']['value'] + f" #{v}"] = g

return out #{x['value']['NickName']['value']: str(x['uid']['value']) for x in players}

def ConvertGuid(guid_str):
guid_str = guid_str
Expand Down

0 comments on commit fed1309

Please sign in to comment.