Пример #1
0
        public static void F_DUMP_ARENAS_LARGE(BaseClient client, PacketIn packet)
        {
            GameClient cclient = client as GameClient;

            if (!cclient.HasAccount())
            {
                cclient.Disconnect("No Account in F_DUMP_ARENAS_LARGE");
                return;
            }

            if (Program.Rm.OnlinePlayers >= Program.Rm.MaxPlayers && cclient._Account.GmLevel == 1)
            {
                PacketOut Out = new PacketOut((byte)Opcodes.F_LOGINQUEUE);
                client.SendPacket(Out);
                return;
            }

            byte      CharacterSlot = packet.GetUint8();
            Character Char          = CharMgr.GetAccountChar(cclient._Account.AccountId).GetCharacterBySlot(CharacterSlot);

            if (Char == null)
            {
                Log.Error("F_DUMP_ARENAS_LARGE", "Can not find character on slot : " + CharacterSlot);
                cclient.Disconnect("Character not found in F_DUMP_ARENAS_LARGE");
                return;
            }

            {
                if (cclient.Plr == null)
                {
                    cclient.Plr = Player.CreatePlayer(cclient, Char);
                }

                if (cclient.Plr == null)
                {
                    cclient.Disconnect("NULL Player from CreatePlayer?");
                    return;
                }

                if (cclient.Plr.Client != cclient)
                {
                    cclient.Plr.Client?.Disconnect("Ghost client");
                    cclient.Plr.Destroy();
                    cclient.Disconnect("Player already exists");

                    return;
                }

                PacketOut Out = new PacketOut((byte)Opcodes.F_WORLD_ENTER, 64);
                Out.WriteUInt16(0x0608); // TODO
                Out.Fill(0, 20);
                Out.WriteString("38699", 5);
                Out.WriteString("38700", 5);
                Out.WriteString("0.0.0.0", 20);
                cclient.SendPacket(Out);
            }
        }