Register for your free account! | Forgot your password?

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

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

Advertisement



[Need Help]Parsing solo spawn packet[3015]

Discussion on [Need Help]Parsing solo spawn packet[3015] within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old   #1
 
silencer61's Avatar
 
elite*gold: 0
Join Date: Apr 2011
Posts: 124
Received Thanks: 89
[Need Help]Parsing solo spawn packet[3015]

Code:
 public static void ParseSoloSpawn(Packet p)
        {
            Packet copy1 = p;
            copy1.Skip(copy1.GetBytes().Length - 1);
            int type = copy1.Readbyte();
            if (type == 1)
            {
                int charid = p.ReadInt32();
                p.ReadInt32();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.ReadInt16();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                int chars = p.ReadInt16();
                char[] charName = p.ReadChars(chars);
                string charname = new string(charName);
            }
            if (type == 4)
            {
                int model = p.ReadInt32();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.ReadInt32();
                p.Readbyte();
                p.ReadInt32();
                p.Readbyte();
                p.ReadInt32();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.ReadInt16();
                p.Readbyte();
                int walking = p.Readbyte();
                if (walking == 1)
                {
                    p.ReadInt16();
                    p.ReadInt16();
                    p.ReadInt16();
                }
                else
                {
                    p.Readbyte();
                    p.ReadInt16();
                }
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                for (byte b = 0; b < p.Readbyte(); b++)
                {
                    p.ReadInt32();
                    p.ReadInt32();
                }
                int chars = p.ReadInt16();          
                char[] charName = p.ReadChars(chars);
                string charname = new string(charName);
            }
        }
im trying to parse solo spawn packet but it doesnt work.what is wrong
silencer61 is offline  
Old 10/18/2011, 14:43   #2
 
bootdisk's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 134
Received Thanks: 41
First off, you're guessing most of the values.
Like this:

Code:
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.ReadInt32();
Which is quite messy, not a single comment of what that integer of 32 bits should be.
Parsing is not about the parser itself; it's about the packets, so I suggest you to post packets instead of non-commented code.
If you're going to maintain a bot or any other tool it's better to put comments when you do those nested calls as:

Code:
p.ReadInt32(); // chartype
There are also lots of flags, counts and fors that should be take into account.
Also, it might be really helpful for everybody to know the SRO version.
bootdisk is offline  
Thanks
1 User
Old 10/18/2011, 15:43   #3
 
elite*gold: 0
Join Date: May 2009
Posts: 67
Received Thanks: 37
int chars = p.ReadInt16();
WOW....
theonly112 is offline  
Old 10/18/2011, 16:29   #4
 
kevin_owner's Avatar
 
elite*gold: 0
Join Date: Jan 2010
Posts: 1,484
Received Thanks: 809
like bootdisk already said you're missing a lot of checks for the flags and extra loops to get to the end of the packet.

A nice reference is the last byte or the second last byte that one is always 255 it was a pvp flag if i'm correct but this value was always 255 for me even if people wore a pvp cape.

and ofcourse the comments are missing. I also advice you to search trough the forums there are a few parsed groupspawn packets and single spawn packets which are the same the opcode for the grouspawn was 3018 if i'm correct.

@theonly112 what is wow about that?? the name is not the one I would have chosen but still it stands for chars.
kevin_owner is offline  
Thanks
1 User
Old 10/18/2011, 21:07   #5
 
silencer61's Avatar
 
elite*gold: 0
Join Date: Apr 2011
Posts: 124
Received Thanks: 89
Quote:
Originally Posted by bootdisk View Post
First off, you're guessing most of the values.
Like this:

Code:
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.Readbyte();
                p.ReadInt32();
Which is quite messy, not a single comment of what that integer of 32 bits should be.
Parsing is not about the parser itself; it's about the packets, so I suggest you to post packets instead of non-commented code.
If you're going to maintain a bot or any other tool it's better to put comments when you do those nested calls as:

Code:
p.ReadInt32(); // chartype
There are also lots of flags, counts and fors that should be take into account.
Also, it might be really helpful for everybody to know the SRO version.
Quote:
Originally Posted by kevin_owner View Post
like bootdisk already said you're missing a lot of checks for the flags and extra loops to get to the end of the packet.

A nice reference is the last byte or the second last byte that one is always 255 it was a pvp flag if i'm correct but this value was always 255 for me even if people wore a pvp cape.

and ofcourse the comments are missing. I also advice you to search trough the forums there are a few parsed groupspawn packets and single spawn packets which are the same the opcode for the grouspawn was 3018 if i'm correct.

@theonly112 what is wow about that?? the name is not the one I would have chosen but still it stands for chars.
Thx for replying , i made a little mistake, i fixed my problem.I wanna release my party buffer coming soon
silencer61 is offline  
Old 10/20/2011, 16:56   #6
 
bootdisk's Avatar
 
elite*gold: 0
Join Date: Sep 2010
Posts: 134
Received Thanks: 41
Sweet, remember: when seeking for help post packets, the part of your parser that is giving you crashes/wrong data + the SRO version you're working on.
bootdisk is offline  
Reply


Similar Threads Similar Threads
i need help plz source 5520 need spawn packet
10/02/2011 - CO2 Private Server - 7 Replies
i need help plz source 5520 need spawn packet
spawn name Packet 5520
08/21/2011 - CO2 Private Server - 11 Replies
hellos Evert Body this pic http://img832.imageshack.us/img832/7425/44423762.j pg that when i try to upgrade my sourse from 5375 to 5520 i upgrade the spawn to see the monsters and other chars but i can't see the names of them and the char is visble?? so i need spawn packet make it fully working
[Help] Spawn Packet
08/20/2011 - CO2 Private Server - 6 Replies
Right, this is my entity.cs, Im guessing the spawnpacket is in here but I'm trying to update it to work in 5517. I tried changing the individual numbers to the ones found in Shisui's post but im guessing I did it wrong because now I just dc when I log in. Can someone explain what I'm meant to do please? using System; using System.Collections.Generic; using System.IO; using System.Text; using Conquer_Online_Server.Network; using Conquer_Online_Server.Network.GamePackets; using...
Confused about the spawn entity packet
12/20/2010 - CO2 Private Server - 7 Replies
So I wanted to update the spawn entity packet from Hybrid's source (5135 -> 5165) public unsafe struct SpawnEntityPacket { public ushort Size; public ushort Type; public uint Model;



All times are GMT +1. The time now is 14:11.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.