예제 #1
0
        public static void Send(LobbyClient client)
        {
            PacketOut Out = new PacketOut((UInt32)Opcodes.LOGIN_PUZZLE);
            Out.WriteInt32R(Program.Version[0]);
            Out.WriteInt32R(Program.Version[1]);
            Out.WriteInt32R(Program.Version[2]);
            Out.WriteInt32R(Program.Build);

            Out.WriteByte(0x05);

            Out.WriteInt64R(-313054979819954861);

            Out.WriteUInt32R(0);
            Out.WriteUInt32R(0);
            Out.WriteUInt32R(0);
            client.SendTCP(Out);
        }
예제 #2
0
        public static void HandlePacket(BaseClient client, PacketIn packet)
        {
            LobbyClient cclient = client as LobbyClient;
            Program.CharMgr.DeleteCharacter(cclient.Account.Id, packet.GetUint8());

            PacketOut Out = new PacketOut((UInt32)Opcodes.ANS_CHARACTER_DELETE);
            Out.WriteUInt32R(0);
            cclient.SendTCP(Out);
        }
예제 #3
0
        public static void Send(LobbyClient client)
        {
            PacketOut Out = new PacketOut((UInt32)Opcodes.ANS_LOGIN_SUCCESS);
            Out.WriteUnicodeString(client.Account.RealTag,48);

            Out.WriteUInt32R(21); // Account Type

            Out.WriteInt64R(TCPManager.GetTimeStamp());

            // Temps avant expiration du compte
            Out.WriteByte(0x13); // ms
            Out.WriteByte(0x29); // sec
            Out.WriteUInt16R(0x12); // Hour

            // Date de création
            Out.WriteByte(0x0E); // day
            Out.WriteByte(0x07); // month
            Out.WriteUInt16R(2010); // Year

            Out.WriteInt32R(1450); // Temps de jeu (secondes)
            Out.WriteInt32R(client.Account.Points); // Points APB

            for(int i=1;i<6;++i)
                Out.WriteInt32R(
                    Program.FileMgr.GetFileVersion(client.Account.Id, i, true, "", "")); // Config file, Server Version

            Out.WriteInt32R(0);

            Out.WriteUInt16(0x957D);
            Out.WriteUInt16(0x0400);

            Out.WriteUInt16(0x5052);
            Out.WriteUInt16(0x4F45);
            Out.WriteUInt16(0x552E);
            Out.WriteUInt16(0x3232);
            Out.WriteUInt16(0x3738);
            Out.WriteUInt16(0x3031);
            Out.WriteUInt16(0);

            Out.WriteUInt16(0x0067);

            Out.WriteUInt64(0x526C624331313256);
            Out.WriteUInt64(0x486E314100000000);
            Out.WriteUInt16(0);
            Out.WriteStringBytes("");
            Out.WriteByte(0);

            client.SendTCP(Out);

            ANS_CHARACTER_INFO.Send(client);
        }
예제 #4
0
        public static void HandlePacket(BaseClient client, PacketIn packet)
        {
            LobbyClient cclient = (LobbyClient)client;

            byte sloid = packet.GetUint8();
            Program.CharMgr.SetEnter(cclient.Account.Id, sloid);

            WorldInfo Info = Program.CharMgr.GetWorldInfo(cclient.Account.WorldId);

            PacketOut Out = new PacketOut((UInt32)Opcodes.ANS_WORLD_ENTER);

            if (Info == null)
                Out.WriteUInt32R(1);
            else
            {
                Out.WriteUInt32R(0);

                Out.WriteInt32R(Info.Ip); // WorldServerIp
                Out.WriteUInt16R((UInt16)Info.Port); // Port
                Out.WriteInt64R(TCPManager.GetTimeStamp());
            }

            cclient.SendTCP(Out);
        }
예제 #5
0
        public static void HandlePacket(BaseClient client, PacketIn packet)
        {
            LobbyClient cclient = (LobbyClient)client;

            byte FileId = packet.GetUint8();
            UInt32 Version = packet.GetUint32R();

            byte[] File = new byte[packet.Length - packet.Position];
            packet.Read(File, 0, File.Length);

            File = ZlibMgr.Decompress(File);

            Log.Debug("ConfigSave", "Config saved : fileid=" + FileId + ", Version=" + Version + ",Size=" + File.Length);

            Program.FileMgr.SaveInfo(cclient.Account.Id, FileId, File);

            PacketOut Out = new PacketOut((UInt32)Opcodes.ANS_CONFIGFILE_SAVE);
            Out.WriteUInt32R(0);
            Out.WriteByte(FileId);
            Out.Write(File, 0, File.Length);
            cclient.SendTCP(Out);
        }
예제 #6
0
        public static void Send(LobbyClient client)
        {
            List<WorldInfo> _Worlds = Program.CharMgr.GetWorlds();

            PacketOut Out = new PacketOut((UInt32)Opcodes.WORLD_LIST);
            Out.WriteInt32R(0); // Returned Code

            Out.WriteUInt16R((UInt16)_Worlds.Count); // World Count

            foreach (WorldInfo Info in _Worlds)
            {
                Out.WriteUInt32R((UInt32)Info._Info.Id); // WorldUid

                Out.WriteUnicodeString(Info._Info.Name, 32); // WorldName

                Out.WriteByte((byte)(Info.RpcID == 0 ? 0 : 1)); // Status
                Out.WriteByte(Info._Info.Population); // Pop  0:Low 1:Medium 2:High
                Out.WriteByte(Info._Info.Enf); // enf recommended , true or false
                Out.WriteByte(Info._Info.Crim); // crim recommended , true or false
            }

            client.SendTCP(Out);
        }
예제 #7
0
        public void SendMaxInventory(Player Plr) // 1.3.5
        {
            PacketOut Out = new PacketOut((byte)Opcodes.F_BAG_INFO);
            Out.WriteByte(0x0F);
            Out.WriteByte(GetTotalSlot()); // Nombre de slots disponibles
            Out.WriteUInt16((UInt16)INVENTORY_SLOT_COUNT);
            Out.WriteByte(0);
            Out.WriteUInt32R(GetBagPrice());

            Out.WriteUInt16(2);
            Out.WriteByte(0x50);
            Out.WriteUInt16(0x08);
            Out.WriteUInt16(0x60);
            Out.WriteByte(0xEA);
            Out.WriteUInt16(0);
            Plr.SendPacket(Out);
        }
예제 #8
0
파일: CharMgr.cs 프로젝트: oldSerge/WarEmu
        public static byte[] BuildCharacters(int AccountId)
        {
            Log.Debug("BuildCharacters", "AcocuntId = " + AccountId);

            Character[] Chars = GetAccountChar(AccountId)._Chars;
            UInt16 Count = 0;

            // On Compte le nombre de personnages existant du joueur
            for (UInt16 c = 0; c < Chars.Length; ++c)
                if (Chars[c] != null) ++Count;

            PacketOut Out = new PacketOut(0);
            Out.Position = 0;

            Out.WriteByte(MAX_SLOT);
            Out.WriteUInt32(0xFF);
            Out.WriteByte(0x14);

            Character Char = null;
            for (int i = 0; i < MAX_SLOT; ++i)
            {
                Char = Chars[i];

                if (Char == null)
                    Out.Fill(0, 284); // 284
                else
                {
                    List<Character_item> Items = CharMgr.GetItemChar(Char.CharacterId);

                    Out.FillString(Char.Name, 48);
                    Out.WriteByte(Char.Value.Level);
                    Out.WriteByte(Char.Career);
                    Out.WriteByte(Char.Realm);
                    Out.WriteByte(Char.Sex);
                    Out.WriteByte(Char.ModelId);
                    Out.WriteUInt16(Char.Value.ZoneId);
                    Out.Fill(0, 5);

                    Character_item Item = null;
                    for (UInt16 SlotId = 14; SlotId < 30; ++SlotId)
                    {
                        Item = Items.Find(item => item != null && item.SlotId == SlotId);
                        if (Item == null)
                            Out.WriteUInt32(0);
                        else
                            Out.WriteUInt32R(Item.ModelId);

                        Out.Fill(0, 4);
                    }

                    Out.Fill(0, 6);

                    for (int j = 0; j < 5; ++j)
                    {
                        Out.Fill(0, 6);
                        Out.WriteUInt16(0xFF00);
                    }

                    for (UInt16 SlotId = 10; SlotId < 13; ++SlotId)
                    {
                        Item = Items.Find(item => item != null && item.SlotId == SlotId);
                        Out.WriteUInt16(0);
                        if (Item == null)
                            Out.WriteUInt16(0);
                        else
                            Out.WriteUInt16R((ushort)Item.ModelId);
                    }

                    Out.Fill(0, 10);
                    Out.WriteUInt16(0xFF00);
                    Out.WriteByte(0);
                    Out.WriteByte(Char.Race);
                    Out.WriteUInt16(0);
                    Out.Write(Char.bTraits, 0, Char.bTraits.Length);
                    Out.Fill(0, 14);// 272
                }
            }
            return Out.ToArray();
        }
예제 #9
0
 public void SendSkills()
 {
     PacketOut Out = new PacketOut((byte)Opcodes.F_CHARACTER_INFO);
     Out.WriteByte(3); // Skills
     Out.Fill(0, 3);
     Out.WriteByte(_Info.CareerLine);
     Out.WriteByte(_Info.Race);
     Out.WriteUInt32R(_Value.Skills);
     Out.WriteUInt16(_Value.RallyPoint);
     SendPacket(Out);
 }