示例#1
0
 public virtual void WriteToStreamDelta(Stream stream, PlayerTeam previous)
 {
     if (previous == null)
     {
         PlayerTeam.Serialize(stream, this);
         return;
     }
     PlayerTeam.SerializeDelta(stream, this, previous);
 }
示例#2
0
 public static byte[] SerializeToBytes(PlayerTeam instance)
 {
     byte[] array;
     using (MemoryStream memoryStream = new MemoryStream())
     {
         PlayerTeam.Serialize(memoryStream, instance);
         array = memoryStream.ToArray();
     }
     return(array);
 }
示例#3
0
        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);
        }
示例#4
0
 public virtual void WriteToStream(Stream stream)
 {
     PlayerTeam.Serialize(stream, this);
 }
示例#5
0
 public void ToProto(Stream stream)
 {
     PlayerTeam.Serialize(stream, this);
 }