コード例 #1
0
        public static void HandleCharacterList(MapleConnection connection, InPacket packet)
        {
            bool viewAllCharacters = packet.ReadBool();
            byte count             = packet.ReadByte();

            for (byte b = 0; b < count; b++)
            {
                Character character = new Character();

                character.Index = b;

                HelpPacket.DecodeCharacterStatistics(character, packet);
                HelpPacket.DecodeCharacterAppearance(character, packet);

                packet.ReadByte();

                if (packet.ReadBool())
                {
                    packet.ReadBytes(16); // NOTE: Ranking.
                }

                character.AvatarUrl = "http://direct.craftnet.nl/maplestory_get_rank_info.php?name=" + character.Name + "&get_character_image";

                Main.Instance.DrawCharacterTile(character);
            }

            MapleConnection.User.PicMode = (PicMode)packet.ReadByte();

            Main.Instance.SetTab(Indexer.CharacterSelect);
        }
コード例 #2
0
        public void Help(HelpPacket helpPacket)
        {
            Session.SendPacket(Session.Character.GenerateSay("-------------Help command-------------",
                                                             SayColorType.Purple));
            var classes = helpPacket.GetType().Assembly.GetTypes().Where(t =>
                                                                         typeof(ICommandPacket).IsAssignableFrom(t) &&
                                                                         t.GetCustomAttribute <PacketHeaderAttribute>()?.Authority <= Session.Account.Authority)
                          .OrderBy(x => x.Name).ToList();

            foreach (var type in classes)
            {
                var classInstance = type.CreateInstance <ICommandPacket>();
                var method        = type.GetMethod("Help");
                if (method == null)
                {
                    continue;
                }

                var message = method.Invoke(classInstance, null).ToString();
                if (!string.IsNullOrEmpty(message))
                {
                    Session.SendPacket(Session.Character.GenerateSay(message, SayColorType.Green));
                }
            }
        }
コード例 #3
0
ファイル: FieldHandler.cs プロジェクト: github-esme/Averte
        public static void HandleSetField(MapleConnection connection, InPacket packet)
        {
            connection.Character = new Character();

            ushort loopCount = packet.ReadUShort();

            for (int i = 0; i < loopCount; i++)
            {
                packet.ReadLong();
            }

            int gameServerId = packet.ReadInt();

            packet.ReadByte();
            packet.ReadInt();
            connection.Character.PortalCount = packet.ReadByte();
            packet.ReadInt();

            bool characterData = packet.ReadBool();

            if (characterData)
            {
                HelpPacket.DecodeCharacterData(connection.Character, packet);
            }
            else
            {
            }

            Main.Instance.SetField(new Bitmap(1500, 2000));
        }