public static RpcSetInfected Deserialize(HazelBinaryReader reader) { var msg = new RpcSetInfected(); msg.infectedIds = reader.ReadList(read => read.ReadByte()); return(msg); }
public void Deserialize(HazelBinaryReader reader, bool onSpawn) { Countdown = reader.ReadSingle(); if (reader.HasBytesLeft()) { CompletedConsoles = reader.ReadList(read => reader.ReadPackedInt32()); } }
public static JoinedGame Deserialize(HazelBinaryReader reader) { var msg = new JoinedGame(); msg.gameCode = reader.ReadInt32(); msg.playerId = reader.ReadInt32(); msg.hostId = reader.ReadInt32(); msg.otherPlayerIds = reader.ReadList(read => read.ReadPackedInt32()); return(msg); }
public void Deserialize(HazelBinaryReader reader) { PlayerName = reader.ReadString(); ColorId = reader.ReadByte(); HatId = (Hat)reader.ReadPackedUInt32(); SkinId = (Skin)reader.ReadPackedUInt32(); Flags = (PlayerInfoFlags)reader.ReadByte(); Tasks = reader.ReadList(read => { var task = new TaskInfo(); task.Deserialize(read); return(task); }); unknown = reader.ReadByte(); }
public override void Deserialize(HazelBinaryReader reader, bool onSpawn) { if (onSpawn) { //Guid gameGuid = new Guid(reader.ReadBytesAndSize()); AllPlayers = reader.ReadList(read => { var playerInfo = new PlayerInfo(reader.ReadByte()); playerInfo.Deserialize(reader); return(playerInfo); }); if (reader.HasBytesLeft()) { Console.WriteLine($"Unhandled Gamedata deserialize() on spawn size: {reader.GetBytesLeft()}"); } return; } else { byte count = reader.ReadByte(); for (int j = 0; j < count; j++) { byte playerId = reader.ReadByte(); PlayerInfo playerInfo2 = AllPlayers.FirstOrDefault(p => p.PlayerId == playerId); if (playerInfo2 != null) { playerInfo2.Deserialize(reader); } else { playerInfo2 = new PlayerInfo(playerId); playerInfo2.Deserialize(reader); AllPlayers.Add(playerInfo2); } } if (reader.HasBytesLeft()) { Console.WriteLine($"Unhandled Gamedata deserialize() size: {reader.GetBytesLeft()}"); } } }
public static Spawn Deserialize(HazelBinaryReader reader) { var msg = new Spawn(); msg.spawnId = reader.ReadPackedInt32(); msg.ownerId = reader.ReadPackedInt32(); msg.flags = (SpawnFlags)reader.ReadByte(); msg.children = reader.ReadList(read => { var netId = reader.ReadPackedInt32(); var size = reader.ReadInt16(); var type = reader.ReadByte(); var body = reader.ReadBytes(size); return(new SpawnChild() { netId = netId, body = body, }); }); return(msg); }
public void Deserialize(HazelBinaryReader reader, bool onSpawn) { InUseBy = reader.ReadList(read => read.ReadByte()); }
public void Deserialize(HazelBinaryReader reader, bool onSpawn) { Countdown = reader.ReadSingle(); UserConsolePairs = reader.ReadList(read => new Tuple <byte, byte>(reader.ReadByte(), reader.ReadByte())); }