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.
public async ValueTask SetNameAsync(string name)
{
- PlayerInfo.PlayerName = name;
+ PlayerInfo.CurrentOutfit.PlayerName = name;
using var writer = Game.StartRpc(NetId, RpcCalls.SetName);
writer.Write(name);
}
}
- PlayerInfo.PlayerName = name;
+ PlayerInfo.CurrentOutfit.PlayerName = name;
return true;
}
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()
{