mirror of
https://github.com/Impostor/Impostor.git
synced 2026-10-20 01:46:11 +00:00
Switch PlayerName writes to Outfit
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.
This commit is contained in:
1 parent
ad18eda32f
commit
525af85848
3 files changed
+3
-3
No files matched your search
@@ -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);
|
||||
|
||||
@@ -686,7 +686,7 @@ namespace Impostor.Server.Net.Inner.Objects
|
||||
}
|
||||
}
|
||||
|
||||
PlayerInfo.PlayerName = name;
|
||||
PlayerInfo.CurrentOutfit.PlayerName = name;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,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()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user