Ejemplo n.º 1
0
        public static void F_REQUEST_CHAR(BaseClient client, PacketIn packet)
        {
            GameClient cclient = client as GameClient;

            cclient.State = (int)eClientState.CharScreen;

            ushort Operation = packet.GetUint16();

            if (Operation == 0x2D58)
            {
                PacketOut Out = new PacketOut((byte)Opcodes.F_REQUEST_CHAR_ERROR, 1);
                Out.WriteByte((byte)CharMgr.GetAccountRealm(cclient._Account.AccountId));
                cclient.SendPacket(Out);
            }
            else
            {
                PacketOut Out = new PacketOut((byte)Opcodes.F_REQUEST_CHAR_RESPONSE, 64);
                Out.FillString(cclient._Account.Username, 20);
                Out.WriteUInt32(0); //RemainingLockoutTime
                Out.WriteByte(0);

                if (cclient._Account.GmLevel == 1 && !Program.Config.CreateBothRealms)
                {
                    Out.WriteByte((byte)CharMgr.GetAccountRealm(cclient._Account.AccountId));
                }
                else
                {
                    Out.WriteByte(0);
                }

                Out.WriteByte(CharMgr.MaxSlot); //Maximum Characters you can have
                Out.WriteByte(0);               //GameplayRulesetType
                Out.WriteByte(0);               //LastSwitchedToRealm
                Out.WriteByte(0);               //NumPaidNameChangesAvailable
                Out.WriteByte(0);               // unk

                byte[] Chars = CharMgr.BuildCharacters(cclient._Account.AccountId);
                Out.Write(Chars, 0, Chars.Length);

                cclient.SendPacket(Out);
            }
        }