Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server > CO2 PServer Guides & Releases
You last visited: Today at 00:49

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

Advertisement



NextCo V2 Extreamly basic source framework

Discussion on NextCo V2 Extreamly basic source framework within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old 08/08/2013, 01:01   #16
 
Ultimation's Avatar
 
elite*gold: 0
Join Date: Mar 2005
Posts: 1,430
Received Thanks: 1,586
First thing i would use is a circular buffer, Reasons dont rely on getting all the packets from the client everytime u call recv, u will mostly only get part if the buffer is full, this is why tq prefix there packets with the sizes, so later when you extract the packet from the buffer u know if its all there. Secondly Have a base packet type, i dunno lets go along with Packet wich has some basic functionality i.e type field Build and read functions, and then just have a class for each packet type you want to parse, inheriting from Packet, and call them something along the lines of

Code:
public class Packet
{
public short PacketType;
public virtual void Read(byte[] buffer){}
public virtual byte[] Build(){return null;}
}

Code:
Public class DataPacket:Packet
{
//I do this next part in the constructor.
public int UID; //Example Purpose

public DataPacket(){PacketType=10010;}

public override void Read(byte[] buffer)
{
//Watever reading method you want to use here
UID = BitConverter.ToInt32(buffer,4);
}


}
i found it to be easier, and regarding the Circular Buffer, You have Put and Get

Put(byte[] Data);
Get(int length);

In my case it would be.


Code:
public Packet ParseBuffer()
{
byte[] p = Buffer.Get(BitConverter.ToInt16(Buffer.Get(2),0));
//this will cause a "wait" action untill the whole packet is there if its not received complete.
tqpacket= null;
switch (packettype)
{
case 10010:tqpacket=new DataPacket();break; 
}

if (tqpacket != null)
{
tqpacket.Read(p);
}

return tqpacket;
}

this is just my 2 cents worth, Hope it helps
Ultimation is offline  
Thanks
1 User
Old 08/08/2013, 01:46   #17
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
thank you for taking time to help me out
yup that's what i actually do with the custom queue, byte array with enqueue to it's end and dequeue first packet while it can dequeue (data length inside the byte array is equal or exceeds the packet length), where there is one pointer for enqueue and always dequeue from the very first

about the base packet type, it's what im actually doing but im also inheriting the base type class from another interface so i can treat them all the same instead of parsing from child to parent and back again, that was the whole point after using the interface

sorry if i said something wrong, please feel free to correct me, and thanks once more for taking time to help me out
go for it is offline  
Old 08/08/2013, 06:57   #18
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
How do you handle threading?
Super Aids is offline  
Old 08/08/2013, 12:24   #19
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
Quote:
Originally Posted by Super Aids View Post
How do you handle threading?
well i didn't use threading yet, the main thread just pass the packet to it's own objects to handle it statically then send back to the object connection

prolly will create a timer thread with 1000 ms rest for sending msgs and raising all events and so on, still need to think about it, any advice ?
go for it is offline  
Old 08/08/2013, 12:42   #20
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Quote:
Originally Posted by go for it View Post
well i didn't use threading yet, the main thread just pass the packet to it's own objects to handle it statically then send back to the object connection

prolly will create a timer thread with 1000 ms rest for sending msgs and raising all events and so on, still need to think about it, any advice ?


Super Aids is offline  
Thanks
1 User
Old 06/01/2014, 23:57   #21
 
elite*gold: 0
Join Date: Jun 2009
Posts: 32
Received Thanks: 2
what patch is this please?
jason1 is offline  
Old 06/02/2014, 05:50   #22
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
Looking at the source (which looks a bit like Impulse's 5165 base source but a bit messier), it has absolutely no documentation in it. It seems that there was an attempt to make it 5187 or above, but I'm not sure if it was successful since the password cipher wasn't implemented (or I can't see one implemented).
Spirited is offline  
Reply


Similar Threads Similar Threads
[LevelingServer] NextCo ! Because you're worth better
03/26/2013 - CO2 PServer Archive - 58 Replies
http://s1.postimage.org/jqnl52skv/image.jpg http://s2.postimage.org/cqkyd3h9j/image.jpg Listing some server features ! include but NOT LIMITED TO Second Password is done PERFECTLY ! setting secondary password changing secondary password request reset secondary password terminating that request
Nextco.dll
02/22/2013 - CO2 PServer Guides & Releases - 12 Replies
i didn't yet decided to release nextco source or not which to why im picking up some stuff from it and adding to this dll so it will still help others without giving away the whole thing this is going to be updated whenever i get time with more stuff this is what the dll looks like after removing the actual codes from all methods namespace NextCo { internal class SafeDictionary<T1, T2> {
Help me! Visual basic source
04/22/2012 - DarkOrbit - 3 Replies
Hello. Please tell me the code of Control key.... SendKeys.Send("{TAB}") this for example presses TAB button but SendKeys.Send("{CTRL}") or SendKeys.Send("{CONTROL}") don't work :mad:
Looking for a C# Basic CO Source
07/03/2011 - CO2 Private Server - 10 Replies
As the title says I'm looking for a C# source. I've got 5017 but I'd like to get a more updated source. I don't mind coding the rest of the stuff myself. I also need the client if you can find it. I hope that I dont get flamed for this. Anything I manage to code I'll be sure to post back on here for those who need it.
[Help] Basic Tq source
02/04/2009 - CO2 Private Server - 10 Replies
How to get cps for all new player?? I have problem for get cps for me i get cps on cq_user for me i got loggin frezze :mad::mad: no loggin help me ?



All times are GMT +1. The time now is 00:50.


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.