ID:111655
 
Applies to:Website
Status: Open

Issue hasn't been assigned a status value.
Currently there's no way to write to an online source (Outside of the, in my opinion, fairly badly implemented sql support) with the exception of the Scores system.

What I'm proposing is practically another set of scores which would run pretty much identically, however it would be hidden from view (optionally) from the players, and obviously wouldn't be called the scores.

SetMydb(record, fields)
//Where record is the name of the entry
//Where fields is a param based list of data fields
//Ex.
var/params=list("Time"="06-04-11 14:02","Message"="Hello from another world!")
world.SetMydb("World Message", list2params(params))


GetMydb(record, fields)
GetMydb(count, field)
GetMydb(count, skip, field)
//Where record is the name of the entry
//Where fields is a param based list of data fields
//Where count is the number of entries to look at from the top
//Where field is a text string of a single data entry
//Where skip is the number of entries to skip from the top

//Ex.
var/world_message = null
world_message = world.GetMydb("World Message")
if(world_message)
var/list/params = params2list(world_message)
var/output = ""
if(params["Time"])
output += "Time: [params["Time"]]"
if(params["Message"])
output += " Global Message: [params["Message"]]"
if(output)
world << output


And I'm fairly sure you can all see how this would be helpful for things such as global ban lists and mute lists and the such. I personally have longed for a feature like this for absolutely yonks, and it would be such a great asset that I think it would be fair if it were BYOND-Sub only, since it requires extra server space (Possibly use BYOND member space?).

-El Wookie
What makes the SQL support bad? I've never had any problems with it, nor has anyone I know that uses it.
It seems unconditionally slow in comparison to GetScores, and also requires knowledge of SQL, which personally isn't a problem, but would be for most programmers.
The speed of it is based on a lot of factors. The network speed of the host server and the database server (negated entirely by hosting the game on the same server as the database), things like query complexity and the amount of information being transferred back and forth.

The only reason GetScores() is fairly quick is because the game generally already has some form of connection to the hub, and the complexity of the data is always going to be very basic.

You'll find the same slow speed from GetScores() as you do MySQL if you try using it on a machine with a slow network connection.
Regardless of network speed, for me a MySQL query takes easily a half to a full second longer than GetScores().

That aside, it still doesn't retract from the fact that you would need MySQL knowledge in order to perform these, well in this environment, pretty basic things.
I could see this feature being possible, but I don't see it happening without either raising the membership price, or charging for it individually on a month-by-month basis. Storing that kind of data on a server isn't gonna be cheap.

Also, if you host the game on the MySQL server it'll execute queries just about instantly. This is an issue with MySQL, not with BYOND's implementation of it. Using any other language to access a non-local database also tends to take a few extra seconds.
This is more than likely exactly one of the reasons I would love this implemented, quick and easy database storage is something that would be a godsend for my Server Manager, and I can think of a hundred and one other things I can use it for as well, things everyone could benefit from.

As suggested, I personally would be happy to pay an extra amount just for this benefit.
El Wookie wrote:
Regardless of network speed, for me a MySQL query takes easily a half to a full second longer than GetScores().

That aside, it still doesn't retract from the fact that you would need MySQL knowledge in order to perform these, well in this environment, pretty basic things.

My mysql queries in my games generally take less than 0.002 seconds, according to BYOND's profiler, if you could make a help post in Developer How-to, along with some examples of queries that are taking over a second, and your network setup, we can try and see where the issue is. At one stage I was using an odd version of the mysql client libraries and I was seeing slow speeds like you. It ain't normal.