void CharacterJobPick(byte[] buff)
        {
            //Wrap our function inside a catcher
            try
            {
                //Open packet reader
                PacketReader Reader = new PacketReader(buff);
                Reader.Skip(1);
                short namel = Reader.Int16();
                string name = Reader.String(namel);
                byte job = Reader.Byte();
                Reader.Close();

                //Anti hack check
                string namecheck = DB.GetData("SELECT name FROM character WHERE account='" + Player.AccountName + "'", "name");
                int jobcheck = Convert.ToInt32(DB.GetData("SELECT jobtype FROM users WHERE id='" + Player.AccountName + "'", "jobtype"));

                //If the name check is succesfull and account has no job set.
                if (jobcheck == 0 && namecheck.Length > 0)
                {
                    //Write new job info
                    DB.query("UPDATE users SET jobtype='" + job + "' WHERE id='" + Player.AccountName + "'");
                }
                //Send visual confirmation
                client.Send(Packet.CharacterJobSelection());
            }
            catch (Exception ex)
            {
                Log.Exception(ex);
            }
        }
 /////////////////////////////////////////////////////////////////////////////////
 // Add new friend
 /////////////////////////////////////////////////////////////////////////////////
 public void FriendAdd()
 {
     try
     {
         PacketReader reader = new PacketReader(PacketInformation.buffer);
         short namelenght = reader.Int16();
         string name = reader.String(namelenght);
         reader.Close();
         if (name == Character.Information.Name) return;
         PlayerMgr sys = Helpers.GetInformation.GetPlayerName(name);
         if (sys != null)
         {
             sys.client.Send(Packet.FriendInviteTarget(sys.Character));
         }
         else
         {
             //Packet cannot find user
         }
     }
     catch (Exception ex)
     {
         Console.WriteLine("Friend Add error {0}", ex);
         Log.Exception(ex);
     }
 }
 public void MakeAlias()
 {
     try
     {
         ///////////////////////////////////////////////////////////////////////////////////////////////////
         PacketReader Reader = new PacketReader(PacketInformation.buffer);
         int id = Reader.Int32();
         byte type = Reader.Byte();
         short nLenght = Reader.Int16();
         string name = Reader.String(nLenght);
         ///////////////////////////////////////////////////////////////////////////////////////////////////
         Console.WriteLine(name);
         DB ms = new DB("SELECT * FROM character_jobs WHERE job_alias='" + name + "'");
         int checkjob = ms.Count();
         ///////////////////////////////////////////////////////////////////////////////////////////////////
         client.Send(Packet.MakeAlias(name, type));
         if (checkjob == 0)
         {
             client.Send(Packet.MakeAlias(name, type));
             DB.query("UPDATE character_jobs SET job_alias='" + name + "' WHERE character_name='" + Character.Information.Name + "'");
         }
         else if (checkjob >= 0)
         {
             client.Send(Packet.MakeAliasError(name, type));
         }
     }
     catch (Exception ex)
     {
         Log.Exception(ex);
     }
 }
        public void GuildMessage()
        {
            //Wrap our function inside a catcher
            try
            {
                //Create new packet reader
                PacketReader Reader = new PacketReader(PacketInformation.buffer);
                //Read short int16 for title lenght
                short TitleL = Reader.Int16();
                //Read string for title
                string Title = Reader.String(TitleL);
                //Read short Message lenght
                short MessageL = Reader.Int16();
                //Read message
                string Message = Reader.String(MessageL);
                //Close reader
                Reader.Close();

                //Update database guild message title and message
                DB.query("UPDATE guild SET guild_news_t='" + Title + "',guild_news_m='" + Message + "' WHERE guild_name='" + Character.Network.Guild.Name + "'");

                //Set new message info to current member for sending packet update.
                Character.Network.Guild.NewsTitle = Title;
                Character.Network.Guild.NewsMessage = Message;
                //Repeat for each member in our guild
                foreach (int member in Character.Network.Guild.Members)
                {
                    //Make sure the member is there
                    if (member != 0)
                    {
                        //Get detailed information from member main id
                        PlayerMgr characterinformation = Helpers.GetInformation.GetPlayerid(member);
                        //Set the current member news title and message information
                        characterinformation.Character.Network.Guild.NewsMessage = Message;
                        characterinformation.Character.Network.Guild.NewsTitle = Title;
                        //Send packet to the member to update guild message.
                        characterinformation.client.Send(Packet.GuildUpdate(characterinformation.Character, 11, 0, 0, 0));
                    }
                }
            }
            //Catch any bad exception error
            catch (Exception ex)
            {
                Log.Exception(ex);
            }
        }
 public void GuildInvite()
 {
     //Wrap our code into a catcher
     try
     {
         //Create new packet reader
         PacketReader Reader = new PacketReader(PacketInformation.buffer);
         //Read lenght of invited character name
         Int16 InvitedCharacterLEN = Reader.Int16();
         //Read invited character name
         string InvitedCharacter = Reader.String(InvitedCharacterLEN);
         //Close packet reader
         Reader.Close();
         //Get information for target
         PlayerMgr sys = Helpers.GetInformation.GetPlayerName(InvitedCharacter);
         //Set targetid information
         Character.Network.TargetID = sys.Character.Information.UniqueID;
         //If player allready has a guild
         if (sys.Character.Network.Guild.Guildid != 0)
         {
             client.Send(Packet.Message(OperationCode.SERVER_GUILD_WAIT, Messages.UIIT_MSG_GUILDERR_MEMBER_OF_ANOTHER_GUILD));
             return;
         }
         //If player has to wait before the player can join another guild
         if (sys.Character.Information.GuildPenalty)
         {
             client.Send(Packet.Message(OperationCode.SERVER_GUILD_WAIT, Messages.UIIT_MSG_GUILD_PENALTY));
             return;
         }
         //If the guild has max members
         if (Character.Network.Guild.TotalMembers >= Character.Network.Guild.MaxMembers)
         {
             client.Send(Packet.Message(OperationCode.SERVER_GUILD_WAIT, Messages.UIIT_MSG_GUILDERR_MEMBER_FULL));
         }
         //If the character doesnt have join rights
         if (!Character.Network.Guild.joinRight)
         {
             //This should not happen unless hack attempt, because button should be grayed out
             return;
         }
         //Set targetid to the invited player
         sys.Character.Network.TargetID = this.Character.Information.UniqueID;
         //Send guild request packet
         sys.client.Send(Packet.PartyRequest(5, this.Character.Information.UniqueID, 0));
         //Set bools active
         Character.State.GuildInvite = true;
         sys.Character.State.GuildInvite = true;
     }
     //Catch bad exception errors
     catch (Exception ex)
     {
         Log.Exception(ex);
     }
 }
 public void GuildTitle()
 {
     //Wrap our function inside a catcher
     try
     {
         //Extra hack check
         if (Character.Network.Guild.Level < 4)
             return;
         //Create new packet reader
         PacketReader Reader = new PacketReader(PacketInformation.buffer);
         //Read integer guild member selected
         int SelectedGuildMember = Reader.Int32();
         //Read short lenght of title for guild member
         short GuildMemberTitleLEN = Reader.Int16();
         //Read string guild member title
         string GuildMemberTitle = Reader.String(GuildMemberTitleLEN);
         //Close packet reader
         Reader.Close();
         //Get selected guild member information
         PlayerMgr playerinfo = Helpers.GetInformation.GetPlayerMainid(SelectedGuildMember);
         //Make sure the character is still there
         if (playerinfo.Character != null)
         {
             //Update database set new title
             DB.query("UPDATE guild_members SET guild_grant='" + GuildMemberTitle + "' WHERE guild_member_id='" + playerinfo.Character.Information.CharacterID + "'");
             //Send new character guild title update to each player in spawn reach
             Send(Packet.GuildSetTitle(Character.Guild.GuildID, playerinfo.Character.Information.Name, GuildMemberTitle));
             //Send Final packet to client
             playerinfo.client.Send(Packet.GuildSetTitle2(Character.Guild.GuildID, SelectedGuildMember, GuildMemberTitle));
         }
     }
     //Catch bad exception errors
     catch (Exception ex)
     {
         Log.Exception(ex);
     }
 }
        public void KickFromGuild()
        {
            //Wrap our function inside a catcher
            try
            {
                //Open a new packet reader
                PacketReader Reader = new PacketReader(PacketInformation.buffer);
                //Read short value lenght of name below
                short CharacterNameLen = Reader.Int16();
                //Read string charactername
                string CharacterName = Reader.String(CharacterNameLen);
                //Close packet reader
                Reader.Close();
                //Get player information
                PlayerMgr TargetCharacter = Helpers.GetInformation.GetPlayerName(CharacterName);
                //Send required packets to network
                foreach (int member in Character.Network.Guild.Members)
                {
                    //Make sure member s not null
                    if (member != 0)
                    {
                        //Get information for the guildmember
                        PlayerMgr guildmember = Helpers.GetInformation.GetPlayerMainid(member);
                        //Make sure the guildmember isnt null
                        if (guildmember != null)
                        {
                            //Make sure the kicked member does not receive the packet
                            if (guildmember.Character.Information.CharacterID != TargetCharacter.Character.Information.CharacterID)
                            {
                                guildmember.client.Send(Packet.GuildUpdate(TargetCharacter.Character, 7, 0, 0, 0));
                            }
                        }
                    }
                }
                //Send update packet to the kicked player
                TargetCharacter.client.Send(Packet.GuildUpdate(TargetCharacter.Character, 7, 0, 0, 0));
                //Send guild kick message packet to the kicked player
                PacketWriter Writer = new PacketWriter();
                //Add opcode
                Writer.Create(OperationCode.SERVER_GUILD_KICK);
                //Add static byte 1
                Writer.Byte(1);
                //Send packet to kicked member
                TargetCharacter.client.Send(Writer.GetBytes());
                //Send guildkick visual packet update to kicked player
                TargetCharacter.Send(Packet.GuildKick(TargetCharacter.Character.Information.UniqueID));
                //Remove the player from database
                DB.query("DELETE from guild_members where guild_member_id='" + TargetCharacter.Character.Information.CharacterID + "'");
                //Update database
                Character.Network.Guild.TotalMembers -= 1;
                DB.query("UPDATE guild SET guild_members_t='" + Character.Network.Guild.TotalMembers + "' WHERE guild_name='" + Character.Network.Guild.Name + "'");
                TargetCharacter.CleanUp(TargetCharacter);

            }
            //Catch bad exception errors
            catch (Exception ex)
            {
                //Write information to the console
                Console.WriteLine("Guild Kick Error: {0}", ex);
                //Write information to the debug log

            }
        }
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        // Private Message Send
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
        public void PrivateMessageSend()
        {
            try
            {
                /////////////////////////////////////////////////////////////////////////////////////
                PacketReader Reader = new PacketReader(PacketInformation.buffer);
                /////////////////////////////////////////////////////////////////////////////////////
                short touser = Reader.Int16();
                string tousername = Reader.String(touser);
                short messagel = Reader.Int16();
                string message = Reader.String(messagel);
                Reader.Close();
                /////////////////////////////////////////////////////////////////////////////////////
                int count = DB.GetRowsCount("SELECT * FROM character WHERE name='" + tousername + "'");
                int charid = Convert.ToInt32(Convert.ToInt32(DB.GetData("SELECT id FROM character WHERE name='" + tousername + "'", "id")));
                /////////////////////////////////////////////////////////////////////////////////////
                if (count == 0)//Check username
                {
                    client.Send(Packet.PrivateMessageMsg(1));
                    return;
                }
                if (count > 0)//Excisting username
                {
                    DB ms = new DB("SELECT * FROM message WHERE receiver='" + tousername + "' ORDER BY idinfo DESC");
                    int msgcount = ms.Count();
                    PlayerMgr sys = Helpers.GetInformation.GetPlayerMainid(charid);

                    if (msgcount == 0)
                    {
                        DB.query("INSERT INTO message (sender, receiver, message, status, time, idinfo) VALUES ('" + Character.Information.Name + "','" + tousername + "','" + message + "','0','10/10/2010 12:00:00 AM','0')");
                        client.Send(Packet.PrivateMessageMsg(2));
                        sys.Send(Packet.FriendData(sys.Character.Information.UniqueID, 5, tousername, Character, false));
                    }
                    if (msgcount > 0)
                    {
                        int messagenewid = msgcount + 1;
                        DB.query("INSERT INTO message (sender, receiver, message, status, time, idinfo) VALUES ('" + Character.Information.Name + "','" + tousername + "','" + message + "','0','10/10/2010 12:00:00 AM','" + Convert.ToByte(messagenewid) + "')");
                        client.Send(Packet.PrivateMessageMsg(2));
                        sys.Send(Packet.FriendData(sys.Character.Information.UniqueID, 5, tousername, Character, false));
                    }
                }
            }
            catch (Exception ex)
            {
                Log.Exception(ex);
            }
        }
        public void GuildCreate()
        {
            try
            {
                //Extra check if user is allready in guild.
                if (Character.Network.Guild.Guildid != 0) return;
                //If player has recently been in a guild
                if (Character.Information.GuildPenalty)
                {
                    //Need to sniff the retail packet (Tmp used guild war error).
                    client.Send(Packet.Message(OperationCode.SERVER_GUILD_WAIT, Messages.UIIT_MSG_GUILDWARERR_GUILD_CREATE_PENALTY));
                    return;
                }
                //Create new packet reader for reading information
                PacketReader Reader = new PacketReader(PacketInformation.buffer);
                //None needed integer
                int notneeded = Reader.Int32();
                //Get guild name lenght
                short GuildNameLen = Reader.Int16();
                //Get guild name
                string GuildName = Reader.String(GuildNameLen);
                //Close packet reader
                Reader.Close();
                //Check length lower are 4 return
                if (GuildName.Length < 4)
                {
                    //Send incorrect lenght
                    client.Send(Packet.Message(OperationCode.SERVER_GUILD_WAIT, Messages.UIIT_MSG_GUILDERR_INVALID_GUILDNAME_LEN));
                    return;
                }
                //Check if guild name is taken or not.
                int guildcheckname = DB.GetRowsCount("SELECT * FROM guild WHERE guild_name='" + GuildName + "'");
                //If name excists
                if (guildcheckname == 1)
                {
                    client.Send(Packet.Message(OperationCode.SERVER_GUILD_WAIT, Messages.UIIT_MSG_GUILDERR_SAME_GUILDNAME_EXIST));
                    return;
                }
                //If character level is to low
                if (Character.Information.Level < 20)
                {
                    //Send packet level to low message
                    client.Send(Packet.Message(OperationCode.SERVER_GUILD, Messages.UIIT_MSG_GUILDERR_TOO_LOW_CREATOR_LEVEL));
                    return;
                }
                //Set the gold requirements 500.000 retail info
                int goldrequired = 500000;
                //If gold is lower then price of creating a guild
                if (Character.Information.Gold < goldrequired)
                {
                    //Send message not enough gold
                    client.Send(Packet.Message(OperationCode.SERVER_GUILD, Messages.UIIT_MSG_GUILDERR_NOT_ENOUGH_GOLD));
                    return;
                }
                //All checks ok, continue creating new guild.
                else
                {
                    //Reduct the gold required from player gold
                    Character.Information.Gold -= goldrequired;
                    //Save player information
                    SavePlayerInfo();
                    //Insert guild into database
                    DB.query("INSERT INTO guild (guild_name, guild_level, guild_points, guild_news_t, guild_news_m, guild_members_t, guild_master_id) VALUES ('" + GuildName + "','1','0','" + "" + "','" + "" + "','1','" + Character.Information.CharacterID + "')");
                    //Get guild id
                    string guildid = DB.GetData("SELECT id FROM guild WHERE guild_name='" + GuildName + "'", "id");
                    int docount = Convert.ToInt32(guildid);
                    //Insert member into database
                    DB.query("INSERT INTO guild_members (guild_id, guild_member_id, guild_rank, guild_points, guild_fortress, guild_grant, guild_perm_join, guild_perm_withdraw, guild_perm_union, guild_perm_storage, guild_perm_notice) VALUES ('" + docount + "','" + Character.Information.CharacterID + "','0','0','1','','1','1','1','1','1')");
                    //Load our new guild
                    LoadPlayerGuildInfo(true);
                    //Private packet
                    client.Send(Packet.Guild_Create(Character.Network.Guild));
                    //Public spawn packet
                    Send(Packet.SendGuildInfo2(this.Character));
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine("Guild creation error: " + ex);

            }
        }
 // only for buffs now
 void GMinitq()
 {
     PacketReader reader = new PacketReader(PacketInformation.buffer);
     short ignore = reader.Int16();
     short skilllenght = reader.Int16();
     string skill = reader.String(skilllenght);
     Character.Action.UsingSkillID = Convert.ToInt32(skill);
     SkillBuff();
 }
 ///////////////////////////////////////////////////////////////////////////
 // Rename grab pet
 ///////////////////////////////////////////////////////////////////////////
 public void RenamePet()
 {
     try
     {
         //Start reading packet data
         PacketReader Reader = new PacketReader(PacketInformation.buffer);
         //Pet id
         int petid           = Reader.Int32();
         //Pet name lenght
         short petnamel      = Reader.Int16();
         //Pet name
         string petname      = Reader.String(petnamel);
         //Check availability for pet name.
         int nameavailable   = DB.GetRowsCount("SELECT pet_name FROM pets WHERE pet_name='" + petname + "'");
         //If available (Row count is zero).
         if (nameavailable == 0)
         {
             //Create the query we will use
             DB ms = new DB("SELECT * FROM pets WHERE playerid='" + Character.Information.CharacterID + "' AND pet_unique='" + petid + "'");
             //Open our data reader
             using (SqlDataReader reader = ms.Read())
             {
                 //While the reader is reading from database
                 while (reader.Read())
                 {
                     //First we check the lenght of the name.
                     if (petnamel < 3)
                     {
                         client.Send(Packet.Message(OperationCode.SERVER_PET_RENAME_MSG, Messages.UIIT_MSG_COSPETERR_PETNAME_NOTPUT));
                     }
                     //Check if renamed allready. (Should not be needed just extra check)
                     if (Character.Grabpet.Details != null)
                     {
                         if (petid == Character.Grabpet.Details.UniqueID)
                         {
                             if (Character.Grabpet.Details.Petname == "No name")
                             {
                                 //Update name in database
                                 DB.query("UPDATE pets SET pet_state='2',pet_name='" + petname + "' WHERE pet_unique='" + petid + "' AND playerid='" + Character.Information.CharacterID + "'");
                                 //Send needed packets to update name (Official sends 2 times)...
                                 client.Send(Packet.PetSpawn(petid, 2, Character.Grabpet.Details));
                                 //Send to all currently in spawn range
                                 Send(Packet.PetSpawn(petid, 2, Character.Grabpet.Details));
                             }
                         }
                     }
                     //Check if renamed allready. (Should not be needed just extra check)
                     if (Character.Attackpet.Details != null)
                     {
                         if (petid == Character.Attackpet.Details.UniqueID)
                         {
                             if (Character.Attackpet.Details.Petname == "No name")
                             {
                                 //Update name in database
                                 DB.query("UPDATE pets SET pet_state='2',pet_name='" + petname + "' WHERE pet_unique='" + petid + "' AND playerid='" + Character.Information.CharacterID + "'");
                                 //Send needed packets to update name (Official sends 2 times)...
                                 client.Send(Packet.PetSpawn(petid, 2, Character.Attackpet.Details));
                                 //Send to all currently in spawn range
                                 Send(Packet.PetSpawn(petid, 2, Character.Attackpet.Details));
                             }
                         }
                     }
                 }
             }
         }
         //If name has been taken
         else
         {
             //Not sure if correct msg.
             client.Send(Packet.Message(OperationCode.SERVER_PET_RENAME_MSG, Messages.UIIT_MSG_COSPETERR_PETNAME_NOTPUT));
         }
     }
     catch (Exception ex)
     {
         Log.Exception(ex);
     }
 }
        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
            */
        }