Exemplo n.º 1
0
        public override byte[] WritedData()
        {
            using (var stream = new MemoryStream())
            using (var writer = new BinaryWriter(stream))
            {
                writer.WriteH(_info.ClassType.Ordinal());

                writer.WriteQ(_info.CharacterId);
                writer.WriteC(0);//possible slot
                writer.Write(BinaryExt.WriteFixedString(_info.CharacterName, Encoding.Unicode, 62));
                writer.WriteD(_info.Level);
                writer.WriteD(0);

                writer.Write(_inventoryField);

                writer.Write(_info.AppearancePresets);//10
                writer.WriteC((byte)_info.Zodiac);
                writer.Write(_info.AppearanceOptions);//800

                writer.Write(BinaryExt.WriteFixedString(_info.Surname, Encoding.Unicode, 62));

                writer.Write("FFFFFFFFFFFFFFFF0000000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF0000000000309F055BF67F0000701ED5DA150000000000000000000000000000FFFFFFFFFFE86FC2A10A".ToBytes());

                return stream.ToArray();
            }
        }      
Exemplo n.º 2
0
        public override byte[] WritedData()
        {
            using (var stream = new MemoryStream())
            using (var writer = new BinaryWriter(stream))
            {
                var inventory = _player.Inventory;
                
                writer.WriteC(1);
                writer.WriteC(1);
                writer.WriteD(_player.GameSessionId);
                writer.Skip(12);
                writer.WriteH(inventory.Items.Count);
                writer.WriteC(0);

                for (short i = 0; i < inventory.Items.Count; i++)
                {
                    var item = inventory.Items[(short) (i + 1)];
                   
                    writer.WriteC(i);
                    writer.WriteD(item.ItemId);
                    writer.WriteQ(item.Count);
                    writer.Write("FFFFFFFFFFFFFFFF".ToBytes());
                    writer.WriteD(i == 0 ? 0 : 1);
                    writer.WriteD(0);
                    writer.WriteC(0);
                    writer.Write("0100FF7FFF7F3A38E56FF2862300FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000000000000000000000000000000000000000000000000".ToBytes());
                }

                return stream.ToArray();
            }
        }
Exemplo n.º 3
0
 public override byte[] WritedData()
 {
     using (var stream = new MemoryStream())
     using (var writer = new BinaryWriter(stream))
     {
         writer.Write("ABE7FFFFFFFFFFFFABE7FFFFFFFFFFFF".ToBytes());//static field
         writer.WriteD(_player.GameSessionId);
         writer.WriteD(_player.DatabaseCharacterData.Level);              
         writer.WriteQ(0); 
         writer.WriteQ(1); //2626 percent todo
         writer.Skip(9);
         return stream.ToArray();
     }
 }
Exemplo n.º 4
0
            public override byte[] WritedData()
            {
                using (var stream = new MemoryStream())
                using (var writer = new BinaryWriter(stream))
                {
                    writer.WriteD(_player.GameSessionId);                   
                    writer.WriteQ(_player.Uid);
                    writer.WriteD(1); //unk, type maybe or flag
                    writer.Write(BinaryExt.WriteFixedString(_player.DatabaseCharacterData.CharacterName, Encoding.Unicode, 62));
                    writer.WriteC(_player.DatabaseCharacterData.AppearancePresets[0]); //face
                    writer.WriteC(_player.DatabaseCharacterData.AppearancePresets[1]); //hair
                    writer.WriteC(_player.DatabaseCharacterData.AppearancePresets[2]); //goatee
                    writer.WriteC(_player.DatabaseCharacterData.AppearancePresets[3]); //mustache
                    writer.WriteC(_player.DatabaseCharacterData.AppearancePresets[4]); //sideburns
                    writer.Write("05".ToBytes()); //020104070705 unk

                    return stream.ToArray();
                }
            }
 public override byte[] WritedData()
 {
     using (var stream = new MemoryStream())
     using (var writer = new BinaryWriter(stream))
     {
         writer.WriteD(_character.GameSessionId);
         writer.WriteQ(_character.Uid);
         writer.Write("E86C0000".ToBytes()); //unk todo
         writer.Write("02000100320301003B03".ToBytes()); //unk
         return stream.ToArray();
     }
 }
        public override byte[] WritedData()
        {
            using (var stream = new MemoryStream())
            using (var writer = new BinaryWriter(stream))
            {
                writer.Write(_character.GameSessionId); 
                writer.Write(_character.Uid);
                writer.WriteD(1);
                writer.Write(_character.DatabaseCharacterData.AppearanceOptions);
                writer.Write(BinaryExt.WriteFixedString(_character.DatabaseCharacterData.Surname, Encoding.Unicode, 62));

                return stream.ToArray();
            }
        }
Exemplo n.º 7
0
 public override byte[] WritedData()
 {
     using (var stream = new MemoryStream())
     {
         using (var writer = new BinaryWriter(stream))
         {
             writer.WriteH(_chatType.GetHashCode());
             writer.WriteD(_sessionId);
             writer.Write(BinaryExt.WriteFixedString(_characterName, Encoding.Unicode, 62));
             writer.WriteH(1);
             writer.WriteH(0);
             writer.Write(Encoding.Unicode.GetBytes(_message));
             writer.WriteH(0);
         }
         return stream.ToArray();
     }
 }
Exemplo n.º 8
0
        public override byte[] WritedData()
        {
            using (var stream = new MemoryStream())
            using (var writer = new BinaryWriter(stream))
            {
                writer.Skip(4);
                writer.WriteD(DateTime.Now.Millisecond);
                writer.Skip(4);

                var realms = NetworkService.WorldServers.Values.ToList();

                writer.WriteH(realms.Count);

                for (int i = 0; i < realms.Count; i++)
                {
                    var realm = realms[i];

                    writer.WriteH(realm.ChannelId); 
                    writer.WriteH(realm.Id);

                    writer.Write(BinaryExt.WriteFixedString($" {realm.ChannelName}", Encoding.Unicode, 62));
                    writer.Write(BinaryExt.WriteFixedString($" {realm.RealmName}", Encoding.Unicode, 62));

                    writer.Write("CB4B00".ToBytes());

                    writer.Write(BinaryExt.WriteFixedString(realm.RealmIp, Encoding.ASCII, 16));
                    writer.WriteH(realm.RealmPort);

                    writer.WriteC(1);
                    writer.WriteC(1);
                    writer.WriteC(1);

                    writer.WriteC(AuthProcessor.GetCharacterCount(_accInfo.Id));
                    writer.WriteC(_accInfo.MaxSlotCount);

                    writer.Write("0000FEFFFFFFFFFFFFFFD48D6155000000000000000000000000000000000000".ToBytes());
                }

                return stream.ToArray();
            }
        }
Exemplo n.º 9
0
        public override byte[] WritedData()
        {
            using (var stream = new MemoryStream())
            using (var writer = new BinaryWriter(stream))
            {
                writer.WriteQ(_character.Uid);
                writer.WriteD(1);
                writer.WriteH(1);
                writer.WriteD(_character.GameSessionId);

                writer.Write("8014BCC7".ToBytes()); //x
                writer.Write("000072C5".ToBytes()); //y
                writer.Write("80F99747".ToBytes()); //z
                writer.Write("046788BE".ToBytes()); //cosinus
                writer.WriteD(0);
                writer.Write("80BF763F".ToBytes()); //sinus

                writer.WriteD(_character.DatabaseCharacterData.ClassType.Ordinal());
                writer.Write("0000803F00004743ABE7FFFFFFFFFFFFABE7FFFFFFFFFFFF02946DE4950000000000000000000000000000000003000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000FFFFFFFF0000000000000000000000000000000000000000000000000000000000FFFFFF00000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000000000FE00000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000FFFFFF000000000000000000000000000000000000000000000000000000000000FEFFFF00000000000000000000000000000000000000000000000000000000FFFFFF0000000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000FF0000FF00000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000FF00000000000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000FFFFFFFF0000000000000000000000000000000000000000000000000000000000FFFFFF00000000000000000000000000000000000000000000000000000000FFFFFFFF00000000000000000000000000000000000000000000000000000000000000FE00000000000000000000000000000000000000000000000000000000FFFFFFFFD3090000000000006F09170000000000".ToBytes());
                writer.WriteD(1);
                writer.WriteQ(_character.Uid);

                writer.WriteD(1);
                writer.WriteD(1);
                writer.WriteD(2);
                writer.WriteD(1);

                writer.WriteD(0);
                writer.WriteD(0);
                writer.WriteD(0);

                writer.Write("3B34000005FCFFFF2500000000000000000000000005511D0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FCFFFF01".ToBytes());
                writer.WriteD(_character.DatabaseCharacterData.Level);
                writer.WriteD(0);
            
                writer.Write("030000000000000000000000000000000000000000000000A05100000000000000000000000000000000000000FCFFFF000000000000000000000000020000000000000000000000000000000200000000000000000000000000".ToBytes());

                writer.WriteD(1);
                writer.Write(BinaryExt.WriteFixedString(_character.DatabaseCharacterData.Surname, Encoding.Unicode, 62));
                writer.Skip(402); //zeros
                writer.WriteD(1);
                writer.Write(BinaryExt.WriteFixedString(_character.DatabaseCharacterData.CharacterName, Encoding.Unicode, 62));
                writer.Write(_character.DatabaseCharacterData.AppearancePresets);

                //TODO - inventory
                writer.Write("3B340000FFFFFFFFFFFFFFFF6000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF002E330000FFFFFFFFFFFFFFFF6400FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00F72C0000FFFFFFFFFFFFFFFF2F00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00F82C0000FFFFFFFFFFFFFFFF3200FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00382A0000FFFFFFFFFFFFFFFF6400FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00F62C0000FFFFFFFFFFFFFFFF3000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000000000000060C9F67F0000000000000100FFFF18CE4A490100000000000000000000000019E9070000000040F3B8611800000052C460C8F67F00000000000000000000F018E9070000000000000000F10C000080C928C8FFFFFFFFFEFFFFFFFFFFFFFF38F4B86118000000010000000000000031EA5FC8F67F0000F08617091800000000000000000000001300000000000000000000000000000000000000FFFFFFFF18CE4A49010000000000000000000000B8F4B86118000000FEFFFFFFFFFFFFFF29E85FC8F67F00000100".ToBytes());
                writer.WriteH(_character.DatabaseCharacterData.Zodiac.GetHashCode());
                writer.Write("FCFFFF37010000000000001301000000000000000000000000000037010000000000000000000000000000000000000000FEFF01".ToBytes());

                return stream.ToArray();
            }
        }
Exemplo n.º 10
0
 public override byte[] WritedData()
 {
     using (var stream = new MemoryStream())
     using (var writer = new BinaryWriter(stream))
     {
         writer.Write("0100000100FCFFFF0000000000000000000000000100".ToBytes());
         writer.WriteD(_player.GameSessionId);
         writer.WriteF(_player.Position.Point.X);
         writer.WriteF(_player.Position.Point.Y);
         writer.WriteF(_player.Position.Point.Z);
         writer.WriteD(0);
         writer.WriteF(_player.Position.Cosinus);
         writer.WriteF(_player.Position.Sinus);
         writer.WriteD(_player.DatabaseCharacterData.ClassType.Ordinal());
         writer.Write("00003243".ToBytes()); //curr hp
         writer.Write("00003243".ToBytes()); //max hp
         writer.Write("F5FCFFFFFFFFFFFFF5FCFFFFFFFFFFFF02946DE49500000000000000000000000000000000030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000309A00000000000000000000000000000000000000000000000000000000000010300000000000000000000000000000000000000000000000000000000000001030000000000000000000000000000000000000000000000000000000000000183B000000000000000000000000000000000000000000000000000000000000583A000000000000000000000000000000000000000000000000000000000000D8EF0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000178D000000000000000000000000000000000000000000000000000000000000180000000000000000000000000000000000000000000000000000000000000089AE000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000077D1000000000000000000000000000000000000000000000000000000000000B0DB00000000000000000000000000000000000000000000000000000000000049F000000000000000000000000000000000000000000000000000000000000001F1000000000000000000000000000000000000000000000000000000000000A5510000000000000000000000000000000000000000000000000000000000006AEF000000000000000000000000000000000000000000000000000000000000FD01000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FFFF883C0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FD0100000000000000000000000000000000000000000000000000000000000060F100000000000000000000000000000000000000000000000000000000000060F10000000000000000000000000000000000000000000000000000000000000300287300000000000001000000".ToBytes());
         writer.WriteQ(_player.Uid);
         writer.WriteD(1);
         writer.WriteD(1);
         writer.WriteD(3);
         writer.Write("010000000000000000000000000000004238000000FCFFFF25000000000000000000000000053401000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000FCFFFF0108000000000000000300000000000000000040085F0CC16FF286230000000000E86C00000000000000000000000000000000000000FCFFFF0000000000000000000000000200000000000000000000000000".ToBytes());
         return stream.ToArray();
     }
 }
Exemplo n.º 11
0
            public override byte[] WritedData()
            {
                using (var stream = new MemoryStream())
                using (var writer = new BinaryWriter(stream))
                {
                    writer.WriteD(_player.GameSessionId);
                    writer.WriteQ(_player.Uid);
                    writer.WriteD(3); //unk 
                    writer.Write("00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +  //Weapon 
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +  //Second weapon
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" +
                                 "00000000FEFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF".ToBytes()); //TODO

                    return stream.ToArray();
                }
            }
Exemplo n.º 12
0
            public override byte[] WritedData()
            {
                using (var stream = new MemoryStream())
                using (var writer = new BinaryWriter(stream))
                {
                    writer.Write(_player.GameSessionId);
                    writer.Write("2873000000000000".ToBytes()); //unk
                    writer.WriteD(1);
                    writer.Write(BinaryExt.WriteFixedString(_accountInfo.FamilyName, Encoding.Unicode, 62));
                    writer.Skip(402);

                    return stream.ToArray();
                }
            }
Exemplo n.º 13
0
        public override byte[] WritedData()
        {
            using (var stream = new MemoryStream())
            using (var writer = new BinaryWriter(stream))
            {
                writer.Skip(24);
                writer.Write(BinaryExt.WriteFixedString(_account.FamilyName, Encoding.Unicode, 62));
               
                /*GAG || If charaters not exist */

                if (!_characters.Any())
                {
                    writer.WriteH(65535);
                    writer.WriteD(0);
                    writer.WriteQ(-1);
                    writer.WriteQ(0);
                    writer.WriteC(0);
                    writer.WriteQ(0);
                    writer.WriteH(0);
                    writer.WriteC(254);
                    writer.WriteD(65535);
                    writer.WriteC(0);
                    writer.WriteC(254);
                    writer.WriteQ(-1);
                    writer.WriteQ(0);
                    writer.WriteQ(0);
                    writer.WriteQ(0);
                    writer.WriteC(0);
                    writer.WriteC(254);
                    writer.WriteC(255);
                    writer.WriteH(65535);
                    writer.WriteQ(-1);
                    writer.Skip(51);

                    return stream.ToArray();
                }

                writer.Write(_staticField);
                writer.WriteC(_characters.Count);

                for (int index = 0; index < _characters.Count; index++)
                {
                    var characterInfo = _characters[index];
                    var equipment = (EquipmentStorage)characterInfo.EquipmentData;

                    writer.WriteH(characterInfo.ClassType.Ordinal());
                    writer.WriteQ(characterInfo.CharacterId);
                    writer.WriteC(0); //unk flag
                    writer.Write(BinaryExt.WriteFixedString(characterInfo.CharacterName, Encoding.Unicode, 62));
                    writer.WriteD(characterInfo.Level);
                    writer.WriteD(0); //unk

                    using (equipment)
                        if (equipment.Items.Count != 0)
                        {
                            byte[] equipmentData = equipment.GetEquipmentData();

                            writer.Write(equipmentData);
                            writer.Skip(107);
                        }
                        else
                            writer.Write(_inventoryField);

                    writer.Write(characterInfo.AppearancePresets);
                    writer.WriteC((byte)characterInfo.Zodiac);
                    writer.Write(characterInfo.AppearanceOptions);
                    writer.Skip(62);
                    writer.Write("FFFFFFFFFFFFFFFF001E69745600000000717A715600000000805FF2C70000B8C40028DD47FFFFFFFFFFFFFFFF0000040E7456000000000000000000000000000000000000000000000000000000000000D0FFFF43".ToBytes());
                }

                return stream.ToArray();
            }
        }