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 18:35

  • 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   #1
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
NextCo V2 Extreamly basic source framework

NextCo V2 is an attempt to increase my programming skills and **** the fear of start on a new source from scratch, this is a basic framework with impulse database classes also was using original trinity as reference

there is nothing fancy, i've worked so hard to get a better design (ex. socket system and the CPacket class which is child of IPacket and parent of the rest of packets classes that you won't need to write every method all over again at every class and still will use all of classes as IPacket object which could be what i've really proud of learning at this project, also the custom queue instead of splitting packets which was mainly mr.pop idea credits goes to him)

more over this wasn't even tested and i won't promise it's 100% right, no syntax errors but maybe there is logical ones, please forgive me as it's my first try EVER to write some big project, im no longer having time to work on it plus i would start it all over again for even better ideas i want to apply

you may use this, rename it, release it, but you may not call it your's or not giving credits

credits for this projects goes to the following people (not in order and it could be direct help or indirect by releasing information)
go for it (AndrewxXx)
Mr.PoP
Korvacs
Impulse
cptsky
Infamousnone
pro4never
shadowman123
bausshacker
fang
Ultimation ^^

and anyone else who ever helped me out and published helpful information for the community

one more thing, i sometimes overused global namespace instead of certain namespaces for sake of simplification but it turns out to be a bit messy and same goes for adding enums at the namespaces and not inside there classes
Attached Files
File Type: rar NextCo.rar (886.2 KB, 374 views)
go for it is offline  
Old 08/05/2013, 18:24   #2
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
I am on the list *.*

Btw. good job on improving and good luck in the future.
Super Aids is offline  
Thanks
1 User
Old 08/05/2013, 19:53   #3
 
elite*gold: 0
Join Date: Mar 2013
Posts: 118
Received Thanks: 95
Just commenting on the packet classes for now.

First of all, the naming of your packets are HORRIBLE.

All your packets inherit from CPacket which exposes a set of usable Readxxx methods yet ALL the packets' getter properties are using BitConverter.Toxxx. Why?

Your IPacket interface has a method called ToArray that returns the packet as a byte array. Why the **** are you exposing the byte array as a public member of CPacket then? ("public byte[] Packet;" - Packet.cs line 8)

In your ChatPacket class you're exposing public members and naming them with underscore prefixes - and the "Message" member even has DOUBLE underscores. Why?

There's so much more to comment on, but I'm starting to get sick from looking at this code
Smaehtin is offline  
Thanks
1 User
Old 08/05/2013, 20:09   #4
 
U2_Caparzo's Avatar
 
elite*gold: 0
Join Date: Aug 2011
Posts: 314
Received Thanks: 90
good job i used impulse's source as base for the first source i wrote too xdd, btw.i don't know why the CO2_CORE_DLL's cripto. implementation is almost never used, in fact, i only saw it in csv3, let's move to a native calls independency ^^
U2_Caparzo is offline  
Thanks
1 User
Old 08/05/2013, 20:15   #5
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
Quote:
Originally Posted by Smaehtin View Post
Just commenting on the packet classes for now.

First of all, the naming of your packets are HORRIBLE.

All your packets inherit from CPacket which exposes a set of usable Readxxx methods yet ALL the packets' getter properties are using BitConverter.Toxxx. Why?

Your IPacket interface has a method called ToArray that returns the packet as a byte array. Why the fuck are you exposing the byte array as a public member of CPacket then? ("public byte[] Packet;" - Packet.cs line 8)

In your ChatPacket class you're exposing public members and naming them with underscore prefixes - and the "Message" member even has DOUBLE underscores. Why?

There's so much more to comment on, but I'm starting to get sick from looking at this code
im sorry that you are sick and well lets take them a point by point
about the chatpacket class it's copied as it is from trinity not even mine

about the CPacket, the set of readxxx/writexxx was going to be used later which doesn't need instance of the byte[] for sake of fasting the coding of anything
ex. packetinstance.writebyte(byte,offset) instead of using the static version of them ex. writebyte(byte,offset,byte[])
i was going to use the readxxx but i've copied some packet structure and didn't bother converting them from bitconverter to readxxx as i was really in hurry

about the ToArray on the interface, yes you got a point i should have made the packet as private

i would love to get more comments as it will help me on the next time i give it another shoot too from real scratch with nhib. and better design, sorry that you are "sick" but i think it's okay as everyone sucks at their very first

Quote:
Originally Posted by U2_Caparzo View Post
good job i used impulse's source as base for the first source i wrote too xdd, btw.i don't know why the CO2_CORE_DLL's cripto. implementation is almost never used, in fact, i only saw it in csv3, let's move to a native calls independency ^^
to be honest i've just copied the crypto from some trinity edit to save time, but yes i've seen the cptsky dll and it's really amazing, i would definitely use it if i developed this source anymore thanks buddy

Quote:
Originally Posted by Super Aids View Post
I am on the list *.*

Btw. good job on improving and good luck in the future.
thanks mate that was motivating ^^
go for it is offline  
Old 08/05/2013, 21:20   #6
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
Good job. You're really improving. I'd really like to see you continue this project if you're still interested in doing so. Btw, check out concurrent dictionary and concurrency / parallel in .NET.
Spirited is offline  
Thanks
1 User
Old 08/07/2013, 03:32   #7
 
Ultimation's Avatar
 
elite*gold: 0
Join Date: Mar 2005
Posts: 1,430
Received Thanks: 1,586
im not on list
Ultimation is offline  
Thanks
2 Users
Old 08/07/2013, 04:08   #8
 
U2_Caparzo's Avatar
 
elite*gold: 0
Join Date: Aug 2011
Posts: 314
Received Thanks: 90
Quote:
Originally Posted by Ultimation View Post
im not on list
Who are u?
U2_Caparzo is offline  
Thanks
2 Users
Old 08/07/2013, 15:00   #9
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
Quote:
Originally Posted by Ultimation View Post
im not on list
lmao not anymore :P
go for it is offline  
Old 08/07/2013, 15:14   #10


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
I'll be honest I haven't downloaded it to take a look, but based on a couple of the above comments you should be working on simplifying and consistency. Rewrite your packets to use either one method or the other, it doesn't matter which as long as its the same throughout.

You should not go down the route of complication for the sake of complication otherwise you will end up in a situation where yes it might work but its needlessly complicated to the point of confusion.

In other words, follow Occam's razor when coding.
Korvacs is offline  
Old 08/07/2013, 15:57   #11
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
Quote:
Originally Posted by Korvacs View Post
I'll be honest I haven't downloaded it to take a look, but based on a couple of the above comments you should be working on simplifying and consistency. Rewrite your packets to use either one method or the other, it doesn't matter which as long as its the same throughout.

You should not go down the route of complication for the sake of complication otherwise you will end up in a situation where yes it might work but its needlessly complicated to the point of confusion.

In other words, follow Occam's razor when coding.
please do, i would love to know my mistakes to avoid them in future
i was planning to use my methods but for sake of decreasing unsafe codes which wasn't even mine i've just gone with the bitconverter instead of other methods i got, it's not a big deal

there is nothing complicated, it's just something i figured out after working my mind instead of just copying with trinity base style
for sake of saving your time here is what we was talking about

Code:
public interface IPacket
{
    unsafe void WriteStringWithLength(string arg, int offset);
//rest of writexxx
    unsafe ulong ReadUInt64(int offset);
//rest of readxxx
    byte[] ToArray();
}
Code:
    public class CPacket : IPacket
    {
        public byte[] Packet;

        public unsafe void WriteString(string arg, int offset)
        {
            fixed (byte* Buffer = Packet)
            {
                ushort i = 0;
                while (i < arg.Length)
                {
                    *((byte*)(Buffer + offset + i)) = (byte)arg[i];
                    i++;
                }
            }
        }
//rest of write and read were removed just to point out what i mean, feel free to see the source for the rest of methods
        public unsafe ulong ReadUInt64( int offset)
        {
            fixed (byte* Buffer = Packet)
            {
                return *((ulong*)(Buffer + offset));
            }
        }

        public virtual byte[] ToArray()
        {
            return Packet;
        }
    }
and at the rest of packet classes im inheriting CPacket , with maybe 3 ctor
Code:
        public DataPacket_10010_()
        {
            Packet = new byte[37 + 8];
            WriteUInt16(37, 0);
            WriteUInt16(10010, 2);
        }
        public DataPacket_10010_(byte[] buffer)
        {
            Packet = buffer;
        }
        public DataPacket_10010_(uint Identifier, uint Value1, ushort Value2, ushort Value3, ushort Type)
so i end up gaining 2 benefits, first can use packets classes as IPacket object also i don't need to write every method at the IPacket on each packet class and finally i'm having the byte[] object at the CPacket class so i can directly use it within the methods of the CPacket class without including it in the statiic usual methods ex. WriteUInt16(37, 0); instead of WriteUInt16(37, 0,Packet);

away from that and the custom queue there is nothing new, maybe the socket system but it's kinda the same as others
go for it is offline  
Old 08/07/2013, 22:10   #12
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Why do you put the packet-type in the class name? Wtf.

What if the type changed? And especially for general data. It has changed one time and it may change another time.
Super Aids is offline  
Old 08/07/2013, 22:28   #13
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
Quote:
Originally Posted by Super Aids View Post
Why do you put the packet-type in the class name? Wtf.

What if the type changed? And especially for general data. It has changed one time and it may change another time.
ill skip the naming part however i was planning on editing the name to be more convenient

whenever the type changes i would simply rename the class and let the visual studio rename it everywhere on the project

i really expected more objective criticism :\
go for it is offline  
Old 08/07/2013, 23:32   #14
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Dumb thing to do,it's pointless to do it like that and it looks ugly. Just change the file name to have the packet type and perhaps make an enum or class with constants.
Super Aids is offline  
Old 08/07/2013, 23:43   #15
 
elite*gold: 0
Join Date: Sep 2012
Posts: 775
Received Thanks: 329
Quote:
Originally Posted by Super Aids View Post
Dumb thing to do,it's pointless to do it like that and it looks ugly. Just change the file name to have the packet type and perhaps make an enum or class with constants.
ill get everything better if people told me that it's good to be a base and worth time it needs to be usable, what i really want to hear is if there is any fatal errors or wrong logic, something could be better at the design that i should change before i start building more with something i would want to change later on
im planning in the next 4 days to switch to nhib, use concurrent instead of custom thread safe directory, rename the classes due to the special char '[',']' been translated to _ which yes looks ugly
fixing some access modifiers and get some properties inline, remove useless objects at the socket/wrapper class
im willing to work on it more and more but i badly need someone expert to enlighten me and tell me if im on a solid base which is worth it or should i start all over again, that's basically why i even released it
go for it 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 18:38.


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.