예제 #1
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();
            }
        }
예제 #2
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();
            }
        }      
예제 #3
0
        public override byte[] WritedData()
        {
            //that client settings(opened slots, available classes)
            using (var stream = new MemoryStream())
            using (var writer = new BinaryWriter(stream))
            {
                writer.WriteC(4);
                writer.WriteC(10);
                writer.WriteC(10);
                writer.Write("C0C62D0000000000E093040000000000E0930400E093040060EA0000000000000004080C10141518191A1C1F2020202020202020202020202020202020202020000000002E000000805101000000000080F403000000000080812B00000000000001010D000096000000010000".ToBytes());

                return stream.ToArray();
            }        
        }
예제 #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();
                }
            }
예제 #5
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();
            }
        }
예제 #6
0
        public override byte[] WritedData()
        {
            using (var stream = new MemoryStream())
            using (var writer = new BinaryWriter(stream))
            {
                writer.WriteQ(_characterid);
                writer.WriteQ(_date);
                writer.WriteC(_result);

                return stream.ToArray();
            }
        }
        public override byte[] WritedData()
        {
            using (var stream = new MemoryStream())
            using (_writer = new BinaryWriter(stream))
            {
                var storage = _player.Equipment;

                _writer.WriteC(1);

                WriteEquipedItem(storage, EquipSlot.LeftHand);
                WriteEquipedItem(storage, EquipSlot.RightHand);
                WriteEquipedItem(storage, EquipSlot.SubTool);
                WriteEquipedItem(storage, EquipSlot.Chest);
                WriteEquipedItem(storage, EquipSlot.Glove);
                WriteEquipedItem(storage, EquipSlot.Boots);
                WriteEquipedItem(storage, EquipSlot.Helm);
                WriteEquipedItem(storage, EquipSlot.Necklace);
                WriteEquipedItem(storage, EquipSlot.Ring1);
                WriteEquipedItem(storage, EquipSlot.Ring2);
                WriteEquipedItem(storage, EquipSlot.Earing1);
                WriteEquipedItem(storage, EquipSlot.Earing2);
                WriteEquipedItem(storage, EquipSlot.Belt);
                WriteEquipedItem(storage, EquipSlot.Lantern);
                WriteEquipedItem(storage, EquipSlot.AvatarChest);
                WriteEquipedItem(storage, EquipSlot.AvatarGlove);
                WriteEquipedItem(storage, EquipSlot.AvatarBoots);
                WriteEquipedItem(storage, EquipSlot.AvatarHelm);
                WriteEquipedItem(storage, EquipSlot.AvatarWeapon);
                WriteEquipedItem(storage, EquipSlot.AvatarSubWeapon);
                WriteEquipedItem(storage, EquipSlot.AvatarUnderWear);
                WriteEquipedItem(storage, EquipSlot.FaceDecoration3);
                WriteEquipedItem(storage, EquipSlot.FaceDecoration1);
                WriteEquipedItem(storage, EquipSlot.FaceDecoration2);

                /*TODO find other*/
                _writer.Write("0000000000C0C200000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF00001010441501000000FEFFFFFFFFFFFFFF00000000000000005F978756000000001010441501000000A96BD0ED85BE3F01000000".ToBytes());
                _writer.Write("0000000000C0C200000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF00001010441501000000FEFFFFFFFFFFFFFF00000000000000005F978756000000001010441501000000A96BD0ED85BE3F01000000".ToBytes());
                _writer.Write("0000000000C0C200000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF00001010441501000000FEFFFFFFFFFFFFFF00000000000000005F978756000000001010441501000000A96BD0ED85BE3F01000000".ToBytes());
                _writer.Write("0000000000C0C200000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF00001010441501000000FEFFFFFFFFFFFFFF00000000000000005F978756000000001010441501000000A96BD0ED85BE3F01000000".ToBytes());
                _writer.Write("0000000000C0C200000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF00001010441501000000FEFFFFFFFFFFFFFF00000000000000005F978756000000001010441501000000A96BD0ED85BE3F01000000".ToBytes());
                _writer.Write("0000000000C0C200000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF00001010441501000000FEFFFFFFFFFFFFFF00000000000000005F978756000000001010441501000000A96BD0ED85BE3F01000000".ToBytes());
                _writer.Write("0000000000C0C200000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF00001010441501000000FEFFFFFFFFFFFFFF00000000000000005F978756000000001010441501000000A96BD0ED85BE3F01000000".ToBytes());
                _writer.Write("0000000000C0C200000000000000000000000000000000000000000000000000000000FFFFFFFFFFFFFFFF00001010441501000000FEFFFFFFFFFFFFFF00000000000000005F978756000000001010441501000000A96BD0ED85BE3F01000000".ToBytes());

                return stream.ToArray();
            }
        }
예제 #8
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();
            }
        }