Getting packets

01/09/2012 23:54 shadowman123#16
So how can i get these subtypes and how to Construct them ?
01/10/2012 00:01 pro4never#17
Quote:
Originally Posted by shadowman123 View Post
So how can i get these subtypes and how to Construct them ?
... packet log... trial and error or reverse engineering.

Most public sources don't have properly/fully structured arena packets so trial and error may take a bit of work. You could always try running through all the possible status effects.

here's how I did it in albetros.

user.StatusEffect1 = (1UL << int.Parse(data[1]));



Keep in mind that in my source modifying StatusEffect1 or StatusEffect2 automatically updates others screens so that you can see the changes, your source may require you to manually set the update packet.

The way status effects work is that they are bitflags. Most people take the simple route of storing them as two ulongs and performing simple operations to add/remove flags from this effect 'pool'. Two ulongs are needed because tq uses 16 bytes of bitflags in the spawn packet (ulongs each require 8 bytes to hold their data).

Note: a bit is a single binary digit. This means it can be either 1 or 0 (on or off) which is perfect for representing status effects. In the case of this command we are taking the value 1 and shifting it over as many bits as we wish using the << operator.
01/10/2012 00:14 shadowman123#18
well im using smthing like case "test":
{
client.Entity.AddFlag(Parse(data[1]);
}
and it works fine with me but after i reach 100 for example the flags r repeted So i guess i cant know what flag offsets
01/10/2012 00:22 pro4never#19
Quote:
Originally Posted by shadowman123 View Post
well im using smthing like case "test":
{
client.Entity.AddFlag(Parse(data[1]);
}
and it works fine with me but after i reach 100 for example the flags r repeted So i guess i cant know what flag offsets
Multiple issues with doing that...

#1: You are continually adding flags. They are UNIQUE values written at SPECIFIC bits inside the 'pool'. You are not removing old ones so your character will be coated in effects after a few.

#2: Due to the nature of bitfields you need to SHIFT, not add number (for example it goes something like
Code:
Binary     |  Decimal 
1            = 1
10          = 2
100        = 4
1000      = 8
10000    = 16
100000   = 32
1000000  = 64
so obviously by trying effects between 8 and 16 you're just combining effects rather then finding new ones. That's why bitshifting is so simple. You skip over unwanted/invalid values and don't need to bother with a calculator.
01/10/2012 01:00 shadowman123#20
Quote:
Originally Posted by pro4never View Post
Multiple issues with doing that...

#1: You are continually adding flags. They are UNIQUE values written at SPECIFIC bits inside the 'pool'. You are not removing old ones so your character will be coated in effects after a few.

#2: Due to the nature of bitfields you need to SHIFT, not add number (for example it goes something like
Code:
Binary     |  Decimal 
1            = 1
10          = 2
100        = 4
1000      = 8
10000    = 16
100000   = 32
1000000  = 64
so obviously by trying effects between 8 and 16 you're just combining effects rather then finding new ones. That's why bitshifting is so simple. You skip over unwanted/invalid values and don't need to bother with a calculator.
Cool im focusing on building packet atm so there is missing Packet 1135 of length 48 ..Does 48 means that packet consists of 48 bytes ?
01/10/2012 02:55 pro4never#21
Quote:
Originally Posted by shadowman123 View Post
Cool im focusing on building packet atm so there is missing Packet 1135 of length 48 ..Does 48 means that packet consists of 48 bytes ?
When the server says unhandled packet type X of length Y then yes. It means the client just sent a packet with that length and the server has no way of knowing what that packet is/handling it.

It does NOT mean that all packets of that type are that length. Many packets are variable length (packets with any non fixed strings such as chat or names, lists of things such as members in guild or items in warehouse, etc). It's a starting point and nothing more.
01/10/2012 05:07 { Angelius }#22
in the very first thread you posted about those effects, I told you how to get them and what packets you need to edit so you can see those effects.
You just have to learn how to sniff/structure packets
01/10/2012 13:03 shadowman123#23
Quote:
Originally Posted by { Angelius } View Post
in the very first thread you posted about those effects, I told you how to get them and what packets you need to edit so you can see those effects.
You just have to learn how to sniff/structure packets
i know how to strcuture packet ill take any other strcutured packet as an example and ill follow its way of coding beside but to sniff packets i have to get working packet sniffer if u have one and wanna share it would be cool and i forgot what u said really about these effects ..Could u remind me

Quote:
Originally Posted by pro4never View Post
When the server says unhandled packet type X of length Y then yes. It means the client just sent a packet with that length and the server has no way of knowing what that packet is/handling it.

It does NOT mean that all packets of that type are that length. Many packets are variable length (packets with any non fixed strings such as chat or names, lists of things such as members in guild or items in warehouse, etc). It's a starting point and nothing more.
Yea i mean when i know its length and Number ill be able to construct it like any other Packets and send it to client to make it work