hi,
http://docs2x.smartfoxserver.com/Advanc ... extensions mentions only static property-files for extensions.
i need to instantiate a (game)room-extension with parameters that i get at runtime (i.e. from the DB).
how can i achieve that?
best,
thomas
Dynamic extension properties (rather than static files)
ok, details:
when calling createGame (or before), i need to hand over some parameters to the room extension.
should/can i subclass CreateSFSGameSettings, and (how) can i access this in the room extension?
or is there any other way to specify game-specific parameters *during* room extension instantiation *without* a static property file?
best
t
Code: Select all
CreateSFSGameSettings settings = new CreateSFSGameSettings();
settings.set...
...
CreateRoomSettings.RoomExtensionSettings extSettings = new CreateRoomSettings.RoomExtensionSettings(EXT_FOLDER_NAME, EXT_NAME);
settings.setExtension(extSettings);
Room room = SmartFoxServer.getInstance().getAPIManager().getGameApi().createGame(this.getParentZone(), settings, null, false, false);
when calling createGame (or before), i need to hand over some parameters to the room extension.
should/can i subclass CreateSFSGameSettings, and (how) can i access this in the room extension?
or is there any other way to specify game-specific parameters *during* room extension instantiation *without* a static property file?
best
t
1. Create the Room.
2. Populate its properties (setProperty/getProperty) with data that you need
3. Invoke a specific method on your Room extension to trigger the code that will use those properties
NICE TO HAVE: we should add an optional setRoomProperties(...) method available at creation time to populate those properties in one shot with CreateRoom
2. Populate its properties (setProperty/getProperty) with data that you need
3. Invoke a specific method on your Room extension to trigger the code that will use those properties
NICE TO HAVE: we should add an optional setRoomProperties(...) method available at creation time to populate those properties in one shot with CreateRoom
aaah thanks.
anyway, i'm confused, since the docs state
so, what's the difference between properties and private (server-side only) room variables?
anyway, i'm confused, since the docs state
Previously in SmartFoxServer 1.x you had Room/User Variables and Room/User Properties. With SmartFoxServer 2X all custom data is handled via Room/User Variables.
so, what's the difference between properties and private (server-side only) room variables?
Who is online
Users browsing this forum: No registered users and 66 guests