ID:160589
 
This is an interesting question- and no, I'm not asking for a "permanent ban" lib. What I want to know is how permanent you could make a variable before it resets to its default when, for instance, the server is reset.
Let's say, the browser message. Could I be able to change it so that it changes across all servers, and that what i set it to is always what it will be afterwards, even to people who create new servers? How much could I do to keep it to what i set it to, before, at some point, it goes back to its default?

A very long question ;) Hope theres a good way, thanks in advance.
Forever. Using static (or const, I cannot remember now) you can have a variable that never changes, but you can never change it without editing it from the source.

George Gough
In response to KodeNerd
I knew that :P It's not what I'm looking for.
What I want is basically a const variable, but i can change it in-game, and then it will always be what i change it to, even if i close my server and someone else hosts a new one, or whatever. Is that possible?
In response to Adam753
If you can do that, it's not a constant variable, obviously. You could have a variable that you change, but you'd have to store the value in a savefile and reload it upon opening the game again.
In response to Popisfizzy
Since he wants it across all servers, he would have to upload it to a website or something and have the servers read from that.
In response to DarkCampainger
DarkCampainger wrote:
Since he wants it across all servers, he would have to upload it to a website or something and have the servers read from that.

Doesn't windows have MYSQL access through BYOND now?

Easy way would be to connect to the MYSQL server insert the banned players key ip etc, of course the MYSQL can be hosted by an actual company since yo ucan conect to any server.

Hey i think ill make a lib for this thanks :D.
In response to DarkCampainger
I don't know what MYSQL is, but I think for some of the things I'm trying to achieve, an actual website would be more appropriate. Of course, I don't know how to do that either- that's why I'm here!
In response to Adam753
Well, to create a website, you would need a server. It would probably be easiest to use DMCGI to handle everything on the server regarding your vars (unless, of course, you know another programming language that would be better suited for this!).
In response to Jeff8500
My own server? DMCGI? This is getting a bit far out of my reach!
I know this doesn't make people verypopular here, but I think on this occasion I'm just going to have to give in and say "I don't know how to do that, can someone do it for me?"

I know I've got my own website, but I doubt I've got the power to turn it into a server. I've never heard of DMCGI, as the only real programming language I've ever tried was Java, and I didn't get far...

So, it may be that I'm swimming far out of my depth now- Any help would be greatly appreciated!!
In response to Adam753
You don't have to use DMCGI, neither is DMCGI a new language, it's running a website by using a DMB and the existing DM language. If you're interested, search for more info.
In response to Kaioken
Wow, I love it :D
It seems DMCGI has everything I need... except for the ability to actually keep the highscores list, which is what I wanted to do in the first place! I'm still missing the ability to store things "permanently" from within the game. Does DMCGI do that, or do i need something else?

I've learned everything except what I asked for :P
In response to Adam753
Ask yourself: how would a multiple server wide high scores list work?

1) 24/7 Server holds information. This would be in the form of an associative list, most likely.

2) Player plays game, and then their computer sends their score to the server.

3) Server places it on the list, then sends the high scores table back to the player's computer.

4) Player views said high scores.

This can all be done through the world.Export(), world.Topic(), and world.Import() procs. I'll give a tiny example of something similar below.

Server:
var/list/People = new
var/savefile/people_file = new

world/Topic(topic,address) //we'll use only 2 of the built in args
//topic = info sent
//address = address of the comp that sent the info
if(findText(topic,"0_0<--")) //if it finds that string in the topic (it will act as a password of sorts)
var/T = copytext(topic,7) //copy all the text from 7 to the end
if(!T in People) People += T
//(everything - the pass)
people_file["highscores"] << People
world.Export("[address]?[highscores]",people_file) //send the list (in a file) along with the topic highscores


Game:
var/list/people = new

mob/verb/Get_Highscores()
world.Export("111.111.1.1?0_0<--[src.key]")
world/Topic(topic,address)
if(topic == "highscores") //if the other server sent "highscores"
var/savefile/F = world.Import() //import the file world.export() sent
F["highscores"] >> people
world << "Highscores successfully loaded from the remote server"


It might be a little sketchy; I just woke up. It should get the main point across, though. world.Export()/Topic()/Import() are all explained in a chapter in the DM guide, so I suggest you read that if you don't understand them.
In response to Jeff8500
Erm, I looked at this for a while trying to work out what was wrong with it... and finally realised that it just means hosting a different world and using that, and has nothing to do with a website or anything! =P
I'm afraid I've already thought about the option of hosting a 24/7 server, but I can't have one because my parents won't let me keep my computer on overnight, and I'm too young for there to be any way round that ;). I think all I need is something LIKE a 24/7 server, but in the form of a website- and therefore allows me to turn my computer off without destroying the highscores daily!
In response to Adam753
A website is hosted on a server, hence why I suggested that bit of code :P

Also, remember that you should save the high scores on world/Del() and load them in world/New() (on the server I mean) so you don't lose the high scores even when the server is down.
In response to Jeff8500
Well, very clever, but wouldn't it still mean that if I don't have a server open, people can't submit highscores?
In response to Adam753
Yeah, but better to have a server up some times then not at all =]

You would have to save (and encrypt/hash!) data that couldn't be sent, so you could send it at a later date.
In response to Jeff8500
Saving it is easy, but sending it at a later date would be hard, because it would need some kind of check to be triggered while both servers were up... and as if that wasn't hard enough in too many ways, what the hell is encrypting/hashing??? And what happened to keeping scores on a REAL website?!?

Ugh. At this rate, I'll just have to get a dedicated and reliable 24/7 host to do it for me.
In response to Adam753
This is a demo of how to send data from BYOND to a website with PHP+MySQL, along with a file of how to store/retrieve the data.

http://www.byond.com/members/ GhostAnime?command=view_post&post=46866

Of course you need to have a good knowledge of how PHP-MySQL interacts to get what I am doing there.

Hashing and encrypting are two ways of making sure that no one is submitting any false data (which is easy to do in my demo... though the webpage with the pokemon info of mine confirms the hash value before adding it in to the table).

Encryption encrypts the value, making it appear different, and can be decrypted to the original value.

Hashing is a one-way encoding, per say. A famous hashing procedure (in BYOND, PHP, and some other languages) is md5(). Unlike encryption, hashing cannot be reverted. It is a good idea to "salt" (add other letters/numbers/symbols) to the hashing string to make it harder for someone to submit false data. The value totally changes when one value is changed.

For example:
world << md5("Secreat[value]Salt!:D")
In response to GhostAnime
GhostAnime wrote:
Of course you need to have a good knowledge of how PHP-MySQL interacts to get what I am doing there.

Well that's probably been the main problem throughout a lot of the thread!
In response to Adam753
While it does take a good comprehension of how PHP works and such, you could probably still manage to modify it to work for you if you go through it carefully. That's probably one of the best (and most innovative) solution I've seen so far, and is probably as close as you could get to being able to store the high scores using any webhosting company that allows PHP and MYSQL (most do)...
Page: 1 2