Page 1 of 1
[JaveQ]: Open-source emulator development..
Posted: Sun Oct 11, 2009 2:12 pm
by William.D
JaveQIntroductionThis 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.
NetworkingIn 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 hierachiryFolders are
italic, packages are
bold.
- loginserver
- src
- com
- williaminc
- loginserver
- GameEngine
- LoginServer
- net
- ConnectionHandler
- PacketSender
- sql
- codec
- SilkroadCodecFactory
- SilkroadPacketEncoder
- SilkroadPacketDecoder
- packet
- Packet
- PacketBuilder
- PacketHandler
- PacketManager
- impl
- gameserver
EmulatorIn 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/JaveQTrac:
http://my-trac.assembla.com/JaveQSetting up the emulatorThis 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
Re: [JaveQ]: Open-source emulator development..
Posted: Sun Oct 11, 2009 2:59 pm
by Squirt
lol, >_> Good luck mate.
Re: [JaveQ]: Open-source emulator development..
Posted: Sun Oct 11, 2009 4:31 pm
by Toasty
I always thought Java ran a lot slower than C languages?
Re: [JaveQ]: Open-source emulator development..
Posted: Sun Oct 11, 2009 5:21 pm
by NuclearSilo
not always
Re: [JaveQ]: Open-source emulator development..
Posted: Sun Oct 11, 2009 11:39 pm
by xxbrentonxx
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.
Re: [JaveQ]: Open-source emulator development..
Posted: Mon Oct 12, 2009 2:27 pm
by fckerr
Good luck, stun us

Re: [JaveQ]: Open-source emulator development..
Posted: Mon Oct 12, 2009 4:27 pm
by William.D
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.
Re: [JaveQ]: Open-source emulator development..
Posted: Mon Oct 12, 2009 5:47 pm
by William.D
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.
Re: [JaveQ]: Open-source emulator development..
Posted: Mon Oct 12, 2009 10:58 pm
by xxbrentonxx
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.

Hmm im a bit confused with Eclipse and how uve set up the svn, mind explaining?
Re: [JaveQ]: Open-source emulator development..
Posted: Tue Oct 13, 2009 12:49 am
by shamir
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?

.
Re: [JaveQ]: Open-source emulator development..
Posted: Tue Oct 13, 2009 1:20 am
by xxbrentonxx
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.
Re: [JaveQ]: Open-source emulator development..
Posted: Tue Oct 13, 2009 10:37 am
by William.D
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.
Re: [JaveQ]: Open-source emulator development..
Posted: Tue Oct 13, 2009 4:40 pm
by IceCrash
best of luck <3
Re: [JaveQ]: Open-source emulator development..
Posted: Tue Oct 13, 2009 5:49 pm
by curvekiller
I am reading this
http://www.amazon.com/Beginning-Java-Ga ... 1598634763book 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...
Re: [JaveQ]: Open-source emulator development..
Posted: Tue Oct 13, 2009 10:06 pm
by Swindler
curvekiller wrote:I am reading this
http://www.amazon.com/Beginning-Java-Ga ... 1598634763book 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.
Re: [JaveQ]: Open-source emulator development..
Posted: Tue Oct 13, 2009 10:10 pm
by Squirt
Yeah its not enough....
Re: [JaveQ]: Open-source emulator development..
Posted: Tue Oct 13, 2009 10:53 pm
by xxbrentonxx
You will need to read something with networking aswell and maybe a bit on apache MINA.
Re: [JaveQ]: Open-source emulator development..
Posted: Wed Oct 14, 2009 5:43 pm
by William.D
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.
Re: [JaveQ]: Open-source emulator development..
Posted: Wed Oct 14, 2009 6:11 pm
by curvekiller
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?)
Re: [JaveQ]: Open-source emulator development..
Posted: Wed Oct 14, 2009 6:16 pm
by William.D
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

Re: [JaveQ]: Open-source emulator development..
Posted: Wed Oct 14, 2009 7:35 pm
by HawaiianMix
emacs > eclipse & *
Re: [JaveQ]: Open-source emulator development..
Posted: Wed Oct 14, 2009 7:38 pm
by William.D
HawaiianMix wrote:emacs > eclipse & *
Such a contributive post, use Emacs if you want. Emacs is a text-editor not an IDE.
Re: [JaveQ]: Open-source emulator development..
Posted: Wed Oct 14, 2009 7:48 pm
by HawaiianMix
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.
Re: [JaveQ]: Open-source emulator development..
Posted: Thu Oct 15, 2009 2:04 pm
by loveisintheair
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)
Re: [JaveQ]: Open-source emulator development..
Posted: Thu Oct 15, 2009 2:58 pm
by William.D
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.