Advertisement
Guest User

Fix lobby chat warning dialog on login

a guest
Jan 3rd, 2020
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 1.67 KB | None | 0 0
  1. From 4845f471f6026770248a6feba0e51a8da51283e5 Mon Sep 17 00:00:00 2001
  2. From: NegativeOne
  3. Date: Fri, 3 Jan 2020 23:05:08 +0100
  4. Subject: [PATCH] Fixed warning dialog when multiple players log in to lobby chat
  5.  
  6. ---
  7. S2Lobby/LobbyProcessor.cs | 12 +++++++-----
  8.  1 file changed, 7 insertions(+), 5 deletions(-)
  9.  
  10. diff --git a/S2Lobby/LobbyProcessor.cs b/S2Lobby/LobbyProcessor.cs
  11. index 560189a..43d7b13 100644
  12. --- a/S2Lobby/LobbyProcessor.cs
  13. +++ b/S2Lobby/LobbyProcessor.cs
  14. @@ -277,7 +277,9 @@ namespace S2Lobby
  15.          private void HandleSelectNickname(SelectNickname payload, PayloadWriter writer)
  16.          {
  17.              uint playerId = payload.CharId;
  18. -            if (playerId != Account.Id)
  19. +
  20. +            Account account = Program.Accounts.Get(Database.Connection, playerId);
  21. +            if (account == null)
  22.              {
  23.                  StatusMsg resultPayload1 = Payloads.CreatePayload<StatusMsg>();
  24.                  resultPayload1.Errorcode = 1;
  25. @@ -288,10 +290,10 @@ namespace S2Lobby
  26.              }
  27.  
  28.              SelectNicknameReply resultPayload2 = Payloads.CreatePayload<SelectNicknameReply>();
  29. -            resultPayload2.CharId = Account.Id;
  30. -            resultPayload2.Name = Account.PlayerName;
  31. -            resultPayload2.OwnerId = Account.Id;
  32. -            resultPayload2.OwnerName = Account.UserName;
  33. +            resultPayload2.CharId = account.Id;
  34. +            resultPayload2.Name = account.PlayerName;
  35. +            resultPayload2.OwnerId = account.Id;
  36. +            resultPayload2.OwnerName = account.UserName;
  37.              resultPayload2.GuildId = 0;
  38.              resultPayload2.GuildName = null;
  39.              resultPayload2.GuildRole = 0;
  40. --
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement