actionscript-2multiplayerflash-cs6smartfoxserver

How to save data permanently in an sfs server


I've got a virtual world in Adobe Flash AS2 using SmartFoxServerPro. One problem, everytime a user logs back in, his data resets, well the server never saves it. My question is: how to save permanent data to a server, so even when other people join, they'd see it. For example, if Player1 places a block from his inventory, then the following week he re-joins the game, he'd still see the block, cause the server would have saved hat block to it's map. Another example, how to make the server automatically have mobs on it, so that when user log in, they'd have monsters waiting for them, and even when the mobs, life is 50%, all players would see his life as 50%.

That is my question.


Solution

  • You need to persist your game state in a database and load the information when your user logs in to the game.

    More info on databases and smartfox here:http://docs2x.smartfoxserver.com/DevelopmentBasics/database-recipes