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.WriteTextStatic(Token, 44); writer.Write(IsCorrect); writer.Write(Step); writer.Write((int)Item.Item); writer.Write(Timeout); }
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) { writer.Write(Id); writer.Write(Name); writer.Write(Questions.Count); foreach (Question question in Questions) { writer.Write(question); } }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.Write(AttributeNumber); sw.Write(ItemNumber); } return(ms.ToArray()); } }
/// <summary> /// We will be sending this data over, /// </summary> /// <param name="writer"></param> public void Serialize(SerializeWriter writer) { writer.WriteTextStatic(GetIdentifier(), 44); // Write Token (44) writer.WriteTextStatic(Client.Character.Name, 13); writer.Write(Position); // Write Position (3) writer.Write(MoveLeft); // Write MoveLeft (4) writer.Write(Items.Count); // Write Item Count (4) foreach (InventoryItem item in Items) { writer.Write(item); // Write Individual Item (0) } }
public override byte[] GetBytes() { using (MemoryStream ms = new MemoryStream()) { using (SerializeWriter sw = new SerializeWriter(ms)) { sw.Write(Key); sw.Write(IV); } return(ms.ToArray()); } }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.Write(Question); sw.Write(DurationInSec); } return(ms.ToArray()); } }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.WriteTextStatic(Token, 44); sw.Write(StartPos); sw.Write(TargetPos); } return(ms.ToArray()); } }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.Write(Experience); sw.Write(LeaderboardStats); sw.Write(GameCount); } return(ms.ToArray()); } }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.Write(Inventory.Head); sw.Write(Inventory.Shirt); sw.Write(Inventory.Pant); sw.Write(Inventory.Shoe); } return(ms.ToArray()); } }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.Write(IsLegalMove); sw.WriteTextStatic(Token, 44); sw.Write(NewPos); sw.Write((int)Direction); } return(ms.ToArray()); } }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.Write(PlayerSequence.Count); foreach (Player p in PlayerSequence) { sw.Write(p); } } return(ms.ToArray()); } }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.Write(Rewards.Length); foreach (Reward r in Rewards) { sw.Write(r); } } return(ms.ToArray()); } }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.Write(Lobby.RoomManager.GetRooms().Count); foreach (Room r in Lobby.RoomManager.GetRooms()) { sw.Write(r); } } return(ms.ToArray()); } }
public void Serialize(SerializeWriter writer) { writer.WriteTextStatic(Guid.ToString(), 36); // Write Room Name writer.WriteTextStatic(Name, 40); // Write IsRoomLocked writer.Write(IsLocked); // Write Num Of Client writer.Write(Clients.Count); // Write Room Size writer.Write(Size); // Write IsInGame writer.Write(IsInGame); }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.Write(Notices.Length); foreach (var noticeIndex in Notices) { sw.Write(noticeIndex); } } return(ms.ToArray()); } }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.Write(Scores.Count); foreach (GameScoreModel model in Scores) { sw.Write(model); } } return(ms.ToArray()); } }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.Write(Annoucements.Length); foreach (var annoucement in Annoucements) { sw.Write(annoucement); } } return(ms.ToArray()); } }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.Write(IsLastPage); sw.Write(Entries.Count); foreach (var entry in Entries) { sw.Write(entry); } } return(ms.ToArray()); } }
public void Serialize(SerializeWriter writer) { foreach (Mastery mastery in Masteries) { writer.Write(mastery.Exp); } }
public Packet(ushort id) { Writer = new SerializeWriter(new MemoryStream()); Id = id; Writer.Write(id); }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.Write(Room.Clients.Count); foreach (GameClient client in Room.Clients) { sw.WriteTextStatic(client.Character.Token, 44); sw.Write(client.Character); } sw.WriteTextStatic(Room.Owner.Character.Token, 44); } return(ms.ToArray()); } }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.WriteTextStatic(Token, 44); sw.Write(Character); sw.Write(HasOwnerChange); if (HasOwnerChange) { sw.WriteTextStatic(Owner, 44); } } return(ms.ToArray()); } }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.Write(OwnRanking); sw.Write(IsLastPage); sw.Write(Entries.Length); foreach (Ranking r in Entries) { sw.Write(r); } } return(ms.ToArray()); } }
public override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { Log.Debug("Caster: {0}", Caster); sw.WriteTextStatic(Caster, 44); Log.Debug("Victim: {0}", Victim); sw.WriteTextStatic(Victim, 44); Log.Debug("Item: {0}", (int)Item.Item); sw.Write(Item); Log.Debug("Tile: {0}, {1}, {2}", Tile.X, Tile.Y, Tile.Color); sw.Write(Tile); } 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 override byte[] GetBytes() { using (var ms = new MemoryStream()) { using (var sw = new SerializeWriter(ms)) { sw.Write(0); } return(ms.ToArray()); } }
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.WriteTextStatic(Room.GetIdentifier(), 36); sw.Write(Room.IsInGame); } return(ms.ToArray()); } }