DarkEmu_GameServer.Systems.RequestIcons C# (CSharp) Метод

RequestIcons() публичный Метод

public RequestIcons ( ) : void
Результат void
        public void RequestIcons()
        {
            PacketReader Reader = new PacketReader(PacketInformation.buffer);
            byte IconType = Reader.Byte();
            short IconHexLenght = Reader.Int16();
            string Icon = Reader.String(IconHexLenght);
            Reader.Close();
            //Need to figure out the string.. identification of the icon probably
            client.Send(Packet.IconSend(IconType, Icon));

            // Below is sniffed data
            /*
             * [S -> C][2114]
                01                                                Byte = Type icon (1 = Guild 2 = union).
                1C 01                                             Lenght of hex icon string

                // below is the hex string (Ascii) icon
                74 6D 28 73 81 2A 47 37 F6 13 99 62 8C 3F 4E 29   tm(s.*G7...b.?N)
                0F 04 CB 3D E6 5F FC 0B D6 07 03 DD 0D 72 9A 25   ...=._.......r.%
                8A 88 BF CB 59 5A 8A 08 74 80 32 53 AA 1C 5E 86   ....YZ..t.2S..^.
                8A 88 BF CB 59 5A 8A 08 74 80 32 53 AA 1C 5E 86   ....YZ..t.2S..^.
                8A 88 BF CB 59 5A 8A 08 74 80 32 53 AA 1C 5E 86   ....YZ..t.2S..^.
                8A 88 BF CB 59 5A 8A 08 74 80 32 53 AA 1C 5E 86   ....YZ..t.2S..^.
                8A 88 BF CB 59 5A 8A 08 74 80 32 53 AA 1C 5E 86   ....YZ..t.2S..^.
                8A 88 BF CB 59 5A 8A 08 74 80 32 53 AA 1C 5E 86   ....YZ..t.2S..^.
                8A 88 BF CB 59 5A 8A 08 74 80 32 53 AA 1C 5E 86   ....YZ..t.2S..^.
                8A 88 BF CB 59 5A 8A 08 74 80 32 53 AA 1C 5E 86   ....YZ..t.2S..^.
                8A 88 BF CB 59 5A 8A 08 74 80 32 53 AA 1C 5E 86   ....YZ..t.2S..^.
                8A 88 BF CB 59 5A 8A 08 74 80 32 53 AA 1C 5E 86   ....YZ..t.2S..^.
                8A 88 BF CB 59 5A 8A 08 74 80 32 53 AA 1C 5E 86   ....YZ..t.2S..^.
                8A 88 BF CB 59 5A 8A 08 74 80 32 53 AA 1C 5E 86   ....YZ..t.2S..^.
                8A 88 BF CB 59 5A 8A 08 74 80 32 53 AA 1C 5E 86   ....YZ..t.2S..^.
                8A 88 BF CB 59 5A 8A 08 74 80 32 53 AA 1C 5E 86   ....YZ..t.2S..^.
                8A 88 BF CB 59 5A 8A 08 74 80 32 53 AA 1C 5E 86   ....YZ..t.2S..^.
                FE DC BA 98 76 54 32 10 0F 1E 2D 3C               ....vT2...-<....

                [C -> S][2114]
                02                                                ................
                0C 00                                             ................
                AE A5 BF 3C 23 65 0C 01 03 1E 27 3C               ...<#e....'<....
             */

            /*
            (Nukei)Discovered so far:
            client requests image by contacting 121.128.134.16 (gdmark.joymax.com) using HTTP protocol over port 15080
            like:
               http://gdmark.joymax.com:15080/SRO_CREST/A96_2132_1.crb (this files is saved in sro-client's RD folder as A96_2132.rd converted to BMP format)

            the returned header indicates, that the returned content is 256 Bytes in size (16 x 16 = 256).  the given type is "application".

            ToDo:
            1.	Why or when the client starts this request for images ?
            2.	Is the returned array of bytes 16x16 palette entries ?
            3.	if 2 is right, what palette is used ?

            Result:
            1. dont know :-P
            2. Yes, we get a paletted image in 16x16 size (without palette, without size, RAW pixel), so every byte is one pixel. pay attention that the Y coordinates are reversed, so the image is bottom up.
            3. discovered that it is the windows system palette !!

             * I dont know if the image really is transfered with 2114 packet !!!

            Tools used: PhotoShop, Wireshark, WinHex
             */
            /*Xsense:
             * Result:
             * 1. I believe send on guild name spawn by 1 byte indication active non active.
             * 1. Simple check would be a bool from database on creation of icon set to true,
             * 1. Deletion item / guild disband / union kick / leave would remove the bool information from db.
             * 2. Indexed color 8 bit setting. (Change extension to bmp / checked photoshop indications).
             * 3.
             * 4. RD should be cache folder, which server could check from registry path to see excisting icons.
             */

            /*
             (Rokky93) Discovered:

            I search a bit about CREST System of Joymax and found an interesting blog.So now i will tell you my results:

            1. Silkroad stores Guild Icons on a stand-alone FTP Server. You can find them in the Media.pk2/type.txt
            2. For example A96_2132_1.crb:
                A - type(Guild or Alliance)
                96- Server ID
                2132 - guild id
                1 - crest id

            When we want to convert it to bmp:
            1. Silkroad uses 16x16 pixel big 8bbp bitmaps with static color palette and no compression. The stored crests are 256B big.
            2. BMP Structure:
                header - static
                meta - static
                palette - static
                bitmap (crest file content) - dynamic

            When we want to send icons to Client
            1. We have to change the FTP Server in the Media.pk2
            2. We must send this packet to Client
                byte - type(alliance, guild) 00 or 01
                dword - guildid
                string - guildname
               dword - crestindex

               For example:
               type                 G
               serverId          187
               guildId             2929
               crestid             3

               Client makes this : G187_2929_3.crb and download them from server ( this is my  theory)

            GET /SRO_CREST/A239_282_3.crb HTTP/1.1
            Accept-Encoding: gzip, deflate
            User-Agent: Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.3; .NET4.0C; .NET4.0E)
            Host: gdmark.joymax.com:15080
            Connection: Keep-Alive
            */
        }

Usage Example

Пример #1
0
        public static void oPCode(Decode de)
        {
            try
            {
                Systems sys = (Systems)de.Packet;
                sys.PacketInformation = de;
                //Console.WriteLine("Recv: (0x{0})", de.opcode.ToString("X4"));
                switch (de.opcode)
                {
                case 0x7481:
                    break;

                case CLIENT_PING:
                case CLIENT_PING2:
                    break;

                case CLIENT_PATCH:
                    sys.Patch();
                    break;

                case CLIENT_CONNECTION:
                    sys.Connect();
                    break;

                case CLIENT_CHARACTERSCREEN:
                    sys.CharacterScreen();
                    sys.Ping();
                    break;

                case CLIENT_INGAME_REQUEST:
                    sys.IngameLogin();
                    break;

                case CLIENT_INGAME_SUCCESS:
                    sys.InGameSuccess();
                    break;

                case CLIENT_REQUEST_WEATHER:
                    sys.LoadWeather();
                    break;

                case CLIENT_SIT:
                    sys.Doaction();
                    break;

                case CLIENT_QUESTMARK:
                    sys.QuestionMark();
                    break;

                case CLIENT_MOVEMENT:
                    sys.Movement();
                    break;

                case CLIENT_ANGLE_MOVE:
                    sys.Angle();
                    break;

                case CLIENT_SAVE_BAR:
                    sys.Save();
                    break;

                case CLIENT_LEAVE_REQUEST:
                    sys.LeaveGame();
                    break;

                case CLIENT_LEAVE_CANCEL:
                    sys.CancelLeaveGame();
                    break;

                case CLIENT_ITEM_MOVE:
                    sys.ItemMain();
                    break;

                case CLIENT_SELECT_OBJECT:
                    sys.SelectObject();
                    break;

                case CLIENT_GM:
                    sys.GM();
                    break;

                case CLIENT_EMOTE:
                    sys.Emote();
                    break;

                case CLIENT_TELEPORTSTART:
                    sys.Teleport_Start();
                    break;

                case CLIENT_TELEPORTDATA:
                    sys.Teleport_Data();
                    break;

                case CLIENT_CHAT:
                    sys.Chat();
                    break;

                case CLIENT_MAINACTION:
                    sys.ActionMain();
                    break;

                case CLIENT_MASTERY_UP:
                    sys.Mastery_Up();
                    break;

                case CLIENT_SKILL_UP:
                    sys.Mastery_Skill_Up();
                    break;

                case CLIENT_GETUP:
                    sys.Player_Up();
                    break;

                case CLIENT_REQUEST_PARTY:
                    sys.NormalRequest();
                    break;

                case CLIENT_PARTY_REQUEST:
                    sys.CharacterRequest();
                    break;

                case CLIENT_EXCHANGE_REQUEST:
                    sys.Exchange_Request();
                    break;

                case CLIENT_EXCHANGE_WINDOWS_CLOSE:
                    sys.Exchange_Close();
                    break;

                case CLIENT_EXCHANGE_ACCEPT:
                    sys.Exchange_Accept();
                    break;

                case CLIENT_EXCHANGE_APPROVE:
                    sys.Exchange_Approve();
                    break;

                case CLIENT_PARTY_ADDMEMBERS:
                    sys.PartyAddmembers();
                    break;

                case CLIENT_PARTY_LEAVE:
                    sys.LeaveParty();
                    break;

                case CLIENT_PARTY_BANPLAYER:
                    sys.PartyBan();
                    break;

                case CLIENT_GUIDE:
                    sys.Gameguide();
                    break;

                case CLIENT_PLAYER_UPDATE_INT:
                    sys.InsertInt();
                    break;

                case CLIENT_PLAYER_UPDATE_STR:
                    sys.InsertStr();
                    break;

                case CLIENT_PLAYER_HANDLE:
                    sys.Handle();
                    break;

                case CLIENT_PLAYER_BERSERK:
                    sys.Player_Berserk_Up();
                    break;

                case CLIENT_CLOSE_NPC:
                    sys.Close_NPC();
                    break;

                case CLIENT_OPEN_NPC:
                    sys.Open_NPC();
                    break;

                case CLIENT_NPC_BUYPACK:
                    sys.Player_BuyPack();
                    break;

                case CLIENT_OPEN_WAREHOUSE:
                    sys.Open_Warehouse();
                    break;

                case CLIENT_CLOSE_SCROLL:
                    sys.StopScrollTimer();
                    break;

                case CLIENT_SAVE_PLACE:
                    sys.SavePlace();
                    break;

                case CLIENT_ALCHEMY:
                    sys.AlchemyElixirMain();
                    break;

                case CLIENT_ALCHEMY_CREATE_STONE:
                    sys.AlchemyCreateStone();
                    break;

                case CLIENT_PET_MOVEMENT:
                    sys.MovementPet();
                    break;

                case CLIENT_PET_TERMINATE:
                    sys.HandleClosePet();
                    break;

                case CLIENT_PARTYMATCHING_LIST_REQUEST:
                    sys.ListPartyMatching(Party);
                    break;

                case CLIENT_CREATE_FORMED_PARTY:
                    sys.CreateFormedParty();
                    break;

                case CLIENT_FORMED_PARTY_DELETE:
                    sys.DeleteFormedParty(0);
                    break;

                case CLIENT_JOIN_FORMED_RESPONSE:
                    sys.FormedResponse();
                    break;

                case CLIENT_CHANGE_PARTY_NAME:
                    sys.RenameParty();
                    break;

                case CLIENT_JOIN_FORMED_PARTY:
                    sys.JoinFormedParty();
                    break;

                case CLIENT_START_PK:
                    sys.PkPlayer();
                    break;

                case CLIENT_GUILD:
                    sys.GuildCreate();
                    break;

                case CLIENT_GUILD_TRANSFER:
                    sys.GuildTransferLeaderShip();
                    break;

                case CLIENT_GUILD_PERMISSIONS:
                    sys.GuildPermissions();
                    break;

                case CLIENT_GUILD_PROMOTE:
                    sys.GuildPromote();
                    break;

                case CLIENT_GUILD_DISBAND:
                    sys.GuildDisband();
                    break;

                case CLIENT_GUILD_MESSAGE:
                    sys.GuildMessage();
                    break;

                case CLIENT_OPEN_GUILD_STORAGE:
                    sys.GuildStorage();
                    break;

                case CLIENT_CLOSE_GUILD_STORAGE:
                    sys.GuildStorageClose();
                    break;

                case CLIENT_GUILD_WAR_GOLD:
                    sys.GuildWarGold();
                    break;

                case CLIENT_OPEN_GUILD_STORAGE2:
                    sys.GuildStorage2();
                    break;

                case CLIENT_GUILD_KICK:
                    sys.KickFromGuild();
                    break;

                case CLIENT_GUILD_LEAVE:
                    sys.GuildLeave();
                    break;

                case CLIENT_GUILD_TITLE_SET:
                    sys.GuildTitle();
                    break;

                case CLIENT_GUILD_INVITE:
                    sys.GuildInvite();
                    break;

                case CLIENT_GUILD_DONATE_GP:
                    sys.DonateGP();
                    break;

                case CLIENT_GACHA_PLAY:
                    //Add function
                    break;

                case CLIENT_JOIN_MERC:
                    sys.JoinMerc();
                    break;

                case CLIENT_RANKING_LISTS:
                    sys.RankList();
                    break;

                case CLIENT_PREV_JOB:
                    sys.PrevJob();
                    break;

                case CLIENT_HONOR_RANK:
                    sys.HonorRank();
                    break;

                case CLIENT_PM_MESSAGE:
                    sys.PrivateMessage();
                    break;

                case CLIENT_PM_SEND:
                    sys.PrivateMessageSend();
                    break;

                case CLIENT_PM_OPEN:
                    sys.PrivateMessageOpen();
                    break;

                case CLIENT_PM_DELETE:
                    sys.PrivateMessageDelete();
                    break;

                case CLIENT_PET_UNSUMMON:
                    sys.UnSummonPet();
                    break;

                case CLIENT_PET_RENAME:
                    sys.RenamePet();
                    break;

                case CLIENT_GPET_SETTINGS:
                    sys.GrabPetSettings();
                    break;

                case CLIENT_MAKE_ALIAS:
                    sys.MakeAlias();
                    break;

                case CLIENT_LEAVE_JOB:
                    sys.LeaveJob();
                    break;

                case CLIENT_DISSEMBLE_ITEM:
                    sys.BreakItem();
                    break;

                case CLIENT_STALL_OPEN:
                    sys.StallOpen();
                    break;

                case CLIENT_STALL_CLOSE:
                    sys.StallClose();
                    break;

                case CLIENT_STALL_BUY:
                    sys.StallBuy();
                    break;

                case CLIENT_STALL_ACTION:
                    sys.StallMain();
                    break;

                case CLIENT_STALL_OTHER_OPEN:
                    sys.EnterStall();
                    break;

                case CLIENT_STALL_OTHER_CLOSE:
                    sys.LeaveStall();
                    break;

                case CLIENT_PVP:
                    sys.StartPvpTimer(10000);
                    break;

                case CLIENT_ALCHEMY_STONE:
                    sys.AlchemyStoneMain();
                    break;

                case CLIENT_ITEM_MALL_WEB:
                    sys.ItemMallWeb();
                    break;

                case CLIENT_ITEM_STORAGE_BOX:
                    sys.ItemStorageBox();
                    break;

                case CLIENT_ITEM_BOX_LOG:
                    sys.ItemStorageBoxLog();
                    break;

                case CLIENT_FRIEND_REMOVAL:
                    sys.FriendRemoval();
                    break;

                case CLIENT_FRIEND_INVITE:
                    sys.FriendAdd();
                    break;

                case CLIENT_FRIEND_GROUP:
                    sys.FriendGroup("ADD");
                    break;

                case CLIENT_FRIEND_GROUP_REMOVE:
                    sys.FriendGroup("REMOVE");
                    break;

                case CLIENT_FRIEND_GROUP_MANAGE_FRIEND:
                    sys.FriendGroup("MOVE");
                    break;

                case CLIENT_FRIEND_INVITE_RESPONSE:
                    sys.FriendAddResponse();
                    break;

                case CLIENT_UNION_APPLY:
                    sys.unionapply();
                    break;

                case CLIENT_ICON_REQUEST:
                    sys.RequestIcons();
                    break;

                default:
                    Print.Format("(0x{0}) {1}", de.opcode.ToString("X4"), Decode.StringToPack(sys.PacketInformation.buffer));
                    break;
                }
            }
            catch (Exception ex)
            {
                Systems.Debugger.Write(ex);
            }
        }
Systems