Exemplo 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);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Sets the character for the barrack
        /// </summary>
        /// <param name="conn"></param>
        /// <param name="id"></param>
        public static void BC_NORMAL_SetBarrackCharacter(LoginConnection conn, Character character)
        {
            var packet = new Packet(Op.BC_NORMAL);

            packet.PutInt(SubOp.Barrack.SetBarrackCharacter);
            packet.PutLong(conn.Account.Id);
            packet.PutLong(conn.Account.Id);
            packet.AddBarrackPc(character);

            conn.Send(packet);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Sends a list of characters to the client.
        /// </summary>
        /// <param name="conn"></param>
        /// <param name="characters"></param>
        public static void BC_SPLIT_COMMANDER_INFO_LIST(LoginConnection conn, IEnumerable <Character> characters)
        {
            var characterCount = characters.Count();

            var packet = new Packet(Op.BC_SPLIT_COMMANDER_INFO_LIST);

            packet.PutInt(characterCount);
            packet.PutLong(conn.Account.Id);

            packet.PutByte(0);
            packet.PutByte(characterCount != 0);
            packet.PutByte(1);

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

            conn.Send(packet);
        }