Register for your free account! | Forgot your password?

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

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

Advertisement



[Development] Java Conquer Server

Discussion on [Development] Java Conquer Server within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1

 
jackpotsvr's Avatar
 
elite*gold: 20
Join Date: Oct 2008
Posts: 328
Received Thanks: 43
[Development] Java Conquer Server

Hi elitepvpers,

Lately we've been working on a conquer online 5017 source programmed in Java, cause we had to learn Java for university. We will gladly continue this project, and work on some exciting features, and this is the development thread.

Java-Conquer-Server

will be about an Conquer Online server emulator programmed in Java. The repository is maintained by Thomas and Jan-Willem Gmelig Meyling, but is open for public contributions and a ElitePVPers thread has been opened since March 2014.



Our goal is to hold on to the native Java libraries as much as possible, currently only leaning on Simple XML for configuration persistency and a PostgreSQL JDBC-connector. The Java Archives for these libraries and other project files are included in this repository. Furthermore, we document our code with Javadoc and Github Wiki's. This is to improve the overall code quality as well as to keep contribution to the repository easy accessible and informative.

The current version of the server has the following features:
  1. Login and account creation
  2. Character information and other start up packets
  3. Spawn me to other players, retrieve surrounding entities when walking or jumping around
  4. Monster spawning
  5. Magic skill proficiency and animation

We're currently working on the attack skills, damage calculation and investigating on how we will implement the AI for NPC's and Monsters. We're thinking about languages like LISP or LUA to take care of the AI.

Our goal is to keep as close as possible to the original Conquer. We intend to implement all varities of item upgrades, stay to the original skills and their damage calculation / chances. We see a view improvements though:
  • Better balance between the various professions
  • Higher loot chances; higher item qualities and socketed items
  • Higher gem mining chance
  • More quests / kill quests
  • More interaction with NPC's (for example quest teaming or a more interactive tutorial)

Building and contribution

Fork the Github repository, load the project into you're Java IDE. We are using Eclipse with EGit. A tutorial on EGit can be found here: . Commited changes can be merged in to the main repository by requesting a merge commit.

For more documentation on how several functions could be implemented, you can go to the following places:

ConquerWiki.com - A site containing all Packet Structures
spirited-fang - A site which may be useful for enumerations
ElitePVPers.com - A forum with a lot of useful posts
Epvp form thread with some useful notes

Running the server


The client first connects to the Authentication Server. There it retrieves the server IP and port number. Then the client connects to the Game Server. The Game Server creates a thread for every active player. This thread then handles all incoming packets from the client, and sends responses and other outgoing packets. Before reading and writing packets, they are decrypted and encrypted in the cipher.

All data for the entities is stored in a so called Model. There are currently two implementations for the model interface: one using Mock data (the Mock model) and one using data stored in a database (the PostgreSQL model). The Mock model allows to develop and test new functionality, without having to alter the database model first. For "production" a database model should be a better fit instead, because compared to the Mock model, the database model is persistent. Other implementations for the Model interface, like a SQLite or Java serialization based model are not planned, but contributors are free to implement them.

A model can be bound in the config.xml file which is loaded at initialization:

Code:
<server gameport="5816" authport="9958">
   <model class="net.co.java.model.Mock"/>
</server>
The database model can be initialized with only a few changes:

Code:
<server gameport="5816" authport="9958">
   <model class="net.co.java.model.PostgreSQL" host="jdbc:postgresql://host:port/database" username="username" password="password"/>
</server>
Currently we only support a one-to-one binding of Authentication server and Game server. We're intending to make the configuration such that additional Game Servers listening on different IP addresses and/or port numbers can be initialized on this instance and/or bound to the Authentication server.

Getting the client

This version uses the Conquer Online 5017 client. Binaries for that version can be downloaded Do not forget to run the client with the blacknull parameter and that local IP adresses can only be accessed after a HEX edit. Or you can just simply download the Conquer Loader from the thread linked above.
jackpotsvr is offline  
Thanks
9 Users
Old 03/25/2014, 16:13   #2
 
elite*gold: 0
Join Date: Feb 2013
Posts: 5
Received Thanks: 0
oh great work !
xSeZaRx is offline  
Old 03/25/2014, 16:16   #3


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 794
Seems really nice. I would advise against using LISP for AI though, and opt for LUA.
KraHen is offline  
Old 03/25/2014, 19:23   #4
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
The socket system is very weak. If you are open to suggestions, I would recommend the use of asynchronous sockets using Java's NIO channel classes. Example:

Code:
public class AsynchronousSocket {
    
    // Composition of networking classes for the asynchronous socket class:
    AsynchronousServerSocketChannel socket;
    CompletionHandler<AsynchronousSocketChannel, Void> acceptHandler;
    
    public AsynchronousSocket() {
        try { socket = AsynchronousServerSocketChannel.open(); }
        catch (Exception e) { System.out.println(e); return; }
        acceptHandler = new CompletionHandler<AsynchronousSocketChannel, Void>() {

            @Override // Invoked when the client is accepted from the backlog.
            public void completed(AsynchronousSocketChannel result, Void attachment) {
                try {
                    System.out.println("Accepting connection from " 
                        + result.getRemoteAddress().toString());
                }
                catch (Exception e) { System.out.println(e); }
                finally { socket.accept(null, this); }
            }

            @Override // Invoked when the client is rejected from the backlog.
            public void failed(Throwable exc, Void attachment) {
                System.out.println("Asynchronous Connection Event Failed");
            }
        };
    }
    
    public boolean Bind(int port, int backlog) {
        try {
            socket = socket.bind(new InetSocketAddress(port), backlog); 
            return true;
        }
        catch (IOException e) { System.out.println(e); }
        return false;
    }
    
    public void Listen()
    {
        socket.accept(null, acceptHandler);        
        System.out.println("Ready for incoming connections.");
    }
}
Spirited is offline  
Thanks
2 Users
Old 03/25/2014, 20:20   #5

 
jackpotsvr's Avatar
 
elite*gold: 20
Join Date: Oct 2008
Posts: 328
Received Thanks: 43
Quote:
Originally Posted by Spirited View Post
The socket system is very weak. If you are open to suggestions, I would recommend the use of asynchronous sockets using Java's NIO channel classes. Example:

Code:
public class AsynchronousSocket {
    
    // Composition of networking classes for the asynchronous socket class:
    AsynchronousServerSocketChannel socket;
    CompletionHandler<AsynchronousSocketChannel, Void> acceptHandler;
    
    public AsynchronousSocket() {
        try { socket = AsynchronousServerSocketChannel.open(); }
        catch (Exception e) { System.out.println(e); return; }
        acceptHandler = new CompletionHandler<AsynchronousSocketChannel, Void>() {

            @Override // Invoked when the client is accepted from the backlog.
            public void completed(AsynchronousSocketChannel result, Void attachment) {
                try {
                    System.out.println("Accepting connection from " 
                        + result.getRemoteAddress().toString());
                }
                catch (Exception e) { System.out.println(e); }
                finally { socket.accept(null, this); }
            }

            @Override // Invoked when the client is rejected from the backlog.
            public void failed(Throwable exc, Void attachment) {
                System.out.println("Asynchronous Connection Event Failed");
            }
        };
    }
    
    public boolean Bind(int port, int backlog) {
        try {
            socket = socket.bind(new InetSocketAddress(port), backlog); 
            return true;
        }
        catch (IOException e) { System.out.println(e); }
        return false;
    }
    
    public void Listen()
    {
        socket.accept(null, acceptHandler);        
        System.out.println("Ready for incoming connections.");
    }
}
Thanks for the feedback.
Of course we're open to suggestions, else there would be no point of making it open source.

We'll investigate on how to implement Asynchronous Sockets and implement it anytime soon.
jackpotsvr is offline  
Old 03/27/2014, 10:07   #6


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Nice to see something different around here though personally not a fan of Java, or its associated IDEs. Thanks for the wiki mention also, did you find most of the packet structures to be accurate?
Korvacs is offline  
Old 03/27/2014, 10:59   #7
 
ganndlas's Avatar
 
elite*gold: 0
Join Date: Feb 2014
Posts: 3
Received Thanks: 5
Quote:
Originally Posted by Korvacs View Post
Nice to see something different around here though personally not a fan of Java, or its associated IDEs. Thanks for the wiki mention also, did you find most of the packet structures to be accurate?
Hi, they are pretty accurate for 5017 We've found several differences so far:
  • Different offsets for the Message packet, there seems to go something wrong in the 5017 table. To-length starts at 26 + fromLength, toStr at 27 + fromLength, immediately followed by msgLength at 28 + fromLength + toLength and message at 29 +... .
  • Interact packet required a bit of shifting with the identity, we've rewritten one of the solutions from a C# source. Offset 24 seems to be SkillID instead of damage, but we've might not have implemented most uses for this packet yet.
ganndlas is offline  
Thanks
2 Users
Old 03/27/2014, 17:06   #8
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Good luck with your little project (Unless it turns big.) XD
Super Aids is offline  
Old 04/01/2014, 21:09   #9
 
ganndlas's Avatar
 
elite*gold: 0
Join Date: Feb 2014
Posts: 3
Received Thanks: 5
Quote:
Originally Posted by Spirited View Post
The socket system is very weak. If you are open to suggestions, I would recommend the use of asynchronous sockets using Java's NIO channel classes.
We have switched to Java NIO now Hopefully the socket system improved significantly now. The implementation is based on the example. Further suggestions will always be appreciated.
ganndlas is offline  
Thanks
1 User
Old 04/03/2014, 04:17   #10
 
L1nk1n*P4rK's Avatar
 
elite*gold: 0
Join Date: Mar 2008
Posts: 303
Received Thanks: 39
Oh Java! Nice, glad to see that someone here is not bound to C# and/or tries (and fails) to make a solid C++ source. I should not be the one to talk, but still, good job guys! Keep it up.
L1nk1n*P4rK is offline  
Thanks
1 User
Old 04/03/2014, 04:21   #11


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,443
Received Thanks: 1,175
Quote:
Originally Posted by L1nk1n*P4rK View Post
Oh Java! Nice, glad to see that someone here is not bound to C# and/or tries (and fails) to make a solid C++ source. I should not be the one to talk, but still, good job guys! Keep it up.
Mhm. My C++ source is not a big fail
CptSky is offline  
Thanks
3 Users
Old 04/11/2014, 19:56   #12
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
No, he has a very valuable point. The point might be from the advice we gave him in his thread asking about programming languages and why we don't use Java, but it's still a good point. Java's socket layer is much slower than C#. There are uses for Java, and making a massive multiplayer server isn't one of them. Is it a useless project though? Well, the original programmer didn't know about NIO before posting here, and now he has something to research into and learn from. He learned Java in class and now he's going above and beyond what was taught by studying on his own, and I have no problem with that. Will the server be stable? Probably. Will the server be efficient? Probably not. Does that make the project useless? Not in my opinion.
Spirited is offline  
Thanks
2 Users
Old 04/11/2014, 23:48   #13
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Quote:
Originally Posted by CptSky View Post
Mhm. My C++ source is not a big fail
Neither is my D source.
Super Aids is offline  
Thanks
4 Users
Old 04/12/2014, 11:11   #14
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,655
Received Thanks: 705
Quote:
Originally Posted by Spirited View Post
No, he has a very valuable point. The point might be from the advice we gave him in his thread asking about programming languages and why we don't use Java, but it's still a good point. Java's socket layer is much slower than C#. There are uses for Java, and making a massive multiplayer server isn't one of them. Is it a useless project though? Well, the original programmer didn't know about NIO before posting here, and now he has something to research into and learn from. He learned Java in class and now he's going above and beyond what was taught by studying on his own, and I have no problem with that. Will the server be stable? Probably. Will the server be efficient? Probably not. Does that make the project useless? Not in my opinion.
It shouldn't matter if the source is one of the greatest around or not, it is about the fact that he programming and learning new things which will increase his knowledge and experience. I am pretty sure your first C# source wasn't great either, what I am simply trying to say is: one will only learn by doing and experiencing.
turk55 is offline  
Thanks
4 Users
Old 04/12/2014, 12:57   #15

 
jackpotsvr's Avatar
 
elite*gold: 20
Join Date: Oct 2008
Posts: 328
Received Thanks: 43
Development continues on full power as soon as exams are finished.
jackpotsvr is offline  
Reply


Similar Threads Similar Threads
Server Development Help [Request Java help] and Base Shop Deutsch/English
04/17/2012 - Runescape Private Server - 1 Replies
German: Hallo Elitepvpers! Mir ist aufgefallen das hier einige Hilfe mit dem programmieren oder dem entwickeln von einem RuneScape Server benötigen. Ich seit einigen Jahren mit dem Programmieren von RuneScape beschäftigt und kann eigentlich fast alles. Schreibt mir hier oder per PN wobei ihr hilfe benötigt oder kontaktiert mich in Skype oder schreibt mir eine E-mail.
Development of conquer p server
01/06/2012 - CO2 Private Server - 17 Replies
Did it just go all the way down after hybrid and ulti? The only server I see doing good is Project X by Bauss just wondering if there is any decent server out there
[Development] 4267 conquer server.
06/16/2010 - CO2 Private Server - 408 Replies
Heya, I've started a new development for a classic co server as I never saw one succesfull build up with a from scratch written and not leeched source. We're currently aiming to add-in bot protection, proxy detection and various protections to prevent hacking. So let's talk more about the source itsself, It's made from scratch and self written socket system, database handling is currently flatfile based. The loginserver is done but we're working on the gameserver now. (Will be...
Java in server development
03/31/2010 - CO2 Private Server - 34 Replies
Why? It seems that a select few have a contingency to hold Java code in contempt. To keep this topic in alignment with this forum, please answer my question with regards to a CO2 PServer. I would like to hear anyone's thoughts or ideas either way about this.
New Conquer Server Project [Java]
02/18/2010 - CO2 Private Server - 63 Replies
Here Hybris, Project CoLeader from CoEurope team if you guys remember the old staff ;) Wishing to build a new source code for a Conquer Private Server, but in Java this time and all brand new ^^ Need to find one or two coders that knows Java very well and who can understand UML Diagrams that i'll make. I'll help coding (much) and giving infos. Need an expert in Socket connections ^^ and someone who can use a little Sniffer with some decryption and disassembling knowledge ;) Well a bit of...



All times are GMT +1. The time now is 05:16.


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.