Skip to content

Commit fe688f6

Browse files
authored
Use username with fewest trailing _'s when reconnecting (#744)
Based on report from @alexroston
1 parent db95264 commit fe688f6

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

syncplay/server.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -508,6 +508,8 @@ def findFreeUsername(self, username, maxUsernameLength=constants.MAX_USERNAME_LE
508508
for room in self._rooms.values():
509509
for watcher in room.getWatchers():
510510
allnames.append(watcher.getName().lower())
511+
if username.lower() in allnames and username.endswith('_'):
512+
username = username.rstrip('_') or '_'
511513
while username.lower() in allnames:
512514
username += '_'
513515
return username

0 commit comments

Comments
 (0)