]> git.deb.at Git - rhonda/impostor.git/commitdiff
Switch PlayerName writes to Outfit
authorminiduikboot <mini@duikbo.at>
Sun, 18 Aug 2024 09:16:44 +0000 (11:16 +0200)
committerminiduikboot <mini@duikbo.at>
Tue, 20 Aug 2024 19:41:38 +0000 (21:41 +0200)
In 2024.6.18 Innersloth changed the storage location of the PlayerName
from PlayerInfo to PlayerOutfit. If we don't set the PlayerName, we'll
send an incomplete PlayerInfo to new players, so new players are unable
to stay connected as they will not receive complete PlayerInfo objects
before a timeout in the client activates.

Because we publish PlayerName in the API, we can't completely remove
the PlayerName field from PlayerInfo. We also use it internally in a few
places, so I don't this is worth removing.

src/Impostor.Server/Net/Inner/Objects/InnerPlayerControl.Api.cs
src/Impostor.Server/Net/Inner/Objects/InnerPlayerControl.cs
src/Impostor.Server/Net/Inner/Objects/InnerPlayerInfo.cs

index bd711618e7b1b276e3e23d4de246b3f22fccae31..46bb7094150c9d468e2b4c03677bb08ac6d598d2 100644 (file)
@@ -20,7 +20,7 @@ namespace Impostor.Server.Net.Inner.Objects
 
         public async ValueTask SetNameAsync(string name)
         {
-            PlayerInfo.PlayerName = name;
+            PlayerInfo.CurrentOutfit.PlayerName = name;
 
             using var writer = Game.StartRpc(NetId, RpcCalls.SetName);
             writer.Write(name);
index 16fa42ed7510cf03160bf0565473f876ce0c29e8..113226d6306038e4d7ac70eda4afc098bfd65ae4 100644 (file)
@@ -686,7 +686,7 @@ namespace Impostor.Server.Net.Inner.Objects
                 }
             }
 
-            PlayerInfo.PlayerName = name;
+            PlayerInfo.CurrentOutfit.PlayerName = name;
 
             return true;
         }
index 1a9de063a0c17e1840b6a5f099c404103b6bc0d9..66410d6fddf538a875b4be88ecafc574dfe5a8b2 100644 (file)
@@ -34,7 +34,7 @@ namespace Impostor.Server.Net.Inner.Objects
 
         public int ClientId { get; internal set; }
 
-        public string PlayerName { get; internal set; } = string.Empty;
+        public string PlayerName => CurrentOutfit.PlayerName;
 
         public Dictionary<PlayerOutfitType, PlayerOutfit> Outfits { get; } = new()
         {