Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability for host to change game name #662

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from

Conversation

11EJDE11
Copy link
Contributor

@11EJDE11 11EJDE11 commented Feb 11, 2025

Adds the ability for the host to change a game's lobby name from within the lobby itself. The host can type:

/gamename <newname>

The new name is validated, then broadcast to all online players, and all players in the channel.

I've moved the lobby name validation checks to the NameValidator.cs file.

Copy link

github-actions bot commented Feb 11, 2025

Nightly build for this pull request:

Copy link
Contributor

@pzhlkj6612 pzhlkj6612 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting feature!

@SadPencil
Copy link
Member

yeah, the CnCNet lobby is different from a game (game room)

Add example to chatbox command list
@SadPencil SadPencil changed the title Add ability for host to change game lobby name Add ability for host to change game name Feb 12, 2025
@11EJDE11 11EJDE11 requested a review from SadPencil February 12, 2025 19:53
@SadPencil
Copy link
Member

please double check the lobby stuffs in the git diff. I saw this word again in the XML comment.

ClientCore/CnCNet5/NameValidator.cs Outdated Show resolved Hide resolved
Copy link
Contributor

@pzhlkj6612 pzhlkj6612 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

empty lines

/// what is wrong with the name.</returns>
public static string IsGameNameValid(string gameName)
{

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@@ -239,17 +240,14 @@ private void BtnLoadMPGame_LeftClick(object sender, EventArgs e)

private void BtnCreateGame_LeftClick(object sender, EventArgs e)
{
string gameName = tbGameName.Text.Replace(";", string.Empty);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change

@GrantBartlett
Copy link
Member

GrantBartlett commented Feb 19, 2025

I just tested this locally, there is a problem:

As player 1 (Host)

  1. Create a game
  2. Change the game room name

As player 2

  1. Do not join the game, wait for the game room name to change
  2. Attempt to join the room. You will see an error saying "Incorrect password"

image

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.

4 participants