Register for your free account! | Forgot your password?

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

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

Advertisement



Most effective way to write Packets.

Discussion on Most effective way to write Packets. within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
Danial Eugen's Avatar
 
elite*gold: 0
Join Date: Sep 2012
Posts: 171
Received Thanks: 68
Most effective way to write Packets.

is it using Structs >?
Danial Eugen is offline  
Old 12/06/2012, 00:06   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
It depends really. There's plenty of viable and effective ways of writing packets.

From a pure efficiency standpoint, I'm under the impression that structs and memory marshaling are likely king. I do know that it gets very painful to work with as soon as you start delving into variable offset packets though and therefor are less 'worth it'.

Personally I feel pointers are the best route to take and is actually what the TQ servers use (look at the NetStringPacker in Albetros source, that's ripped from tq sources by dev).


It really depends on what you value. What's most efficient for one packet (simple fixed offset/length packets) might be less efficient or difficult to work with on another (variable number of variable length strings for example)
pro4never is offline  
Thanks
1 User
Old 12/06/2012, 10:46   #3
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 946
What pro said.

Just want to add that if your packet contains strings you should avoid structs IMO.
Super Aids is offline  
Old 12/06/2012, 13:12   #4


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,434
Received Thanks: 1,147
Sequential structures using a packing of one byte. For packets with variable length strings, putting a fixed char array of one byte at the end to use with a StringPacker would do the trick. After that, you can alloc the structure on the heap and cast it to an unsafe byte pointer OR you can stackalloc the structure and copy it to a managed byte array.

That's the way I mostly did it, and that's the way I would go.
CptSky is offline  
Old 12/06/2012, 13:59   #5


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
Effective in which way?

Memory usage.
Speed of creation/sending.
Ease of use.

All of these have different possible solutions.
Korvacs is offline  
Old 12/06/2012, 16:34   #6
 
Danial Eugen's Avatar
 
elite*gold: 0
Join Date: Sep 2012
Posts: 171
Received Thanks: 68
Quote:
Originally Posted by Korvacs View Post
Effective in which way?

Memory usage.
Speed of creation/sending.
Ease of use.

All of these have different possible solutions.
I might select speed of creation/sending... which is the same as ease of use
Danial Eugen is offline  
Old 12/06/2012, 16:55   #7
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 946
Not really. Ease of use is the way you're using it, how easy it is to ex. implement etc.
Super Aids is offline  
Old 12/07/2012, 03:27   #8
 
U2_Caparzo's Avatar
 
elite*gold: 0
Join Date: Aug 2011
Posts: 314
Received Thanks: 90
i think u must use the way that is easier for u to use, actually almost every way to write packets are fast and don't has much memory usage, the difference won't be much, but the difficulty to structure them will be. (ofc this will apply in cases that u aren't writing an extremly crappy code)
U2_Caparzo is offline  
Old 12/07/2012, 09:54   #9


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
Ease of use would be the ease at which it is to write and maintain packet structures and how to access the data and manage it etc. So that would most likely be a class, a byte[] and a base class which each packet inherits from.

For speed of creation I would suggest a class with a pointer based system and you should implement a native method to send by pointer, instead of converting to array.

And for memory its a struct being used as a pointer, but which has a fixed layout.

Thats my view anyway.
Korvacs is offline  
Reply


Similar Threads Similar Threads
[Release] +5500 Packets structure , client/packets constants
10/07/2012 - CO2 PServer Guides & Releases - 10 Replies
edit : if u know nothing about packets go to this post first explaining what is packets , and explaining a packet with details and everything http://www.elitepvpers.com/forum/co2-pserver-disc ussions-questions/2162344-packets-packets-packets. html#post19074533 i start making my very own packet structure to use them on my new proxy but i thought of ripping them from the source so yeah the following packets is ripped of trinity base source right now im just providing the packets structure...
[Packets] Wie änder ich flyff packets?
07/16/2011 - Flyff Private Server - 19 Replies
HeyHo, Ich würde sehr gerne wissen wie man die Flyff Packets ändert... ich denke mal Zahlen ändern werden nicht ausreichen oder?
Most efficient way to write packets?
04/18/2011 - CO2 Private Server - 10 Replies
What is more efficient to use? Pointers or MemoryStream?
What is the most effective bot? VOTE
09/25/2008 - Archlord - 9 Replies
Please ... vote .. which bot is best for you? Edited: If you choise "Other" write the name!!
OLD but still effective
03/06/2007 - CO2 Exploits, Hacks & Tools - 30 Replies
Simple just plv a tao and lv thunder to lv 3+ and go to rb spot(on your way to skypass is where it is), then when u see rb msg just log and BAM zap em once adn there dead and chacne to drop super gemmy or gears^^....like i said this is old but just recently i got a super 2sock brac +3 so thsi scam obviously still works:)......Lastly another way u can do this but it MAY not work is plv a water tao (lv 70 will suffice) and just kill adn rev and kill, only problem with this is that when reved...



All times are GMT +2. The time now is 15:21.


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