Hello everyone!
Here is question about Java extension.
I have some question about place of some data. Let me describe the situation.
We have server with one Zone - GameZone, which has default static Room - The Lobby. Then, on server side we create many dynamic rooms, about 100 - 1000. The live time of this dynamic rooms is short, about 10 - 20 min, this room removes when last user leave room. Also room creates dynamically when some user wants to join there. For each room creation we have to get some data from DB, and this data is the same for all rooms. And here I see some issue, because each room has the same data.
The question is - is it possible to store this data somewhere inside Zone for example, or in The Lobby room? How correct is this? Maybe SmartFox has some API for such case?
Where is the good place of some data
Re: Where is the good place of some data
Hi,
generally speaking there's no problem loading the data in a Zone Extension once and then let the other Rooms access it.
However you must be aware of how SmartFoxServer uses class loaders to separate each Extension in a different context.
http://docs2x.smartfoxserver.com/Extens ... assLoading
This article from our blog will also help with your question:
https://smartfoxserver.com/blog/the-singleton-solution/
Cheers
generally speaking there's no problem loading the data in a Zone Extension once and then let the other Rooms access it.
However you must be aware of how SmartFoxServer uses class loaders to separate each Extension in a different context.
http://docs2x.smartfoxserver.com/Extens ... assLoading
This article from our blog will also help with your question:
https://smartfoxserver.com/blog/the-singleton-solution/
Cheers
Return to “Server Side Extension Development”
Who is online
Users browsing this forum: No registered users and 56 guests