[JaveQ]: Open-source emulator development..

Discussion portal for kSRO, jSRO, vSRO, cSRO, and all other SRO versions.
Post Reply
User avatar
William.D
Regular Member
Posts: 246
Joined: Mon Jan 21, 2008 11:47 am
Quick Reply: Yes
Location: Heesch

[JaveQ]: Open-source emulator development..

Post by William.D »

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
Last edited by William.D on Tue Oct 13, 2009 1:34 pm, edited 6 times in total.
Working on (JaveQ)

User avatar
Squirt
Forum God
Posts: 8186
Joined: Sat Jan 05, 2008 9:48 pm
Quick Reply: Yes
Location: Off Topic

Re: [JaveQ]: Open-source emulator development..

Post by Squirt »

lol, >_> Good luck mate.
Image
Spoiler!

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

User avatar
Toasty
Addicted Member
Posts: 2568
Joined: Sun Feb 04, 2007 2:23 pm
Quick Reply: Yes
Location: Venus
Contact:

Re: [JaveQ]: Open-source emulator development..

Post by Toasty »

I always thought Java ran a lot slower than C languages?

User avatar
NuclearSilo
Forum God
Posts: 8834
Joined: Mon Aug 21, 2006 12:00 pm
Quick Reply: Yes
Location: Age of Wushu

Re: [JaveQ]: Open-source emulator development..

Post by NuclearSilo »

not always
Playing Age of Wushu, dota IMBA

User avatar
xxbrentonxx
Regular Member
Posts: 257
Joined: Mon Sep 29, 2008 11:35 am
Quick Reply: Yes
Location: Persia

Re: [JaveQ]: Open-source emulator development..

Post 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.
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.

User avatar
fckerr
Loyal Member
Posts: 1914
Joined: Mon Mar 17, 2008 5:02 pm
Quick Reply: Yes
Location: Bulgaria

Re: [JaveQ]: Open-source emulator development..

Post by fckerr »

Good luck, stun us :P

User avatar
William.D
Regular Member
Posts: 246
Joined: Mon Jan 21, 2008 11:47 am
Quick Reply: Yes
Location: Heesch

Re: [JaveQ]: Open-source emulator development..

Post 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.
Working on (JaveQ)

User avatar
William.D
Regular Member
Posts: 246
Joined: Mon Jan 21, 2008 11:47 am
Quick Reply: Yes
Location: Heesch

Re: [JaveQ]: Open-source emulator development..

Post 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.
Working on (JaveQ)

User avatar
xxbrentonxx
Regular Member
Posts: 257
Joined: Mon Sep 29, 2008 11:35 am
Quick Reply: Yes
Location: Persia

Re: [JaveQ]: Open-source emulator development..

Post 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. :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.

User avatar
shamir
Hi, I'm New Here
Posts: 2
Joined: Wed Jun 25, 2008 1:13 pm
Quick Reply: Yes
Location: In ur HOUSE

Re: [JaveQ]: Open-source emulator development..

Post 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? :).

User avatar
xxbrentonxx
Regular Member
Posts: 257
Joined: Mon Sep 29, 2008 11:35 am
Quick Reply: Yes
Location: Persia

Re: [JaveQ]: Open-source emulator development..

Post 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.
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.

User avatar
William.D
Regular Member
Posts: 246
Joined: Mon Jan 21, 2008 11:47 am
Quick Reply: Yes
Location: Heesch

Re: [JaveQ]: Open-source emulator development..

Post 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.
Working on (JaveQ)

User avatar
IceCrash
Forum Legend
Posts: 6816
Joined: Thu Nov 09, 2006 4:49 pm
Quick Reply: Yes
Location: Anything goes

Re: [JaveQ]: Open-source emulator development..

Post by IceCrash »

best of luck <3
Image

User avatar
curvekiller
Active Member
Posts: 974
Joined: Mon Jan 05, 2009 10:57 am
Quick Reply: Yes
Location: Bavaria
Contact:

Re: [JaveQ]: Open-source emulator development..

Post by curvekiller »

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.

User avatar
Swindler
Forum God
Posts: 11256
Joined: Tue Apr 10, 2007 7:49 am
Quick Reply: Yes
Location: Pimpas Paradise.

Re: [JaveQ]: Open-source emulator development..

Post by Swindler »

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.

User avatar
Squirt
Forum God
Posts: 8186
Joined: Sat Jan 05, 2008 9:48 pm
Quick Reply: Yes
Location: Off Topic

Re: [JaveQ]: Open-source emulator development..

Post by Squirt »

Yeah its not enough....
Image
Spoiler!

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

User avatar
xxbrentonxx
Regular Member
Posts: 257
Joined: Mon Sep 29, 2008 11:35 am
Quick Reply: Yes
Location: Persia

Re: [JaveQ]: Open-source emulator development..

Post by xxbrentonxx »

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.

User avatar
William.D
Regular Member
Posts: 246
Joined: Mon Jan 21, 2008 11:47 am
Quick Reply: Yes
Location: Heesch

Re: [JaveQ]: Open-source emulator development..

Post 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.
Working on (JaveQ)

User avatar
curvekiller
Active Member
Posts: 974
Joined: Mon Jan 05, 2009 10:57 am
Quick Reply: Yes
Location: Bavaria
Contact:

Re: [JaveQ]: Open-source emulator development..

Post 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?)
cpinney wrote:*points at my penis*


Guild Wars 2


Still checking SRF for the community.

User avatar
William.D
Regular Member
Posts: 246
Joined: Mon Jan 21, 2008 11:47 am
Quick Reply: Yes
Location: Heesch

Re: [JaveQ]: Open-source emulator development..

Post 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 :)
Working on (JaveQ)

User avatar
HawaiianMix
Active Member
Posts: 786
Joined: Mon Jan 14, 2008 5:25 am
Quick Reply: Yes
Location: Ksro

Re: [JaveQ]: Open-source emulator development..

Post by HawaiianMix »

emacs > eclipse & *
Image Image Image

User avatar
William.D
Regular Member
Posts: 246
Joined: Mon Jan 21, 2008 11:47 am
Quick Reply: Yes
Location: Heesch

Re: [JaveQ]: Open-source emulator development..

Post by William.D »

HawaiianMix wrote:emacs > eclipse & *


Such a contributive post, use Emacs if you want. Emacs is a text-editor not an IDE.
Working on (JaveQ)

User avatar
HawaiianMix
Active Member
Posts: 786
Joined: Mon Jan 14, 2008 5:25 am
Quick Reply: Yes
Location: Ksro

Re: [JaveQ]: Open-source emulator development..

Post 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.
Image Image Image

User avatar
loveisintheair
Valued Member
Posts: 352
Joined: Wed Dec 12, 2007 5:04 pm
Quick Reply: Yes
Location: Gaia

Re: [JaveQ]: Open-source emulator development..

Post 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)
Image

User avatar
William.D
Regular Member
Posts: 246
Joined: Mon Jan 21, 2008 11:47 am
Quick Reply: Yes
Location: Heesch

Re: [JaveQ]: Open-source emulator development..

Post 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.
Working on (JaveQ)

Post Reply

Return to “Other SRO versions”