At the moment, as I understand it, a lot of network events get fired around to all clients each time a room is created or a player switches from one room to another (in the case of the onRoomListUpdate event). The problem is that in some games (like mine) most of these events represent worthless network traffic that isn't used by most clients.
My idea is this. Between the "Zone" organizational level and the "Room" level, have an optional other level called "Regions". They would be used as follows:
I might have 3 Regions in my game "The Snowy Mountains", "The Desert", and "The Island". Each of these Regions could have any number of Rooms. However, if a player switches a Room within "The Snowy Mountains" Region, players who are currently inside of a Room within "The Desert" Region will not receive notifications of this change because this change crosses Region boundaries. On the other hand, notifications within "The Desert" Region get fired around to other clients within "The Desert" Region as usual. As you can see, even with only three Regions each client only gets a third of the events fired since they only receive events that take place "nearby" in the world.
However, because all of these Regions are within the same Zone, players can still send private messages to each other as usual.
This could be implemented in such a way that it has no impact on existing programs or developers who aren't interested in using Regions to reduce network traffic. I suggest that all Rooms created that don't get a Region specified are simply added to a default "Global" Region that has the current behavior.
I also think that Regions could be implemented in a way that isn't a lot of work for the SmartFoxServer writers. Essentially, all the feature is is a tag attached to certain Rooms that lets the server decide whether certain events are worth sending out to certain Players.
I believe that something like this could help squeeze significant extra mileage out of servers that are running large massively-multiplayer type environments.
Atlas
Regions (a way to reduce network traffic)
This is an interesting suggestion and it could lead to a very long discussion...
To make a long story a short one I have to say that adding a middle layer between the Zone object and the Room object wouldn't be quite simple to implement as it would need a general rethinking on the internal server structure.
The idea of creating regions or special user groupings is however possible implementing it with server side extensions.
More in general we believe that SmartFoxServer should provide all the basic and advanced tools that are needed in the creation of most multiuser applications plus a powerful server side framework that allows developers to implement all kind of sophisticated and custom behaviours.
In the upcoming 1.4.0 version we have introduced a new Zone attribute called "roomUpdates" that allows to turn off the roomAdded/roomDeleted notifications allowing the developer to create his own event handling system. Also the new createRoom() and joinRoom() methods on the server side will allow to turn off the standard SFS events so that the developer can send customized event messages
( you can check the beta here >> http://www.smartfoxserver.com/download/beta/ )
On more thought about the onRoomAdded / onRoomDeleted:
these two events are used to keep your roomList in synch without having to download the entire roomList all the times.
Usually these events aren't sent too frequently even when many hundreds of users are connected. In general it's better to receive these events to stay updated with the room list, than having to receive the entire list more than once.
To make a long story a short one I have to say that adding a middle layer between the Zone object and the Room object wouldn't be quite simple to implement as it would need a general rethinking on the internal server structure.
The idea of creating regions or special user groupings is however possible implementing it with server side extensions.
More in general we believe that SmartFoxServer should provide all the basic and advanced tools that are needed in the creation of most multiuser applications plus a powerful server side framework that allows developers to implement all kind of sophisticated and custom behaviours.
In the upcoming 1.4.0 version we have introduced a new Zone attribute called "roomUpdates" that allows to turn off the roomAdded/roomDeleted notifications allowing the developer to create his own event handling system. Also the new createRoom() and joinRoom() methods on the server side will allow to turn off the standard SFS events so that the developer can send customized event messages
( you can check the beta here >> http://www.smartfoxserver.com/download/beta/ )
On more thought about the onRoomAdded / onRoomDeleted:
these two events are used to keep your roomList in synch without having to download the entire roomList all the times.
Usually these events aren't sent too frequently even when many hundreds of users are connected. In general it's better to receive these events to stay updated with the room list, than having to receive the entire list more than once.