Ejemplo n.º 1
0
        /// <summary>
        /// Sends a list of characters to the client.
        /// </summary>
        /// <param name="conn"></param>
        /// <param name="layer">This is the number on the left side of the character list in the client.</param>
        public static void BC_COMMANDER_LIST(LoginConnection conn, int layer = 1)
        {
            var characters = conn.Account.GetCharacters().Where(x => x.BarrackLayer == layer);

            var packet = new Packet(Op.BC_COMMANDER_LIST);

            packet.PutLong(conn.Account.Id);
            packet.PutByte(0);
            packet.PutByte((byte)characters.Count());
            packet.PutString(conn.Account.TeamName, 64);
            packet.AddAccountProperties(conn.Account);

            foreach (var character in characters)
            {
                packet.AddBarrackPc(character);
            }

            // Null terminated list of some kind?
            // Example of != 0: 02 00 | 0B 00 00 00 01 00, 0C 00 00 00 00 00
            packet.PutShort(0);             // count?

            packet.PutShort(0);
            packet.PutInt(0);
            packet.PutShort(0);

            conn.Send(packet);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Sends character list and account information to client.
        /// </summary>
        /// <param name="conn"></param>
        public static void BC_COMMANDER_LIST(LoginConnection conn)
        {
            var allCharacters   = conn.Account.GetCharacters();
            var layerCharacters = allCharacters.Where(x => x.BarrackLayer == conn.Account.SelectedBarrackLayer);

            var totalCharacterCount = allCharacters.Length;
            var layerCharacterCount = layerCharacters.Count();

            var packet = new Packet(Op.BC_COMMANDER_LIST);

            packet.PutLong(conn.Account.Id);
            packet.PutByte(0);
            packet.PutByte(0);             // 1 = 5/4 slots?
            packet.PutString(conn.Account.TeamName, 64);
            packet.AddAccountProperties(conn.Account);

            packet.PutShort(1);             // 0 = 15 slots, 1 = 4, 2 = 8, 3+ = 4, only 1 shows correct max values?
            packet.PutInt(11);
            packet.PutShort(layerCharacterCount);
            packet.PutShort(conn.Account.AdditionalSlotCount);
            packet.PutInt(conn.Account.TeamExp);
            packet.PutShort(totalCharacterCount);

            conn.Send(packet);

            if (allCharacters.Length > 0)
            {
                Send.BC_SPLIT_COMMANDER_INFO_LIST(conn, layerCharacters);
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Sends character list and account information to client.
        /// </summary>
        /// <param name="conn"></param>
        public static void BC_COMMANDER_LIST(LoginConnection conn)
        {
            var characters        = conn.Account.GetCharacters();
            var barrackCharacters = characters.Where(x => x.BarrackLayer == conn.Account.SelectedBarrackLayer);

            var packet = new Packet(Op.BC_COMMANDER_LIST);

            packet.PutLong(conn.Account.Id);
            packet.PutByte(0);
            packet.PutByte(0);
            packet.PutString(conn.Account.TeamName, 64);
            //packet.AddFullAccountProperties(conn.Account);
            packet.AddAccountProperties(conn.Account);

            packet.PutShort(1);             // Additional Characters
            packet.PutInt(0x0B);            // MapID
            packet.PutInt(barrackCharacters.Count());
            packet.PutInt(100);             // Team Exp
            packet.PutShort(characters.Length);

            conn.Send(packet);

            if (characters.Length > 0)
            {
                Send.BC_SPLIT_COMMANDER_INFO_LIST(conn, barrackCharacters);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Updates account's properties on the client.
        /// </summary>
        /// <param name="conn"></param>
        /// <param name="account"></param>
        public static void BC_ACCOUNT_PROP(LoginConnection conn, Account account)
        {
            var packet = new Packet(Op.BC_ACCOUNT_PROP);

            packet.PutLong(account.Id);
            packet.AddAccountProperties(account);

            conn.Send(packet);
        }
Ejemplo n.º 5
0
        public static void BC_COMMANDER_LIST(LoginConnection conn)
        {
            var characters = conn.Account.GetCharacters();

            var packet = new Packet(Op.BC_COMMANDER_LIST);

            packet.PutLong(conn.Account.Id);
            packet.PutByte(0);
            packet.PutByte((byte)characters.Length);
            packet.PutString(conn.Account.TeamName, 64);

            packet.AddAccountProperties(conn.Account);

            foreach (var character in characters)
            {
                packet.AddCharacter(character);

                // Equip properties, short->length
                for (int i = 0; i < Items.EquipSlotCount; ++i)
                {
                    packet.PutShort(0);
                }

                // Some of these variables have to do with Lodge LAYER probably. (just a guess)
                packet.PutByte(1);
                packet.PutByte(1);
                packet.PutByte(1);

                // Job history?
                // While this short existed in iCBT1, it might not have
                // been used, couldn't find a log.
                // Example: A Mage that switched to Pyromancer has two
                //   elements in this list, 2001 and 2002.
                packet.PutShort(0);                 // count
                // loop
                //   short jobId

                // [i11025 (2016-02-26)] ?
                {
                    packet.PutInt(0);
                }
            }

            // Null terminated list of some kind?
            // Example of != 0: 02 00 | 0B 00 00 00 01 00, 0C 00 00 00 00 00
            packet.PutShort(0);                                    // count?

            packet.PutShort(0);                                    // unk
            packet.PutInt(conn.Account.GetCharacters().Count());   // unk
            packet.PutShort(conn.Account.GetCharacters().Count()); // unk

            conn.Send(packet);
        }
Ejemplo n.º 6
0
        /// <summary>
        /// Sends a list of characters to the client and account properties.
        /// </summary>
        /// <param name="conn"></param>
        /// <param name="layer"></param>
        public static void BC_COMMANDER_LIST(LoginConnection conn, int layer = 1)
        {
            var characters = conn.Account.GetCharacters()
                             .Where(x => x.BarrackLayer == layer)
                             .ToList();

            var packet = new Packet(Op.BC_COMMANDER_LIST);

            packet.PutLong(conn.Account.Id);
            packet.PutByte(0);
            packet.PutByte((byte)characters.Count);
            packet.PutString(conn.Account.TeamName, 64);

            packet.AddAccountProperties(conn.Account);

            foreach (var character in characters)
            {
                packet.AddAppearancePC(character);


                packet.PutLong(character.Id);

                // [i11025 (2016-02-26)]
                // Index was previously stored as a short, now there seem
                // to be two byte, with the first being the index.
                {
                    packet.PutByte(character.GetIndex());
                    packet.PutByte(181);
                }

                packet.PutShort(character.MapId);
                packet.PutInt(0);
                packet.PutInt(0);
                packet.PutInt(0);                 // maxXP ?
                packet.PutInt(0);

                // Position?
                packet.PutFloat(character.BarrackPosition.X);
                packet.PutFloat(character.BarrackPosition.Y);
                packet.PutFloat(character.BarrackPosition.Z);
                packet.PutFloat(0);                 // Vector direction
                packet.PutFloat(0);                 // Vector direction

                // ?
                packet.PutFloat(character.BarrackPosition.X);
                packet.PutFloat(character.BarrackPosition.Y);
                packet.PutFloat(character.BarrackPosition.Z);
                packet.PutFloat(0);                 // Vector direction
                packet.PutFloat(0);                 // Vector direction

                packet.PutInt(0);

                // Equip properties, short->length
                // This is an empty property list
                for (int i = 0; i < Items.EquipSlotCount; ++i)
                {
                    packet.PutShort(0);
                }

                packet.PutByte(1);
                packet.PutByte(1);
                packet.PutByte(1);
                packet.PutByte(1);
                packet.PutByte(0);

                packet.PutShort((short)character.Job);
                packet.PutInt(0);
            }

            packet.PutShort(conn.Account.GetCharacters().Count());             // unk

            conn.Send(packet);
        }