ID:2314085
 
(See the best response by FKI.)
Problem description: I'm looking to have multiple servers to act as different worlds while still keeping the saves connected. I know this could be fairly easy to do with a sql database but are there any downsides/bottle-necks I should be aware of before implementing this

Best response
There are some known issues with using MySQL databases being slow to return and blocking procs, having high CPU usage, etc.

Personally, I use a separate server that processes everything MySQL-based to avoid these issues. Have your main servers communicate with the server running the database using world/Topic() and you should be good, as I've never had any problems with this setup.
In response to FKI
In addition to this, I believe BYOND has native SQL Lite now, which is optimized for single threaded use (the reason that SQL can block things from happening is because it blocks the entire thread until it's done, if I'm not mistaken).
Thanks
just use client-side saved files
I'd rather not have to deal with people editing saves
Different server machines or different dream daemon 'servers'? if it's the latter, just store and read the savefiles from a common folder.
In response to CrimsonVision
There's really not much point in even having multiple servers if they're all running from the same VM. lol
In response to Zagros5000
Zagros5000 wrote:
I'd rather not have to deal with people editing saves

use protection
In response to Super Saiyan X
Super Saiyan X wrote:
Zagros5000 wrote:
I'd rather not have to deal with people editing saves

use protection

More specifically a checksum. And don't be obvious about it either. Let them load their edited character, but fuck with them to make them think they edited the character wrong so they waste more time trying to work out where they went wrong instead of finding ways to bypass your system.
In response to Ter13
I think the better way of going about it is just savefile encryption. Anything that isn't just XOR encryption should be more than enough to thwart cheaters.

Most people just perform a frequency attack and throw their hands up if it doesn't get them anywhere.
I wouldn't know where to start with either of those methods
In response to Zagros5000
For a checksum, you're seeking to arbitrarily "sum together" a set of values that define your character. Like stats, inventory items, and so forth.

Like so:
var/statsString= "[src.name] [src.level] [src.money] [src.maxHealth]"

Then you run the statsString through a hashing function like md5(). md5() generates a seemingly random hexadecimal string based on the given input. Because it's seemingly random, it can be considered impossible to figure out what the original is, just based on the output of the md5. It can also be considered impossible to modify the md5's output to correspond to some desired input. (In other words, it can be considered impossible to modify a checksum to match a modified savefile)

We use md5() to generate our checksum:
var/checksum = md5(statsString)

You then save this checksum value alongside the rest of the stuff for your character.

When you're loading a character, you generate a new checksum but based on the variable values you loaded from a savefile.
Then you compare the new checksum with the saved checksum, and if they are different... then it's likely that the savefile was modified. There's a brief example for this under the md5() documentation in Dream Maker.

It's important that your checksum encompasses all of the variables that you wish to protect against modification. The short example I have above is not enough if you have other variables in addition to those four.

If you want extra protection, you can add soemthing called a "salt" to the end of your statsString before you run it through md5. A salt is another pseudorandom string that changes for each checksum that you're generating. This helps protect against people trying to figure out how you're generating your checksums.
Hmm, I think i have too many variables I would want not edited for this to work but that is a really cool concept
In response to Zagros5000
You can also use md5() on the savefiles themselves. It's just that you'd have to store the checksum separately.
Hm that would be good if that was the case
Would the hub be able to just save the checksum under every key as a scoreboard value