r2mods/ilspy_dump/ror2_csproj/RoR2/SyncListUserVote.cs

21 lines
524 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
using UnityEngine.Networking;
namespace RoR2;
public class SyncListUserVote : SyncListStruct<UserVote>
{
public override void SerializeItem(NetworkWriter writer, UserVote item)
{
writer.Write(item.networkUserObject);
writer.WritePackedUInt32((uint)item.voteChoiceIndex);
}
public override UserVote DeserializeItem(NetworkReader reader)
{
UserVote result = default(UserVote);
result.networkUserObject = reader.ReadGameObject();
result.voteChoiceIndex = (int)reader.ReadPackedUInt32();
return result;
}
}