|
Runesource
Release Information
This release contains a cleaner framework with work started on the entity system as well as improvements to the handling of packets and player events
Third Party Dependencies
-Netty 4
Change Log
-Removed static player updating.
-Added entity event system.
-Improved upon packet system.
-Fixed multiplayer.
-Cleaned up player class.
-Implemented a Singleton world class. (Multiple world support isn't realistically necessary)
-Refactoring and general object orientation of specific things like player appearance.
Hot Fixes
Location -> World.java
Code:@Override public void run() { while (true) { long start = System.currentTimeMillis(); try { playerRespitory.values().forEach($it -> $it.getEventHandler().updateMovement($it)); playerRespitory.values().forEach($it -> $it.getEventHandler().update($it)); playerRespitory.values().forEach($it -> $it.reset()); long elapsed= System.currentTimeMillis() - start; long sleepTime = 600 - elapsed; if (sleepTime > 0) { Thread.sleep(sleepTime); } } catch (Exception e) { e.printStackTrace(); } } }
Release
Client & Source - Here
Media
I didn't look at much as I'm about to head to bed, though I quickly found a major problem.
You are not factoring in the time it took to process before sleeping. Instead, it should be:Code:@Override public void run() { while (true) { try { playerRespitory.values().forEach(player -> { player.getEventHandler().updateMovement(player); player.getEventHandler().update(player); player.reset(); }); Thread.sleep(600); } catch (InterruptedException e) { e.printStackTrace(); } } }
Code:@Override public void run() { while (true) { long start = System.currentTimeMillis(); try { playerRespitory.values().forEach(player -> { player.getEventHandler().updateMovement(player); player.getEventHandler().update(player); player.reset(); }); long elapsed= System.currentTimeMillis() - start; long sleepTime = 600 - elapsed; if (sleepTime > 0) { try { Thread.sleep(sleepTime); } catch (InterruptedException e) { e.printStackTrace(); } } } catch (InterruptedException e) { e.printStackTrace(); } } }
Keep them coming, getting better & better.
Nice release, thanks for the Contribution !
Nice release, wont be using but thanks
First of all, thank you for the release. IŽll be using this to try and extend my Java knownledge and hopefully piece together a nice server.
Second, IŽve got the server properly setup and it runs. However, the client wonŽt run for some reason. Getting the following error:
I'm using intelliJ.Code:RS2 user client - release #317 Usage: node-id, port-offset, [lowmem/highmem], [free/members], storeid Process finished with exit code 0
This is a tidy little server foundation.
Edit: Player updating is still too primitive for the server to be useful for people to host, i.e: multi-player rendering works, but you do not see another player move when they walk, nor do you see other players chatbox text.
Host this on github instead
« Previous Thread | Next Thread » |
Thread Information |
Users Browsing this ThreadThere are currently 1 users browsing this thread. (0 members and 1 guests) |