ironbane / IronbaneServerLegacy

A 3D MMO written using pure javascript.
http://www.ironbane.com/
GNU General Public License v3.0
175 stars 44 forks source link

Made cells autonomous services that listen for events; eliminated needless ticking of cells that have no players nearby; fixed an appearance bug #432

Closed markfarrell closed 10 years ago

markfarrell commented 10 years ago

Overhauled the interface to the world handler. It converses asynchronously with a manager of zones. Chris Dickinson's 'spatial-events' uses an octree behind the scenes to search for a cell handler quickly when an event is emitted at particular cell coordinate. Cells only tick when an 'activate' event is fired and completely stop ticking when 'deactivate' is fired. To prevent nodejs from hanging, the 'Ticker' service throttles and limits the amount of ticking that can be going on concurrently at any given time.

Aside from the performance gains from having to do less computations on average per server tick, these changes should allow us to take advantage of multiple cores on a machine in the future. Once we have a better way of serializing units (removing circular references, removing additional awkward fields after it is constructed from data), we should be able to fork our main process and instantiate cell handlers in child processes, transferring player connection descriptors and whatnot with UNIX domain sockets.

I also fixed the 'bug' where your appearance does not update when you respawn.

Signed off by: Mark Farrell markfarr2011@gmail.com

ingmargoudt commented 10 years ago

Approved. Need to look at the quests in the Assets repo if they still work with the changes in trigger.js

LunaSolVT commented 10 years ago

@ingmargoudt if this was approved, should it be merged? Or is there still stuff that needs to be checked?

ingmargoudt commented 10 years ago

@DatapawWolf , a few weeks we decided that we require 2 devs, other than the dev that created the PR, review the code and accept it. After accepting, the PR gets free for merging

nickjanssen commented 10 years ago

Approved! @markfarrell I cannot express how amazed I am by this PR, great work!

lschans commented 10 years ago

Dude.. respect