Sort IDs by digit length

This commit is contained in:
Chev 2020-06-27 22:29:17 -07:00
parent 1d248d7196
commit 431a138658

View file

@ -85,7 +85,7 @@ while mergefilequery not in ("y", "n"):
print("Skipping merge step...")
dupe_number = len(players) - len(set(players)) #get number of duplicates
players = set(players) #remove duplicates in case of merging
players = sorted(set(players), key=lambda x: len(x)) #remove duplicates in case of merging, also sort by ID length (the voice_ban.dt file will break if not sorted)
players_as_string = "\x01\0\0\0" + '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0'.join(players) + '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0' #this is how the voice_ban.dt file is patterned