Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 16:35

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Characters near you packets.

Discussion on Characters near you packets. within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2007
Posts: 81
Received Thanks: 4
Characters near you packets.

Hello i have problem with read packets.
i have packet like that:
Code:
[S -> C][3015]


74 07 00 00                                       t...............


23                                                #...............


00                                                ................


00                                                ................


01                                                ................


2D                                                -...............


05                                                ................


38 0E 00 00                                       8...............


14                                                ................


39 0E 00 00                                       9...............


14                                                ................


3A 0E 00 00                                       :...............


14                                                ................


30 0E 00 00                                       0...............


14                                                ................


86 2A 00 00                                       .*..............


14                                                ................


05                                                ................


00                                                ................


00                                                ................


90 17 0A 00                                       ................


A8 61                                             .a..............


00 60 88 44 21 EE B3 C0 00 C0 D6 44 56 37         .`.D!......DV7..


00                                                ................


01                                                ................


00                                                ................


56 37                                             V7..............


01                                                ................


00                                                ................


00                                                ................


00                                                ................


00 00 80 41                                       ...A............


00 00 48 42                                       ..HB............


00 00 C8 42                                       ...B............


00                                                ................


0C 00                                             ................


59 6F 75 4D 61 6B 65 4D 65 48 6F 72               YouMakeMeHor....


00                                                ................


01                                                ................


00                                                ................


00                                                ................


00                                                ................


00                                                ................


00                                                ................


00                                                ................


00 00                                             ................


00 00 00 00                                       ................


00 00                                             ................


00 00 00 00                                       ................


00 00 00 00                                       ................


00 00 00 00                                       ................


00                                                ................


00                                                ................


00                                                ................


FF                                                ................


01                                                ................
Now i want to read it in c# :
Code:
if ((current.Opcode == 0x3015))
                            {
                                    current.ReadUInt32();
                                    current.ReadUInt8();
                                    current.ReadUInt8();
                                    current.ReadUInt8();
                                    current.ReadUInt8();
                                    current.ReadUInt8();
                                    current.ReadUInt8();
                                    current.ReadUInt32();
                                    current.ReadUInt8();
                                    current.ReadUInt32();
                                    current.ReadUInt8();
                                    current.ReadUInt32();
                                    current.ReadUInt8();
                                    current.ReadUInt32();
                                    current.ReadUInt8();
                                    current.ReadUInt32();
                                    current.ReadUInt8();
                                    current.ReadUInt32();
                                    current.ReadUInt8();
                                    current.ReadUInt32();
                                    current.ReadUInt8();
                                    current.ReadUInt32();
                                    current.ReadUInt8();
                                    current.ReadUInt8();
                                    current.ReadUInt8();
                                    /* ID */
                                    Globals.MainWindow.comboBox4.Items.Add(current.ReadUInt32());
                                    /* end ID */
                                    current.ReadUInt16();
                                    Globals.MainWindow.comboBox3.Items.Add(current.ReadAscii());
                                current.ReadUInt8();
                                 current.ReadUInt8();
                            current.ReadUInt8();
                            current.ReadUInt16();
                            current.ReadUInt16();
                            current.ReadUInt16();
                            current.ReadUInt16();
                            current.ReadUInt8();
                            current.ReadUInt8();
                            current.ReadUInt8();
                            current.ReadUInt8();
                            current.ReadUInt32();
                            current.ReadUInt32();
                            current.ReadUInt32();
                            current.ReadUInt8();
                            current.ReadUInt32();
                            current.ReadUInt32();
                            current.ReadUInt16();
                            Globals.MainWindow.comboBox4.Items.Add(current.ReadAscii());
                            }
But after first ReadAscii i have error (can't read when packet ends).

What am i doing wrong?
lewy1000 is offline  
Old 04/17/2014, 23:06   #2
 
zeteris's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 575
Received Thanks: 752
Quote:
Originally Posted by lewy1000 View Post
Hello i have problem with read packets.
i have packet like that:
Code:
[S -> C][3015]
...
But after first ReadAscii i have error (can't read when packet ends).

What am i doing wrong?
Each character near you have different number of items, active buffs and so on. So first you need to parse that before you can get UniqueID.
zeteris is offline  
Old 04/18/2014, 14:06   #3
 
elite*gold: 0
Join Date: Dec 2007
Posts: 81
Received Thanks: 4
hmm. maybe is there other way to get player ID and Nick ?
lewy1000 is offline  
Old 04/18/2014, 18:00   #4
 
zeteris's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 575
Received Thanks: 752
Quote:
Originally Posted by lewy1000 View Post
hmm. maybe is there other way to get player ID and Nick ?
Nope.
zeteris is offline  
Old 04/19/2014, 19:33   #5
 
elite*gold: 0
Join Date: Dec 2007
Posts: 81
Received Thanks: 4
Maybe can you tell me how to do this?
lewy1000 is offline  
Old 04/19/2014, 20:09   #6
 
elite*gold: 0
Join Date: Jan 2009
Posts: 314
Received Thanks: 686
Search for source code from bot projects (zBot)
Maybe you'll get an idea how it works...
DaxterSoul is offline  
Old 04/19/2014, 20:21   #7
 
elite*gold: 0
Join Date: Dec 2007
Posts: 81
Received Thanks: 4
Ohh thx!
lewy1000 is offline  
Old 04/19/2014, 21:48   #8
 
zeteris's Avatar
 
elite*gold: 0
Join Date: Jan 2009
Posts: 575
Received Thanks: 752
Yeah you can check source codes I've released



I don't know if links are still alive. These sources were very buggy ( I used wrong method for parsing everything, but it should help you).

GL on what you're doing
zeteris is offline  
Old 04/22/2014, 22:44   #9
 
elite*gold: 0
Join Date: Dec 2007
Posts: 81
Received Thanks: 4
i check your source code but still can't finde how to get players CharName from packet
o.O
Uhh... maybe sample or some help?
lewy1000 is offline  
Old 04/23/2014, 11:04   #10
 
elite*gold: 0
Join Date: Jan 2009
Posts: 314
Received Thanks: 686
Code:
//zBot_source_vsro_by_Zeteris\Silkroad\Logic\GameServer\Spawns\SpawnParsing.cs

public static void ParseChar(Packet packet, int index)
        {
            try
            {
                int s_index = 0;
                for (int i = 0; i < Spawns.characters.Length; i++)
                {
                    if (Spawns.characters[i].charname == null)
                    {
                        s_index = i;
                        break;
                    }
                }
                int trade = 0;
                int stall = 0;
                packet.data.ReadBYTE(); // Volume/Height
                packet.data.ReadBYTE(); // Rank
                packet.data.ReadBYTE(); // Icons
                packet.data.ReadBYTE(); // Unknown
                packet.data.ReadBYTE(); // Max Slots
                int items_count = packet.data.ReadBYTE();
                for (int a = 0; a < items_count; a++)
                {
                    uint itemid = packet.data.ReadDWORD();
                    int itemindex = Items_Info.itemsidlist.IndexOf(itemid);
                    if (Items_Info.itemstypelist[itemindex].StartsWith("ITEM_CH") || Items_Info.itemstypelist[itemindex].StartsWith("ITEM_EU") || Items_Info.itemstypelist[itemindex].StartsWith("ITEM_FORT") || Items_Info.itemstypelist[itemindex].StartsWith("ITEM_ROC_CH") || Items_Info.itemstypelist[itemindex].StartsWith("ITEM_ROC_EU"))
                    {
                        byte plus = packet.data.ReadBYTE(); // Item Plus
                    }
                    if (Items_Info.itemstypelist[itemindex].StartsWith("ITEM_EU_M_TRADE") || Items_Info.itemstypelist[itemindex].StartsWith("ITEM_EU_F_TRADE") || Items_Info.itemstypelist[itemindex].StartsWith("ITEM_CH_M_TRADE") || Items_Info.itemstypelist[itemindex].StartsWith("ITEM_CH_W_TRADE"))
                    {
                        trade = 1;
                    }
                }
                packet.data.ReadBYTE(); // Max Avatars Slot
                int avatar_count = packet.data.ReadBYTE();
                for (int a = 0; a < avatar_count; a++)
                {
                    uint avatarid = packet.data.ReadDWORD();
                    int avatarindex = Items_Info.itemsidlist.IndexOf(avatarid);
                    byte plus = packet.data.ReadBYTE(); // Avatar Plus
                    if (avatarindex == -1)
                    {
                        Globals.UpdateLogs("Error on avatars !!! Avatar ID: " + avatarid);
                    }
                }
                int mask = packet.data.ReadBYTE();
                if (mask == 1)
                {
                    uint id = packet.data.ReadDWORD();
                    string type = Mobs_Info.mobstypelist[Mobs_Info.mobsidlist.IndexOf(id)];
                    if (type.StartsWith("CHAR"))
                    {
                        packet.data.ReadBYTE();
                        byte count = packet.data.ReadBYTE();
                        for (int i = 0; i < count; i++)
                        {
                            packet.data.ReadDWORD();
                        }
                    }
                }
                Spawns.characters[s_index].id = packet.data.ReadDWORD();

                byte xsec = packet.data.ReadBYTE();
                byte ysec = packet.data.ReadBYTE();
                float xcoord = packet.data.ReadSINGLE();
                packet.data.ReadSINGLE();
                float ycoord = packet.data.ReadSINGLE();

                packet.data.ReadWORD(); // Position
                byte move = packet.data.ReadBYTE(); // Moving
                packet.data.ReadBYTE(); // Running

                if (move == 1)
                {
                    xsec = packet.data.ReadBYTE();
                    ysec = packet.data.ReadBYTE();
                    if (ysec == 0x80)
                    {
                        xcoord = packet.data.ReadWORD() - packet.data.ReadWORD();
                        packet.data.ReadWORD();
                        packet.data.ReadWORD();
                        ycoord = packet.data.ReadWORD() - packet.data.ReadWORD();
                    }
                    else
                    {
                        xcoord = packet.data.ReadWORD();
                        packet.data.ReadWORD();
                        ycoord = packet.data.ReadWORD();
                    }
                }
                else
                {
                    packet.data.ReadBYTE(); // No Destination
                    packet.data.ReadWORD(); // Angle
                }

                Spawns.characters[s_index].alive = packet.data.ReadBYTE(); // Alive
                packet.data.ReadBYTE(); // Unknown
                packet.data.ReadBYTE(); // Unknown
                packet.data.ReadBYTE(); // Unknown

                packet.data.ReadDWORD(); // Walking speed
                packet.data.ReadDWORD(); // Running speed
                packet.data.ReadDWORD(); // Berserk speed

                int active_skills = packet.data.ReadBYTE(); // Buffs count
                Spawns.characters[s_index].buffs = new Spawns.Characters_.Buffs_[100];
                for (int a = 0; a < active_skills; a++)
                {
                    uint skillid = packet.data.ReadDWORD();
                    int buffindex = Skills_Info.skillsidlist.IndexOf(skillid);
                    Spawns.characters[s_index].buffs[a].name = Skills_Info.skillsnamelist[Skills_Info.skillsidlist.IndexOf(skillid)];
                    string type = Skills_Info.skillstypelist[buffindex];
                    Spawns.characters[s_index].buffs[a].tempid = packet.data.ReadDWORD(); // Temp ID
                    if (type.StartsWith("SKILL_EU_CLERIC_RECOVERYA_GROUP") || type.StartsWith("SKILL_EU_BARD_BATTLAA_GUARD") || type.StartsWith("SKILL_EU_BARD_DANCEA") || type.StartsWith("SKILL_EU_BARD_SPEEDUPA_HITRATE"))
                    {
                        packet.data.ReadBYTE();
                    }
                }
                string name = packet.data.ReadSTRING(enumStringType.ASCII);
                Spawns.characters[s_index].charname = name;
                packet.data.ReadBYTE(); // Unknown
                packet.data.ReadBYTE(); // Job type
                packet.data.ReadBYTE(); // Job level
                int cnt = packet.data.ReadBYTE();
                packet.data.ReadBYTE();
                if (cnt == 1)
                {
                    packet.data.ReadDWORD();
                }
                packet.data.ReadBYTE(); // Unknown
                stall = packet.data.ReadBYTE(); // Stall flag
                packet.data.ReadBYTE(); // Unknown
                string guild = packet.data.ReadSTRING(enumStringType.ASCII); // Guild
                Spawns.characters[s_index].guildname = guild;
                if (trade == 1)
                {
                    packet.data.ReadWORD();
                }
                else
                {
                    packet.data.ReadDWORD(); // Guild ID
                    packet.data.ReadSTRING(enumStringType.ASCII); // Grant Name
                    packet.data.ReadDWORD();
                    packet.data.ReadDWORD();
                    packet.data.ReadDWORD();
                    packet.data.ReadWORD();
                    if (stall == 4)
                    {
                        packet.data.ReadSTRING(enumStringType.ASCII);
                        packet.data.ReadDWORD();
                        packet.data.ReadWORD();
                    }
                    else
                    {
                        packet.data.ReadWORD();
                    }
                }
            }
            catch (Exception ex)
            {
                Globals.Debug("Spawn", ex.Message + " Count: " + BotData.groupespawncount, packet);
            }
        }
zZZzzZ...
Code:
                string name = packet.data.ReadSTRING(enumStringType.ASCII);
                Spawns.characters[s_index].charname = name;
DaxterSoul is offline  
Old 04/27/2014, 10:59   #11
 
elite*gold: 0
Join Date: Apr 2014
Posts: 114
Received Thanks: 120
Use this if it helps, most complete parsing of the player spawn packet around.

Code:
    [dword] pk2 (char)
     [byte] volume_height
     [byte] flag (quest_rank)
     [byte] flag (icon)
     [byte] flag (pvp)
     [byte] count (slot_max)
     [byte] count (item_equip_normal)

if(item) {
    [dword] pk2 (item)
     [byte] plus
}

     [byte] count (slot_avatar)
     [byte] count (item_equip_avatar)

if(avatar) {
    [dword] pk2 (item)
     [byte] plus
}

     [byte] flag (duplicate)

if(duplicate) {
    [dword] pk2 (char)
     [byte] volume_height
     [byte] count (item_equip_normal)

if(item) {
    [dword] pk2 (item)
}
}

    [dword] unique id (player)
     [word] zone
    [float] x
    [float] z
    [float] y
     [word] angle
     [byte] flag (destination)
     [byte] flag (movement)

if(destination) {
     [word] zone
     [word] x
     [word] z
     [word] y
}

else {
00
     [word] angle
}

     [byte] flag (alive_state)
     [byte] flag (stance)
     [byte] flag (berserk)
00
    [float] speed (walk)
    [float] speed (run)
    [float] speed (berserk)
     [byte] count (buff)

if(buff) {
    [dword] pk2 (skill/item)
    [dword] Duration (ms)
}

     [word] string (player_name)
     [byte] flag (job)
     [byte] flag (job_level)
     [byte] flag (pk_status)
     [byte] flag (transport)
00

if(transport) {
    [dword] unique id (cos)
}

00                                         
     [byte] flag (stall_state)
00 
     [word] string (guild_name)
    [dword] unique id (guild)           
     [word] string (player_grantname)
    [dword] emblem (guild)      
    [dword] unique id (union)             
    [dword] emblem (union)  
     [byte] flag (guild_war)
     [byte] flag (fortress_rank)

if(stall) {
     [word] string (stall_name)
    [dword] pk2 (item_model)
}

     [byte] (un)equip timer
     [byte] flag (pk)
Alkosh is offline  
Old 04/28/2014, 08:52   #12
 
elite*gold: 0
Join Date: May 2013
Posts: 38
Received Thanks: 10
sry but thats not that i call "most complete"... =)
amra85 is offline  
Old 04/28/2014, 13:00   #13
 
elite*gold: 0
Join Date: Apr 2014
Posts: 114
Received Thanks: 120
Quote:
Originally Posted by amra85 View Post
sry but thats not that i call "most complete"... =)
How so? It's only missing 5 bytes (which I rarely saw ever change) and it takes into accounts other variables such as riding transport, stalls and un-equip timer. Find me a more complete one.
Alkosh is offline  
Old 04/28/2014, 13:39   #14
 
Royalblade*'s Avatar
 
elite*gold: 85
Join Date: Feb 2014
Posts: 1,056
Received Thanks: 1,643


Might help
Royalblade* is offline  
Thanks
1 User
Old 04/28/2014, 14:12   #15
 
elite*gold: 0
Join Date: Jan 2009
Posts: 314
Received Thanks: 686
Code:
     [byte] flag (icon)
     [byte] flag (pvp)
     
--> Correction:
            1   byte    PVPCape(0=None, 1=Red, 2=Gray, 3=Blue, 4=White, 5=Orange)
            1   byte    AutoInverstExp(1 = BeginnerIcon ,2 = Helpful, 3 = BeginnerIcon & Helpful)
Code:
else {
00
     [word] angle
}

--> Add:
            else
            {
                1   byte    DirectionWalk (0 = SpinOnPoint, 1 = Sky-/ArrowKey-walking)
                2   ushort  Angle
            }
Code:
     [byte] flag (alive_state)
     [byte] flag (stance)
     [byte] flag (berserk)
00

--> Correction: 
            1   byte    StateFlag(1 = Alive, 2 = Dead)
            1   byte    *unk -> Check for != 0
            1   byte    Action (0 = None, 2 = Walking, 3 = Running, 4 = Sitting)
            1   byte    Status(0 = None, 1 = Berserk , 2 = ?, 3 = Invincible, 4 = Invisible)
Code:
     [byte] flag (transport)
00

--> Correction:
            1   byte    RideFlag
            1   byte    AttackFlag
Edit:
Code:
if(buff) {
    [dword] pk2 (skill/item)
    [dword] Duration (ms)
}

--> Add:
            foreach(ActiveBuff)
            {
                RefSkillID
                Duration
                if(RefSkill.Params.Contains: 1701213281  -> atfe -> "auto transfer effect" like Recovery Division)
                {
                    1   byte    Creator
                }
            }
I'm not trying to offend you, just corrections. I might have some mistakes as well
Thanks for guild_war and pk_status, i'll check them.
You are doing great job at least if you're parsing them yourself and not collecting them together :P
DaxterSoul is offline  
Thanks
2 Users
Reply


Similar Threads Similar Threads
[Selling] Heroic SoO Geared Characters ** This are Top Characters Ready to be Buyed ** Rare !
09/24/2013 - World of Warcraft Trading - 2 Replies
New Stock with World of Warcraft Accounts Each Character is Separetly Account Each Buyer Receive : Photo ID Login Password SQ+Answer Change eMail Change a New Password
[Sell]Special Characters FULL Pack | 5 Tipes of Characters [Buy]26 e*g
03/03/2013 - elite*gold Trading - 0 Replies
Hello poeples. I sell Special characters. There are 5 .txt with a lot of special characters. .txt's name: Name Decoration Letters Others Name Decoration - Others
[Release] +5500 Packets structure , client/packets constants
10/07/2012 - CO2 PServer Guides & Releases - 10 Replies
edit : if u know nothing about packets go to this post first explaining what is packets , and explaining a packet with details and everything http://www.elitepvpers.com/forum/co2-pserver-disc ussions-questions/2162344-packets-packets-packets. html#post19074533 i start making my very own packet structure to use them on my new proxy but i thought of ripping them from the source so yeah the following packets is ripped of trinity base source right now im just providing the packets structure...
[SALE] World of Warcraft Account's - Normal Characters PvE-PvE or End Game Characters
04/19/2012 - World of Warcraft Trading - 1 Replies
WTS World of Warcraft Accounts (EU and US Too) As you Know me im The Best Seller from This Forum / Best Prices and 100% Safety . Contact me on Skype ID : World-of-Warcraft-Shop Our Website URL - World of Warcraft - Home
MMO Auction||AION CHARACTERS SALE||Elite Gear-Brigade Generals||Best Characters||
03/16/2012 - Aion Trading - 12 Replies
Account 1. Elyos - Sorcerer : http://img192.imageshack.us/img192/4439/elyossorc erer.png Account 2. Elyos - Assasin : http://img19.imageshack.us/img19/3702/elyosassasi n.png Account 3. Elyos - Templar :



All times are GMT +1. The time now is 16:36.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.