Hello.
Im making a MMO. The rooms are persistents but when I disconnect the server, the rooms are cleaned. I want to store these rooms in a DB and then, load the rooms from the DB.
How I can do this?
Thanks!
DB Rooms
You make a server side extension
In the init() method you load the properties of each room (name, type, maxusers etc...) and create them dynamically.
When the application runs you can also store new data in the DB, if necessary and on the next restart you will have all rooms back again.
If you need help in configuring the DB and see how to work with it, check the examples and the documentation coming with SFS PRO.
Kind regards,
p.s. = since SFS 1.6.0 we embedded a powerful database engine, so you don't even have to setup your own.
The database is called H2, more details here -> http://www.h2database.com/
In the init() method you load the properties of each room (name, type, maxusers etc...) and create them dynamically.
When the application runs you can also store new data in the DB, if necessary and on the next restart you will have all rooms back again.
If you need help in configuring the DB and see how to work with it, check the examples and the documentation coming with SFS PRO.
Kind regards,
p.s. = since SFS 1.6.0 we embedded a powerful database engine, so you don't even have to setup your own.
The database is called H2, more details here -> http://www.h2database.com/
Heya-
If you go an look in the feature wish list section. There is a post called Persistent dynamic rooms or some such that was written by me.
It includes all code needed to have Persistent dynamically created rooms over server reboots, as well as being fairly well documented (perhaps over documented lol).
One thing, it currently does not use a DB to write and load files, it writes and loads from a text file. The code was written with 1.5 which did not have the built in DB engine so i waned to make it as useable by as many people as possible. Though it should be easy enough to edit to do the saving and loading from the DBs.
Hope that helps..
_-Menser-_
If you go an look in the feature wish list section. There is a post called Persistent dynamic rooms or some such that was written by me.
It includes all code needed to have Persistent dynamically created rooms over server reboots, as well as being fairly well documented (perhaps over documented lol).
One thing, it currently does not use a DB to write and load files, it writes and loads from a text file. The code was written with 1.5 which did not have the built in DB engine so i waned to make it as useable by as many people as possible. Though it should be easy enough to edit to do the saving and loading from the DBs.
Hope that helps..
_-Menser-_
Return to “SmartFoxServer 1.x Discussions and Help”
Who is online
Users browsing this forum: No registered users and 73 guests