Exemplo n.º 1
0
 /// <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)
     }
 }
Exemplo n.º 2
0
 public override byte[] GetBytes()
 {
     using (var ms = new MemoryStream())
     {
         using (var sw = new SerializeWriter(ms))
         {
             sw.WriteTextStatic(Username, 13);
             sw.WriteTextStatic(Utilities.Sha1Sum2(Password), 40);
         }
         return(ms.ToArray());
     }
 }
Exemplo n.º 3
0
 public override byte[] GetBytes()
 {
     using (var ms = new MemoryStream())
     {
         using (var sw = new SerializeWriter(ms))
         {
             sw.WriteTextStatic(Character.Token, 44);
             sw.WriteTextStatic(Character.Name, 13);
             sw.Write(Character.CharacterDb.HeadEqp);
         }
         return(ms.ToArray());
     }
 }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 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());
     }
 }
Exemplo n.º 6
0
 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());
     }
 }
Exemplo n.º 7
0
 public void Serialize(SerializeWriter writer)
 {
     writer.WriteTextStatic(Token, 44);
     writer.Write(IsCorrect);
     writer.Write(Step);
     writer.Write((int)Item.Item);
     writer.Write(Timeout);
 }
Exemplo n.º 8
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());
     }
 }
 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());
     }
 }
Exemplo n.º 10
0
 public void Serialize(SerializeWriter writer)
 {
     writer.WriteTextStatic(Token, 44);
     writer.Write(Score);
     writer.Write(AnswerCorrectly);
     writer.Write(Experience);
     writer.Write(CurrentExperience);
     writer.Write(CurrentLevel);
     writer.Write(LootCount);
 }
 public override byte[] GetBytes()
 {
     using (var ms = new MemoryStream())
     {
         using (var sw = new SerializeWriter(ms))
         {
             sw.WriteTextStatic(Token, 44);
         }
         return(ms.ToArray());
     }
 }
Exemplo n.º 12
0
 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());
     }
 }
Exemplo n.º 13
0
 public override byte[] GetBytes()
 {
     using (var ms = new MemoryStream())
     {
         using (var sw = new SerializeWriter(ms))
         {
             sw.WriteTextStatic(CurrentPlayer, 44);
             sw.Write(Duration);
         }
         return(ms.ToArray());
     }
 }
 public override byte[] GetBytes()
 {
     using (var ms = new MemoryStream())
     {
         using (var sw = new SerializeWriter(ms))
         {
             sw.WriteTextStatic(Room.GetIdentifier(), 36);
             sw.Write(Room.Clients.Count);
             Log.Info("Room Id: {0}, Count: {1}", Room.GetIdentifier(), Room.Clients.Count);
         }
         return(ms.ToArray());
     }
 }
Exemplo n.º 15
0
 public void Serialize(SerializeWriter writer)
 {
     // enable when further refactoring occur/
     //writer.WriteTextStatic(Token, 44);
     writer.WriteTextStatic(Name, 13);
     writer.Write(Vec3);
     writer.Write(Direction);
     // Write Attributes/Customization
     writer.Write((byte)CharacterDb.HeadEqp);
     writer.Write((byte)CharacterDb.TopEqp);
     writer.Write((byte)CharacterDb.BottomEqp);
     writer.Write((byte)CharacterDb.ShoeEqp);
 }
Exemplo n.º 16
0
 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());
     }
 }
Exemplo n.º 17
0
 public void Serialize(SerializeWriter writer)
 {
     writer.WriteTextStatic(Account.Username, 13);
     writer.Write(CompletionDate.Ticks);
 }
Exemplo n.º 18
0
 public void Serialize(SerializeWriter writer)
 {
     writer.WriteTextStatic(Username, 13);
     writer.Write(Score);
 }