public virtual void WriteToStreamDelta(Stream stream, PlayerTeam previous) { if (previous == null) { PlayerTeam.Serialize(stream, this); return; } PlayerTeam.SerializeDelta(stream, this, previous); }
public static byte[] SerializeToBytes(PlayerTeam instance) { byte[] array; using (MemoryStream memoryStream = new MemoryStream()) { PlayerTeam.Serialize(memoryStream, instance); array = memoryStream.ToArray(); } return(array); }
public static void Serialize(Stream stream, RelationshipManager instance) { MemoryStream memoryStream = Pool.Get <MemoryStream>(); stream.WriteByte(8); ProtocolParser.WriteUInt64(stream, instance.lastTeamIndex); if (instance.teamList != null) { for (int i = 0; i < instance.teamList.Count; i++) { PlayerTeam item = instance.teamList[i]; stream.WriteByte(18); memoryStream.SetLength((long)0); PlayerTeam.Serialize(memoryStream, item); uint length = (uint)memoryStream.Length; ProtocolParser.WriteUInt32(stream, length); stream.Write(memoryStream.GetBuffer(), 0, (int)length); } } stream.WriteByte(24); ProtocolParser.WriteUInt64(stream, (ulong)instance.maxTeamSize); Pool.FreeMemoryStream(ref memoryStream); }
public virtual void WriteToStream(Stream stream) { PlayerTeam.Serialize(stream, this); }
public void ToProto(Stream stream) { PlayerTeam.Serialize(stream, this); }