[Help] About Packet

09/10/2009 06:19 Joon Hye Min#1
An-nyong....

Can someone teach me

about packet info like this...

Code:
 public byte[] CharacterInfo(Character Charr)
        {
            byte[] Packet = new byte[70 + Charr.Name.Length + Charr.Spouse.Length];
            long Model = Convert.ToInt64(Convert.ToString(Charr.Avatar) + Convert.ToString(Charr.Model));

            fixed (byte* p = Packet)
            {
                *((ushort*)p) = (ushort)Packet.Length;
                *((ushort*)(p + 2)) = 1006;
                *((uint*)(p + 4)) = (uint)Charr.UID;
                *((uint*)(p + 8)) = (uint)Model;
                *((ushort*)(p + 12)) = (ushort)Charr.Hair;
                *((uint*)(p + 14)) = (uint)Charr.Silvers;
                *((uint*)(p + 18)) = (uint)Charr.CPs;
                *((uint*)(p + 22)) = (uint)Charr.Exp;
                *((ushort*)(p + 42)) = (ushort)5130;
                *((ushort*)(p + 46)) = (ushort)Charr.Str;
                *((ushort*)(p + 48)) = (ushort)Charr.Agi;
                *((ushort*)(p + 50)) = (ushort)Charr.Vit;
                *((ushort*)(p + 52)) = (ushort)Charr.Spi;
                *((ushort*)(p + 54)) = (ushort)Charr.StatP;
                *((ushort*)(p + 56)) = (ushort)Charr.CurHP;
                *((ushort*)(p + 58)) = (ushort)Charr.CurMP;
                *((ushort*)(p + 60)) = (ushort)Charr.PKPoints;
                *(p + 62) = Charr.Level;
                *(p + 63) = Charr.Job;
                *((ushort*)(p + 65)) = (ushort)Charr.RBCount;
                *(p + 66) = 1;
                *(p + 67) = 2;
                *(p + 68) = (byte)Charr.Name.Length;

                Packet[69 + Charr.Name.Length] = (byte)Charr.Spouse.Length;

                for (sbyte i = 0; i < Charr.Name.Length; i++)
                {
                    *(p + 69 + i) = (byte)Charr.Name[i];
                }
                for (sbyte i = 0; i < Charr.Spouse.Length; i++)
                {
                    *(p + 70 + Charr.Name.Length + i) = (byte)Charr.Spouse[i];
                }

            }
            return Packet;
        }
what is that mean?

example this..

Code:
  *((ushort*)p) = (ushort)Packet.Length;
Thank you :o
09/10/2009 06:26 UnoAmigos#2
I don't know whats that :o

you can ask MOD

anyway...from Korea in this forum?

Nice...
09/10/2009 06:30 kinshi88#3
That's how the structures of TQ Packets work.
The first 2 values are the packet length (how big it is), then the packet ID.

Code:
                *((ushort*)p) = (ushort)Packet.Length;
                *((ushort*)(p + 2)) = 1006;
Searching this forum and Google will help you alot to understand packets more.
09/10/2009 06:37 Joon Hye Min#4
Quote:
Originally Posted by kinshi88 View Post
That's how the structures of TQ Packets work.
The first 2 values are the packet length (how big it is), then the packet ID.

Code:
                *((ushort*)p) = (ushort)Packet.Length;
                *((ushort*)(p + 2)) = 1006;
Searching this forum and Google will help you alot to understand packets more.
Thank you Ahjussi... i will google it :handsdown:
09/10/2009 11:14 ~Yuki~#5
Quote:
Originally Posted by Joon Hye Min View Post
Thank you Ahjussi... i will google it :handsdown:
WTF?:facepalm:
09/10/2009 16:11 Fish*#6
Quote:
Originally Posted by ~Yuki~ View Post
WTF?:facepalm:
haha :D, thought the same :) Is not something that jsut can be told what it is. Is more complicated :) Go read C# Visual guidse and so on to learn :)
Google won't help much :D
09/10/2009 17:31 kinshi88#7
Quote:
Originally Posted by grillmad View Post
Google won't help much :D
How will Google not help?
Google has the entire internet in their databases.
How is that not useful?
09/10/2009 19:06 unknownone#8
Quote:
Originally Posted by kinshi88 View Post
How will Google not help?
Google has the entire internet in their databases.
How is that not useful?
You haven't told him what to search for.
09/10/2009 20:03 kinshi88#9
Quote:
Originally Posted by unknownone View Post
You haven't told him what to search for.
I'm sorry.
I thought he might have some common sense.
09/10/2009 20:25 unknownone#10
Quote:
Originally Posted by kinshi88 View Post
I'm sorry.
I thought he might have some common sense.
No, I'm serious. If he doesn't know the concept he is searching for, that ain't much good.

fyi, "Packets" isn't gonna find him what he wants.
09/10/2009 22:57 _Emme_#11
[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]


That will probably give it all more sence.
09/10/2009 23:33 kinshi88#12
Quote:
Originally Posted by unknownone View Post
No, I'm serious. If he doesn't know the concept he is searching for, that ain't much good.

fyi, "Packets" isn't gonna find him what he wants.
Uh hur hur Durrrr =P

But yes, I can agree with you =D
09/11/2009 01:26 Zion~#13
Quote:
Originally Posted by EmmeTheCoder View Post
[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]


That will probably give it all more sence.
Do you even know what your talking about?
09/11/2009 02:37 _tao4229_#14
Quote:
Originally Posted by EmmeTheCoder View Post
[Only registered and activated users can see links. Click Here To Register...]

[Only registered and activated users can see links. Click Here To Register...]


That will probably give it all more sence.
Do you even know the difference between a reference and a value type?
09/11/2009 03:54 © Haydz#15
Quote:
Originally Posted by Zion~ View Post
Do you even know what your talking about?
That link emme provided is actually very resourceful and completely relevant.

Now ask the same question to yourself