public void Serialize(SerializeWriter writer) { writer.Write(Id); writer.WriteText(Name, false); writer.WriteText(Message, false); writer.Write(Image.Length); writer.Write(Image); }
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); }
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); } }
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()); } }
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()); } }
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()); } }
public void Serialize(SerializeWriter writer) { writer.Write(Id); writer.WriteText(Text, false); }
/// <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); }