Skip to content

Commit

Permalink
Update channel UIName on player's side
Browse files Browse the repository at this point in the history
  • Loading branch information
11EJDE11 committed Feb 11, 2025
1 parent 4ec3f89 commit c8d648e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions DXMainClient/DXGUI/Multiplayer/GameLobby/CnCNetGameLobby.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ PrivateMessagingWindow pmWindow
new StringCommandHandler("MM", CheaterNotification),
new StringCommandHandler(DICE_ROLL_MESSAGE, HandleDiceRollResult),
new NoParamCommandHandler(CHEAT_DETECTED_MESSAGE, HandleCheatDetectedMessage),
new NoParamCommandHandler(LOBBY_NAME_CHANGED, HandleLobbyNameChangeMessage),
new StringCommandHandler(LOBBY_NAME_CHANGED, HandleLobbyNameChangeMessage),
new StringCommandHandler(CHANGE_TUNNEL_SERVER_MESSAGE, HandleTunnelServerChangeMessage)
};

Expand Down Expand Up @@ -1565,8 +1565,11 @@ protected override void BanPlayer(int playerIndex)
private void HandleCheatDetectedMessage(string sender) =>
AddNotice(string.Format("{0} has modified game files during the client session. They are likely attempting to cheat!".L10N("Client:Main:PlayerModifyFileCheat"), sender), Color.Red);

private void HandleLobbyNameChangeMessage(string sender) =>
AddNotice("The game host has changed the lobby name.".L10N("Client:Main:LobbyNameChanged"));
private void HandleLobbyNameChangeMessage(string sender, string newLobbyName)
{
AddNotice(String.Format("The game host has changed the lobby name to {0}".L10N("Client:Main:LobbyNameChanged"), newLobbyName));
channel.UIName = newLobbyName;
}

private void HandleTunnelServerChangeMessage(string sender, string tunnelAddressAndPort)
{
Expand Down Expand Up @@ -1909,7 +1912,7 @@ private void ChangeLobbyName(string lobbyName)
AccelerateGameBroadcasting();

//inform the players in the room
channel.SendCTCPMessage(LOBBY_NAME_CHANGED, QueuedMessageType.SYSTEM_MESSAGE, priority: 9);
channel.SendCTCPMessage(LOBBY_NAME_CHANGED + " " + lobbyName, QueuedMessageType.SYSTEM_MESSAGE, priority: 9);
AddNotice(String.Format("Lobby name changed to {0}.".L10N("Client:Main:LobbyNameChanged"),lobbyName));
}

Expand Down

0 comments on commit c8d648e

Please sign in to comment.