Esempio n. 1
0
 public void Serialize(SerializeWriter writer)
 {
     writer.Write(Id);
     writer.WriteText(Name, false);
     writer.WriteText(Message, false);
     writer.Write(Image.Length);
     writer.Write(Image);
 }
Esempio n. 2
0
 public void Serialize(SerializeWriter writer)
 {
     // Determine how to serialize this object, so that it can be send via the Socket Stream
     writer.Write(x);
     writer.Write(y);
     writer.WriteText(z);
 }
Esempio n. 3
0
        public void Serialize(SerializeWriter writer)
        {
            writer.WriteText(QuestionStr, false);
            List <Answer> answers = new List <Answer>(Answers);

            answers.Shuffle();
            foreach (Answer answer in answers)
            {
                writer.Write(answer);
            }
        }
Esempio n. 4
0
 public override byte[] GetBytes()
 {
     using (var ms = new MemoryStream())
     {
         using (var sw = new SerializeWriter(ms))
         {
             sw.WriteText(StudentName, false);
         }
         return(ms.ToArray());
     }
 }
 public override byte[] GetBytes()
 {
     using (var ms = new MemoryStream())
     {
         using (var sw = new SerializeWriter(ms))
         {
             sw.Write((byte)Message.Type);
             sw.WriteText(Message.ToString());
         }
         return(ms.ToArray());
     }
 }
Esempio n. 6
0
 public override byte[] GetBytes()
 {
     using (var ms = new MemoryStream())
     {
         using (var sw = new SerializeWriter(ms))
         {
             // Write the data you want to the underlying buffer
             sw.Write(StatusCode);
             sw.WriteText(Message);
             // with a serializable object, you write it like this instead
             Object.Serialize(sw);
             // Client that receive this should read the Status Code first then the Message and then Object.
         }
         return(ms.ToArray());
     }
 }
Esempio n. 7
0
 public override byte[] GetBytes()
 {
     using (var ms = new MemoryStream())
     {
         using (var sw = new SerializeWriter(ms))
         {
             sw.WriteText(QuizName, false);
             sw.Write(WaitingRoom.Clients.Count);
             foreach (var client in WaitingRoom.Clients)
             {
                 sw.WriteTextStatic(client.Character.Token, 44);
                 sw.WriteTextStatic(client.Character.Name, 13);
                 sw.Write(client.Character.CharacterDb.HeadEqp);
             }
         }
         return(ms.ToArray());
     }
 }
Esempio n. 8
0
 public void Serialize(SerializeWriter writer)
 {
     writer.Write(Id);
     writer.WriteText(Text, false);
 }
Esempio n. 9
0
 /// <summary>
 /// Serialize the content, so we can send this object through the network stream
 /// </summary>
 /// <param name="writer"></param>
 public void Serialize(SerializeWriter writer)
 {
     writer.Write((byte)Type);
     writer.WriteText(Text);
     writer.Write(Tick.Ticks);
 }