Database or in Server Extension?

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

squirrel
Posts: 3
Joined: 13 May 2009, 20:27

Database or in Server Extension?

Postby squirrel » 13 May 2009, 20:32

First off - want to say awesome product. I'm using it with Unity 3D and the C# API and it's incredible how fast prototyping and development can be done, even though I'm not that proficient in C#.

Anyway, question: If I am creating a fighting game say, and there's multiple players, is it best practice to:

A). Store the abilities (ie. Sword Slash - damage x-y, time 3 seconds) in a database

or

B). Store these in a server extension.

We have a normalized database that we're accessing via a java extension, but it occurs to me that it might be better to only store data the user can change (location, equipment etc.) in the DB and keep static elements of the game logic in the server code such as attack abilities etc.

I realize this isn't completely specific to SFS but since the server extensions are so flexible I thought someone might have suggestions.

Cheers,
User avatar
BigFIsh
Posts: 1698
Joined: 25 Feb 2008, 19:26
Location: New Zealand

Postby BigFIsh » 14 May 2009, 03:26

Hey,

I would advise to use smartfox's user variables for x and y positions and anything that may be altered many times (or use a custom string extension message). Use the database if a user need to save data for next login. (i.e. my last known position etc). When a user logs out, his saved data is lost (usually). Also, it's not a good idea to save things on server side extension - because if your extension encountered a crash and it may need restarting (thus re-initializating all the varaibles)
Smartfox's forum is my daily newspaper.

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 28 guests