Managing multi-extension Zone
Posted: 14 May 2009, 00:25
The questions here might be a bit vague - i'm at work so I can't look at my project to point out specifics. What is the best way to handle multiple extensions in one Zone? Right now, I have:
Login
Manager
GameServer
..as extensions attached to the zone. The is an mmo project in Unity.
Login manages all logins! This takes place in it's own room, and I wanted to keep it seperate so I have the future possibility of putting it in a completely different server. If a user is logged in and isn't the GameServer, ActorAdd is fired.
Manager is pretty much the central Extension, although it has little to do with, or any dependence on Login. It receives commands such as ActorAdd, ActorMove, (everything else that comes from the clients), etc. This data is then handled by seperate Java classes that aren't attached as Extensions, like Actor, Inventory, etc.
GameServer is a seperate Unity build that manages and validates stuff that SFS can't, like player collisions, etc. The GameServer manages stuff such as the GameServer request for playerlists, and stuff is passed to it such as ActorAdd, ActorMove, ActorList etc.
Now the problems I continualy run into are that often these classes can't find the current Zone or current connection. So, has anyone done something similar where they then have a central ConnectionHolder or something, that maintains the connection the Zone so it can be called from anyway? I have a static function in my Manager script that's meant to do this, but sometimes it doesn't work, and I'm sure there's a cleaner way of doing it. Should I have all my scripts attached to the zone or can I leave it like it is with the Request Handlers in the Manager/Login/GS and everything else passed to unconnected but instanced classes (they're all called as singletons at the moment).
Login
Manager
GameServer
..as extensions attached to the zone. The is an mmo project in Unity.
Login manages all logins! This takes place in it's own room, and I wanted to keep it seperate so I have the future possibility of putting it in a completely different server. If a user is logged in and isn't the GameServer, ActorAdd is fired.
Manager is pretty much the central Extension, although it has little to do with, or any dependence on Login. It receives commands such as ActorAdd, ActorMove, (everything else that comes from the clients), etc. This data is then handled by seperate Java classes that aren't attached as Extensions, like Actor, Inventory, etc.
GameServer is a seperate Unity build that manages and validates stuff that SFS can't, like player collisions, etc. The GameServer manages stuff such as the GameServer request for playerlists, and stuff is passed to it such as ActorAdd, ActorMove, ActorList etc.
Now the problems I continualy run into are that often these classes can't find the current Zone or current connection. So, has anyone done something similar where they then have a central ConnectionHolder or something, that maintains the connection the Zone so it can be called from anyway? I have a static function in my Manager script that's meant to do this, but sometimes it doesn't work, and I'm sure there's a cleaner way of doing it. Should I have all my scripts attached to the zone or can I leave it like it is with the Request Handlers in the Manager/Login/GS and everything else passed to unconnected but instanced classes (they're all called as singletons at the moment).