Where is the good place of some data

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

palych063
Posts: 2
Joined: 06 Nov 2020, 08:33

Where is the good place of some data

Postby palych063 » 17 Jun 2021, 12:38

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?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Where is the good place of some data

Postby Lapo » 17 Jun 2021, 12:55

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
Lapo
--
gotoAndPlay()
...addicted to flash games

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 29 guests