Skip to content

Duplicate names - #26

Open
JanaDrazkova wants to merge 4 commits into
mainfrom
jd-duplicate_names
Open

Duplicate names#26
JanaDrazkova wants to merge 4 commits into
mainfrom
jd-duplicate_names

Conversation

@JanaDrazkova

Copy link
Copy Markdown
Contributor

A player cannot connect to the server if the client name is already in use.

@JanaDrazkova JanaDrazkova linked an issue Jun 9, 2026 that may be closed by this pull request
@ninabel

ninabel commented Jun 10, 2026

Copy link
Copy Markdown
Contributor

Is it possible to ask player about a new name without closing connection?

@JanaDrazkova

JanaDrazkova commented Jun 10, 2026

Copy link
Copy Markdown
Contributor Author

At this moment is player_name a parametr of websocket URL path. So I prefer to create a new connection.

Comment thread src/main.py Outdated
Comment thread src/main.py
@ZelenyMartin

Copy link
Copy Markdown
Collaborator

I suggest to provide just method names() returning list of players' names. Then the condition would be just if player_name in players.names(). I hope it would be a simpler code.

@ZelenyMartin

Copy link
Copy Markdown
Collaborator

Can you support this PR with a test? (PR to the quiz-tests, branch with the same name).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Handle duplicate player names

3 participants