I am coming from using electroserver background.
How I would set that up is to extend a class to do a custom room then place the java file in the extension.xml
I am just starting to work with rooms in smartfox2x and its different.
There is a zone plugin, and you can also have room plugins?
What I am trying to do is have users join a room for a battle, then when the battle is going on all users in the room will get messages for that battle.
The room obviously needs custom battle logic.
The way i see it i have 2 options
1. create a custom room plugin to handle the custom logic.
2. keep all the custom logic in the zone plugin's code and route requests through the room like
- user sends request to zone plugin, zone plugin goes to a battle handler class, battle handler class grabs the room using sfs2x api and sends request to all users in room
Whats the best way to do this?? Didn't see much in the documentation about exactly how it should work for 2FS2x just general documentation.
SFS2X Room Architecture
Re: SFS2X Room Architecture
can i please get an answer on this topic from one of the admins.
thank you.
thank you.
Re: SFS2X Room Architecture
Hi sorry for the delay.
If you plan to have thousands and thousands of concurrent game Rooms, the extra work of option #2 should help keeping the memory overhead to a minimum.
Yes we call them Extensions, which is basically custom java code that can be plugged at Zone or Room Level to control the logic of you game/application.I am just starting to work with rooms in smartfox2x and its different.
There is a zone plugin, and you can also have room plugins?
Both approaches are equally valid: the latter requires a bit more coding which will pay back in terms of performance. The reason is that solution #1 will instantiate a new copy of the Extension for each Room.The way i see it i have 2 options
1. create a custom room plugin to handle the custom logic.
2. keep all the custom logic in the zone plugin's code and route requests through the room like
- user sends request to zone plugin, zone plugin goes to a battle handler class, battle handler class grabs the room using sfs2x api and sends request to all users in room
If you plan to have thousands and thousands of concurrent game Rooms, the extra work of option #2 should help keeping the memory overhead to a minimum.
Re: SFS2X Room Architecture
Also, take a look at this article:
http://docs2x.smartfoxserver.com/Develo ... ension-api
http://docs2x.smartfoxserver.com/Develo ... ension-api