Conquer Resource Wiki

03/07/2010 19:50 CptSky#61
Quote:
Originally Posted by Nullable View Post
sizeof doesn't work that way.. you should read something about it or better try doing it yourself, and remember that the packet i'm reading is actually a pointer to the actual packet allocated on heap, in simple words sizeof doesn't work like this with pointers
When I will return to the C/C++, I will check for this operator :) Anyway, thanks, it's good to know that.
03/20/2010 01:52 Korvacs#62
Small Update:

Im going to be adding 5165 packets this weekend, and probably restructing the packet layouts to have a more definative way of doing things. If anyone has any suggestions as to how they would like to see the packets layed out please post here, ill happily take a look at what you have to say, it was after all made for the community (ie. you guys).
03/20/2010 09:58 KraHen#63
Quote:
Originally Posted by Korvacs View Post
Small Update:

Im going to be adding 5165 packets this weekend, and probably restructing the packet layouts to have a more definative way of doing things. If anyone has any suggestions as to how they would like to see the packets layed out please post here, ill happily take a look at what you have to say, it was after all made for the community (ie. you guys).
I`d personally like to see the offset numbers :P
03/21/2010 03:06 Korvacs#64
Offsets are something that i considered originally, but i rejected it because i beleived that the community would struggle to understand the concept, ill have anouther think about them and see if i can make it simpler.
03/21/2010 10:03 KraHen#65
Quote:
Originally Posted by Korvacs View Post
Offsets are something that i considered originally, but i rejected it because i beleived that the community would struggle to understand the concept, ill have anouther think about them and see if i can make it simpler.
You could include an article about them as well and this would solve the problem :D
03/21/2010 17:03 Korvacs#66
Quote:
Originally Posted by ElDeRnEcRo View Post
You could include an article about them as well and this would solve the problem :D
Yeah thats a good idea.

I have started replacing the packet structures with a new layout using a table, which includes the offset, im also going to write a page about bytes/ushorts/uints/ulongs, and the offsets to help people to understand things alittle more, im also going to re-write all of the values to help make them more standard accross the wiki and easier to understand.
03/21/2010 17:45 Nullable#67
Quote:
Originally Posted by Korvacs View Post
Yeah thats a good idea.

I have started replacing the packet structures with a new layout using a table, which includes the offset, im also going to write a page about bytes/ushorts/uints/ulongs, and the offsets to help people to understand things alittle more, im also going to re-write all of the values to help make them more standard accross the wiki and easier to understand.
Love the new layout of the packets, it's amazing anyhow there is an error in this: [Only registered and activated users can see links. Click Here To Register...] exactly at the exp variable in the 4267 version, here is the correct one:
PHP Code:
            (ushort)Length;
            (
ushort)1006;
            (
uint)(Character.UID);
            (
uint)(Character.Model);
            (
ushort)(Character.Hair);
            (
ushort)(0);
            (
uint)(Money);
            (
ulong)(Experience); // Exactly here :P
            
(uint)(0);
            (
uint)(0);
            (
uint)(0);
            (
ushort)(Strength);
            (
ushort)(Agility);
            (
ushort)(Vitality);
            (
ushort)(Spirit);
            (
ushort)(AttributePoints);
            (
ushort)(Hitpoints);
            (
ushort)(Mana);
            (
ushort)(PkPoints);
            (
byte)(Character.Level);
            (
byte)(Character.Job);
            (
byte)(0);
            (
byte)(Character.RebornCount);
            (
byte)1;
            (
byte)(2);
            (
string with length)Character.Name
            
(string with length)Character.Spouse 
03/21/2010 17:50 Korvacs#68
Experience in the 4267 client never gets high enough to require a ulong, so strictly speaking its a uint for that packet :p
03/21/2010 17:56 Nullable#69
Quote:
Originally Posted by Korvacs View Post
Experience in the 4267 client never gets high enough to require a ulong, so strictly speaking its a uint for that packet :p
Packet never worked with me using a uint, it worked with a ulong though :o
03/21/2010 18:00 Korvacs#70
Quote:
Originally Posted by Nullable View Post
Packet never worked with me using a uint, it worked with a ulong though :o
It doesnt atually make the slightest bit of difference, but you can do this if you like:

PHP Code:
 (ushort)Length;
            (
ushort)1006;
            (
uint)(Character.UID);
            (
uint)(Character.Model);
            (
ushort)(Character.Hair);
            (
ushort)(0);
            (
uint)(Money);
            (
uint)(Experience); // Change this
            
(uint)(0); //Add this
            
(uint)(0);
            (
uint)(0);
            (
uint)(0);
            (
ushort)(Strength);
            (
ushort)(Agility);
            (
ushort)(Vitality);
            (
ushort)(Spirit);
            (
ushort)(AttributePoints);
            (
ushort)(Hitpoints);
            (
ushort)(Mana);
            (
ushort)(PkPoints);
            (
byte)(Character.Level);
            (
byte)(Character.Job);
            (
byte)(0);
            (
byte)(Character.RebornCount);
            (
byte)1;
            (
byte)(2);
            (
string with length)Character.Name
            
(string with length)Character.Spouse 
03/21/2010 18:09 Nullable#71
Quote:
Originally Posted by Korvacs View Post
It doesnt atually make the slightest bit of difference, but you can do this if you like:

PHP Code:
 (ushort)Length;
            (
ushort)1006;
            (
uint)(Character.UID);
            (
uint)(Character.Model);
            (
ushort)(Character.Hair);
            (
ushort)(0);
            (
uint)(Money);
            (
uint)(Experience); // Change this
            
(uint)(0); //Add this
            
(uint)(0);
            (
uint)(0);
            (
uint)(0);
            (
ushort)(Strength);
            (
ushort)(Agility);
            (
ushort)(Vitality);
            (
ushort)(Spirit);
            (
ushort)(AttributePoints);
            (
ushort)(Hitpoints);
            (
ushort)(Mana);
            (
ushort)(PkPoints);
            (
byte)(Character.Level);
            (
byte)(Character.Job);
            (
byte)(0);
            (
byte)(Character.RebornCount);
            (
byte)1;
            (
byte)(2);
            (
string with length)Character.Name
            
(string with length)Character.Spouse 
I know what you mean, 4 + 4 = 8 obviously, but wouldn't it be easier to build it up as a ulong instead of adding another blank uint, that's just my opinion.. anyhow it's fine as long as the packet posted on the wiki is fine :)
03/21/2010 18:13 Korvacs#72
Ah well, i use a pointer for my packets so for me its:

PHP Code:
                *(ushort*)PTR = (ushort)Buffer.Length;
                *((
ushort*)(PTR 2)) = 1006;
                *((
uint*)(PTR 4)) = Char.characterID;
                *((
uint*)(PTR 8)) = (uint)(Char.avatar 10000) + Char.modelID;
                *((
ushort*)(PTR 12)) = Char.hairStyle;
                *((
uint*)(PTR 16)) = Char.InventoryGold;
                *((
uint*)(PTR 20)) = Char.experience;
                *((
ushort*)(PTR 40)) = Char.strengthPoints;
                *((
ushort*)(PTR 42)) = Char.agilityPoints;
                *((
ushort*)(PTR 44)) = Char.vitalityPoints;
                *((
ushort*)(PTR 46)) = Char.spiritPoints;
                *((
ushort*)(PTR 48)) = Char.statPoints;
                *((
ushort*)(PTR 50)) = Char.health;
                *((
ushort*)(PTR 52)) = Char.mana;
                *((
ushort*)(PTR 54)) = Char.pkPoints;
                *((
byte*)(PTR 56)) = Char.level;
                *((
byte*)(PTR 57)) = Char.profession;
                *((
byte*)(PTR 59)) = Char.reborn;
                *((
byte*)(PTR 60)) = 1;
                *((
byte*)(PTR 61)) = 2
03/21/2010 18:19 Nullable#73
Quote:
Originally Posted by Korvacs View Post
Ah well, i use a pointer for my packets so for me its:

PHP Code:
                *(ushort*)PTR = (ushort)Buffer.Length;
                *((
ushort*)(PTR 2)) = 1006;
                *((
uint*)(PTR 4)) = Char.characterID;
                *((
uint*)(PTR 8)) = (uint)(Char.avatar 10000) + Char.modelID;
                *((
ushort*)(PTR 12)) = Char.hairStyle;
                *((
uint*)(PTR 16)) = Char.InventoryGold;
                *((
uint*)(PTR 20)) = Char.experience;
                *((
ushort*)(PTR 40)) = Char.strengthPoints;
                *((
ushort*)(PTR 42)) = Char.agilityPoints;
                *((
ushort*)(PTR 44)) = Char.vitalityPoints;
                *((
ushort*)(PTR 46)) = Char.spiritPoints;
                *((
ushort*)(PTR 48)) = Char.statPoints;
                *((
ushort*)(PTR 50)) = Char.health;
                *((
ushort*)(PTR 52)) = Char.mana;
                *((
ushort*)(PTR 54)) = Char.pkPoints;
                *((
byte*)(PTR 56)) = Char.level;
                *((
byte*)(PTR 57)) = Char.profession;
                *((
byte*)(PTR 59)) = Char.reborn;
                *((
byte*)(PTR 60)) = 1;
                *((
byte*)(PTR 61)) = 2
esshh too many de-reference operators, i wrap them up in a class
PHP Code:
public static int WriteUInt64(byte[] Packetint Offsetulong Arg)
        {
            
fixed (bytepckt Packet)
            {
                *(
pckt Offset) = (byte)(Arg);
                *(
pckt Offset 1) = (byte)(Arg >> 8);
                *(
pckt Offset 2) = (byte)(Arg >> 16);
                *(
pckt Offset 3) = (byte)(Arg >> 24);
                *(
pckt Offset 4) = (byte)(Arg >> 32);
                *(
pckt Offset 5) = (byte)(Arg >> 40);
                *(
pckt Offset 6) = (byte)(Arg >> 48);
                *(
pckt Offset 7) = (byte)(Arg >> 56);

                return (
Offset 8);
            }
        } 
03/22/2010 14:56 Korvacs#74
Nice, im going to do that at some point i think.

If anyone else sees anything that looks wrong, or they have anything to add please post here, i have done one or two 5165 packets, but as you can see im only just half way through converting the existing packets.
03/22/2010 21:48 ImFlamedCOD#75
When i get a chance Korvacs when i get home ill check my wiki for packets that you don't have. But if i'm not mistaken you got all the ones i have.