Silkroad Online Forums

A community forum for the free online game Silkroad Online. Discuss Silkroad Online, read up on guides, and build your character and skills.

Faq Search Members Chat  Register Profile Login

All times are UTC




Post new topic Reply to topic  [ 25 posts ] 
Author Message
 Post subject: [JaveQ]: Open-source emulator development..
PostPosted: Sun Oct 11, 2009 2:12 pm 
Regular Member
User avatar
Offline

Joined: Jan 2008
Posts: 246
Location: Heesch
JaveQ

Introduction

This will be the open-source development thread of JaveQ. Most of you saw my closed-source development also in this section. After getting tons of request about how I did everything, I decided to stop my closed-source project and make a proper source for a community to work on. It will be accessable for everyone, and also everyone can report bugs.

The private server will be written in Java, using Apache MINA for the networking. I'm using java because I'm the most experienced with that language and I feel like not being the 100th private server written in either C++, C or C#. This development will most likely give you guys a basic emulator, and I'd still have to see how far I want to go with this.

Networking

In this section I will tell you a bit more about the networking I'm using for my emulator, since this is very important. I'm using Apache MINA for my networking, it's a NIO package. It uses it own ThreadPoolExecutor depending on the amount threads and depending on the amount of cores you got on your computer. This will maximize the power of this networking API.

Packet hierachiry
Folders are italic, packages are bold.
  • loginserver
    • src
      • com
        • williaminc
          • loginserver
            • GameEngine
            • LoginServer
            • net
              • ConnectionHandler
              • PacketSender
              • sql
                • QueryHandler
              • codec
                • SilkroadCodecFactory
                • SilkroadPacketEncoder
                • SilkroadPacketDecoder
              • packet
                • Packet
                • PacketBuilder
                • PacketHandler
                • PacketManager
                • impl
                  • LoginHandler
  • gameserver

Emulator

In this section I will list all links of the current SVN, Trac and post the current revision.

Revision: 8
SVN: http://my-svn.assembla.com/svn/JaveQ
Trac: http://my-trac.assembla.com/JaveQ

Setting up the emulator

This guide will be using the Eclipse IDE to setup our server and get it running.

1) First download Eclipse at http://www.eclipse.org.
2) Download the source using SVN update/download it via Trac.
3) Open up Eclipse
4) Make a new project > Create project from existing source (> Navigate to the folder where you loginserver/, gameserver/ folders are and select it.
5) Right-click the project > Proprties > Java build path > Libaries > Add jars. Add all jars folder contained in the libs/ folder.
6) Click on the run-symbol and it should run now.

Thanks,

William.D

_________________
Working on (JaveQ)


Last edited by William.D on Tue Oct 13, 2009 1:34 pm, edited 6 times in total.

Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Sun Oct 11, 2009 2:59 pm 
Forum God
User avatar
Offline

Joined: Jan 2008
Posts: 8186
Location:
Off Topic
lol, >_> Good luck mate.

_________________
Image
Spoiler!

woutR wrote:
Squirt, you're a genius when it comes to raping women.


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Sun Oct 11, 2009 4:31 pm 
Addicted Member
User avatar
Offline

Joined: Feb 2007
Posts: 2568
Location:
Venus
I always thought Java ran a lot slower than C languages?


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Sun Oct 11, 2009 5:21 pm 
Forum God
User avatar
Offline

Joined: Aug 2006
Posts: 8834
Location: Age of Wushu
not always

_________________
Playing Age of Wushu, dota IMBA


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Sun Oct 11, 2009 11:39 pm 
Regular Member
User avatar
Offline

Joined: Sep 2008
Posts: 257
Location:
Persia
Toasty wrote:
I always thought Java ran a lot slower than C languages?

Not always true, good code always runs faster than bad code. In C++ for example it is very difficult to write good code, unless you have good C++ programmers (jMerlin from sremu, and the guys from esro seem to have this covered) you wont be getting the full potential out of the language. Java is (in this case) better than C# and has one advantage - portability. C# can only be run on windows servers, but java can be run on faster, cheaper and more reliable Linux servers aswell as windows servers.

_________________
CeLL wrote:
don't know how to bargain, <---second of all, this isnt some bazaar where I can haggle for an ability pet with a dead chicken and some herbs.


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Mon Oct 12, 2009 2:27 pm 
Loyal Member
User avatar
Offline

Joined: Mar 2008
Posts: 1914
Location: Bulgaria
Good luck, stun us :P


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Mon Oct 12, 2009 4:27 pm 
Regular Member
User avatar
Offline

Joined: Jan 2008
Posts: 246
Location: Heesch
Revision 2 wrote:
- Added project in Eclipse
- Added packages com, williaminc, loginserver

Revision 3 wrote:
- Modified classpath
- Added GameEngine? and loginServer
- Added ConnectionHandler? & net package


Notice the Timeline option on the Trac, it's very, very useful.

_________________
Working on (JaveQ)


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Mon Oct 12, 2009 5:47 pm 
Regular Member
User avatar
Offline

Joined: Jan 2008
Posts: 246
Location: Heesch
Revision 4 wrote:
- Added bin/ folder with the class files
- Added some stuff under the sessionOpened() method of ConnectionHandler?.java
- Added SilkroadCodecFactory?, SilkroadCoderEncoder? and decoder, will be used for en/de-coding of packets.

Revision 5 wrote:
- Classpath fix

Revision 6 wrote:
- Added packet utility class
- Removed line out of ConnectionHandler?.java
- Finished SilkroadPacketDecoder?.java

Revision 7 wrote:
- Changed port from 15579 to 15779
- Added SilkroadPacketEncoder? fully, should work now.
- Added PacketBuilder? utility class for building packets serverside
- Added PacketSender? class to send packets to the session


From Revision 7, can you log in and see the serverlist.

_________________
Working on (JaveQ)


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Mon Oct 12, 2009 10:58 pm 
Regular Member
User avatar
Offline

Joined: Sep 2008
Posts: 257
Location:
Persia
My Assembla login is BrentonS, i didnt want to use xxbrentonxx and Brenton was taken so I did the same thing you did with name. :P

Hmm im a bit confused with Eclipse and how uve set up the svn, mind explaining?

_________________
CeLL wrote:
don't know how to bargain, <---second of all, this isnt some bazaar where I can haggle for an ability pet with a dead chicken and some herbs.


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Tue Oct 13, 2009 12:49 am 
Hi, I'm New Here
User avatar
Offline

Joined: Jun 2008
Posts: 2
Location: In ur HOUSE
Uhm I can help as I mentioned on EPVP just tell me what you want me to do.
Btw Brenton are you going to contribute this project? :).


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Tue Oct 13, 2009 1:20 am 
Regular Member
User avatar
Offline

Joined: Sep 2008
Posts: 257
Location:
Persia
shamir wrote:
Uhm I can help as I mentioned on EPVP just tell me what you want me to do.
Btw Brenton are you going to contribute this project? :).

Yes i am not too experienced with Java unfortunately, i will still contribute to this. As i mentioned above im not sure if i got eclipse working properly yet, so i cant start yet.

I am now working on MySQL database and a bit of a website.

_________________
CeLL wrote:
don't know how to bargain, <---second of all, this isnt some bazaar where I can haggle for an ability pet with a dead chicken and some herbs.


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Tue Oct 13, 2009 10:37 am 
Regular Member
User avatar
Offline

Joined: Jan 2008
Posts: 246
Location: Heesch
I'm making a guide right now how to setup the server using Eclipse. And you can contribute whatever you like, just create a ticket on Trac with your code/bug/etc.

_________________
Working on (JaveQ)


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Tue Oct 13, 2009 4:40 pm 
Forum Legend
User avatar
Offline

Joined: Nov 2006
Posts: 6816
Location: Anything goes
best of luck <3

_________________
Image


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Tue Oct 13, 2009 5:49 pm 
Active Member
User avatar
Offline

Joined: Jan 2009
Posts: 974
Location: Bavaria
I am reading this http://www.amazon.com/Beginning-Java-Ga ... 1598634763
book right now. Will that help me to understand Java good enough to be able to help you in any way? In the book you learn to program a little arcade style game called Galaxy wars...
You learn a lot about Java and Programming but i don't know if it's enough to be able to help with a Silkroad Emulator...

_________________
cpinney wrote:
*points at my penis*


Guild Wars 2


Still checking SRF for the community.


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Tue Oct 13, 2009 10:06 pm 
Forum God
User avatar
Offline

Joined: Apr 2007
Posts: 11256
Location: Pimpas Paradise.
curvekiller wrote:
I am reading this http://www.amazon.com/Beginning-Java-Ga ... 1598634763
book right now. Will that help me to understand Java good enough to be able to help you in any way? In the book you learn to program a little arcade style game called Galaxy wars...
You learn a lot about Java and Programming but i don't know if it's enough to be able to help with a Silkroad Emulator...

dont think that will be enough since I think building a emulator will contain some more advanced coding.
But since Im not a coder I cant answer to 100%, but it wouldnt suprise me.


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Tue Oct 13, 2009 10:10 pm 
Forum God
User avatar
Offline

Joined: Jan 2008
Posts: 8186
Location:
Off Topic
Yeah its not enough....

_________________
Image
Spoiler!

woutR wrote:
Squirt, you're a genius when it comes to raping women.


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Tue Oct 13, 2009 10:53 pm 
Regular Member
User avatar
Offline

Joined: Sep 2008
Posts: 257
Location:
Persia
You will need to read something with networking aswell and maybe a bit on apache MINA.

_________________
CeLL wrote:
don't know how to bargain, <---second of all, this isnt some bazaar where I can haggle for an ability pet with a dead chicken and some herbs.


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Wed Oct 14, 2009 5:43 pm 
Regular Member
User avatar
Offline

Joined: Jan 2008
Posts: 246
Location: Heesch
Server now sends serverlist via the data in the MySQL database. This also holds the people online :). Now there's only login and some small things left for the loginserver, then we can start on the gameserver.

_________________
Working on (JaveQ)


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Wed Oct 14, 2009 6:11 pm 
Active Member
User avatar
Offline

Joined: Jan 2009
Posts: 974
Location: Bavaria
We? Do you have any other people helping you already or do you just talk about the "Open-source-community"?
(Could you answer my question please?)

_________________
cpinney wrote:
*points at my penis*


Guild Wars 2


Still checking SRF for the community.


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Wed Oct 14, 2009 6:16 pm 
Regular Member
User avatar
Offline

Joined: Jan 2008
Posts: 246
Location: Heesch
curvekiller wrote:
We? Do you have any other people helping you already or do you just talk about the "Open-source-community"?
(Could you answer my question please?)


I'm talking for the community, as everyone can contribute their things to the server :)

_________________
Working on (JaveQ)


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Wed Oct 14, 2009 7:35 pm 
Active Member
User avatar
Offline

Joined: Jan 2008
Posts: 786
Location:
Ksro
emacs > eclipse & *

_________________
Image Image Image


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Wed Oct 14, 2009 7:38 pm 
Regular Member
User avatar
Offline

Joined: Jan 2008
Posts: 246
Location: Heesch
HawaiianMix wrote:
emacs > eclipse & *


Such a contributive post, use Emacs if you want. Emacs is a text-editor not an IDE.

_________________
Working on (JaveQ)


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Wed Oct 14, 2009 7:48 pm 
Active Member
User avatar
Offline

Joined: Jan 2008
Posts: 786
Location:
Ksro
William.D wrote:
HawaiianMix wrote:
emacs > eclipse & *


Such a contributive post, use Emacs if you want. Emacs is a text-editor not an IDE.


You get offended easily I see, sheesh. And correction Eclipse is not really an IDE and Emacs is not really an editor. They are both frameworks — Eclipse is a framework around Java and SWT while Emacs is a framework around Lisp.

If you want your hand held, Eclipse ftw. And besides, Emacs is far more powerful & not even vi/vim can produce the same productivity. Emacs is not (mainly) a text editor, it's an IDE for integrating the whole programming process.

_________________
Image Image Image


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Thu Oct 15, 2009 2:04 pm 
Valued Member
User avatar
Offline

Joined: Dec 2007
Posts: 352
Location:
Gaia
HawaiianMix wrote:
William.D wrote:
HawaiianMix wrote:
emacs > eclipse & *


Such a contributive post, use Emacs if you want. Emacs is a text-editor not an IDE.


You get offended easily I see, sheesh. And correction Eclipse is not really an IDE and Emacs is not really an editor. They are both frameworks — Eclipse is a framework around Java and SWT while Emacs is a framework around Lisp.

If you want your hand held, Eclipse ftw. And besides, Emacs is far more powerful & not even vi/vim can produce the same productivity. Emacs is not (mainly) a text editor, it's an IDE for integrating the whole programming process.


I LOL'ed so hard. (Not at the content, but at the ego)

_________________
Image


Top
 Profile  
 
 Post subject: Re: [JaveQ]: Open-source emulator development..
PostPosted: Thu Oct 15, 2009 2:58 pm 
Regular Member
User avatar
Offline

Joined: Jan 2008
Posts: 246
Location: Heesch
HawaiianMix wrote:
William.D wrote:
HawaiianMix wrote:
emacs > eclipse & *


Such a contributive post, use Emacs if you want. Emacs is a text-editor not an IDE.


You get offended easily I see, sheesh. And correction Eclipse is not really an IDE and Emacs is not really an editor. They are both frameworks — Eclipse is a framework around Java and SWT while Emacs is a framework around Lisp.

If you want your hand held, Eclipse ftw. And besides, Emacs is far more powerful & not even vi/vim can produce the same productivity. Emacs is not (mainly) a text editor, it's an IDE for integrating the whole programming process.



I didn't really get offended - but my main question behind it was 'Why did you post this?'. Anyway, like I said - just use what you like, i'm using Eclipse and if you want to write a guide how to impl. this project in Emacs I can add it to the main post if you like.

_________________
Working on (JaveQ)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group