Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 11:35

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

Advertisement



Packet Strcuture Example

Discussion on Packet Strcuture Example within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Packet Strcuture Example

Well i've read Korvacs wiki About packets Its Pretty Amazing So i checked How packet being build i decided i to look At Passwordcryptography Seed Strcuture i Found its like that in My Source

Code:
        byte[] Buffer;
        public PasswordCryptographySeed()
        {
            Buffer = new byte[8];
            Writer.WriteUInt16(8, 0, Buffer);
            Writer.WriteUInt16(1059, 2, Buffer);
        }
        public int Seed
        {
            get
            {
                return BitConverter.ToInt32(Buffer, 4);
            }
            set
            {
                Network.Writer.WriteInt32(value, 4, Buffer);
            }
        }
But what i Did is making Private ushort variable Named Seed Then Recalled it like that

Code:
byte[] Buffer;
        private ushort Seed;
        public PasswordCryptographySeed()
        {
            Buffer = new byte[8];
            Writer.WriteUInt16(8, 0, Buffer);
            Writer.WriteUInt16(1059, 2, Buffer);
            Writer.WriteUInt16(Seed, 4, Buffer);
        }
So The question is They r build in 2 ways but Same Result at final So does methods Affect on Socket ?? and is the 2nd way which i used is better then the 1st one or they r Exact same ?
shadowman123 is offline  
Old 02/02/2012, 05:45   #2
 
elite*gold: 0
Join Date: Jan 2012
Posts: 21
Received Thanks: 7
With your new way, you'll never be able to set the seed.
blaсkNull is offline  
Old 02/02/2012, 05:47   #3
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,190
You shouldn't have a ushort as the seed. It needs to be an int (though it'll work properly... TQ uses an int). To answer your question though, they're being built more or less in the same way. You're just writing the data at different times. The socket system only sees the resulting byte array... so it really doesn't matter how it becomes a byte array. The socket will treat it the same as any other byte array that you pass to it.

Quote:
Originally Posted by blaсkNull View Post
With your new way, you'll never be able to set the seed.
^
And that's completely true.
Your seed is private, thus you will not be able to access it.
Spirited is offline  
Old 02/02/2012, 07:00   #4
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Quote:
Originally Posted by blaсkNull View Post
With your new way, you'll never be able to set the seed.
Quote:
Originally Posted by Fаng View Post
You shouldn't have a ushort as the seed. It needs to be an int (though it'll work properly... TQ uses an int). To answer your question though, they're being built more or less in the same way. You're just writing the data at different times. The socket system only sees the resulting byte array... so it really doesn't matter how it becomes a byte array. The socket will treat it the same as any other byte array that you pass to it.



^
And that's completely true.
Your seed is private, thus you will not be able to access it.
Thank you Guyz Stuffs r being Clarified and iam glad for that
shadowman123 is offline  
Old 02/02/2012, 07:00   #5
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,379

<_<
pro4never is offline  
Old 02/03/2012, 10:20   #6
 
elite*gold: 0
Join Date: Dec 2011
Posts: 1,537
Received Thanks: 785
You shouldn't focus much on how you STRUCTURE the packets, but how you HANDLE the packets. You should still focus a bit on it, but shouldn't be your biggest concern.

Like said above, the sockets will threat the result as the same.

Code:
byte[] packet = writepacketway1();//first way to structure packet, still a bytearray
byte[] packet2 = writepacketway2();//second way to structure packet, still a bytearray

socket.Send(packet);//sending first packet, it's the same as 2nd packet, no difference
socket.Send(packet2);//same goes here
So the way you structure packet is not what's really important and it's not what your sockets are relaying on. It's how you handle stuff in your server like queues, features etc.

You seriously need to look up at how C# works.
I don't have a username is offline  
Thanks
1 User
Reply




All times are GMT +1. The time now is 11: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.