ID:1345204
 
Don't want to share your host files with people in fear that it may end in having multiple private servers of your game? (Even though it doesn't show up on hub)

Well, this may be not new for some and, if it's not please, do not comment.

Basically, this code allows you to add a "license" on your host files. This license is the hub's version. So basically if someone hosts a server that does no longer match your hub version, the server will shutdown.

HV



This little ex is for Pokemon Atom, It works the same, and all you'll need to do is change the hub's link.

var/WorldLicense = 1

world
New()
CheckLicense()


proc
CheckLicense()
var/list/http = world.Export("http://www.byond.com/games/Kidpaddle45/PokemonOnline?format=text") // This is the link to your hub, you need to keep it as a text format for BYOND to read it.

if(!http) //If the hub is no longer available...close server.
del(world)

var/c = file2text(http["CONTENT"])

var/savefile/s = new

s.ImportText("/", c)

s.cd = "general"

if(s["version"] == WorldLicense) //If hub's version is the same as the license, world continues as normal.
return
else //If not....Shut it down.
del(world)


So depending on your hub's version, you just change the license to the same number.

var/WorldLicense = 1



Again....if this is nothing new to you, do not waste your time commenting and explaining how useless it is or how late I am for posting this. I know how helpful this can be to many.
Well I have a question.

Cant you just write a code like

world
if(!usr.key=="CovertsuperX")
del(src)


Somewhere along the sort? I know that's for a single user, however, you can slowly give people permission so that you can trust the other servers and not get a bad repution on the game.
I think this is a pretty interesting code.
I agree. ^^ just that's the code I use and wanted to share it.
Well, the thing is, what if those people, that you already coded in-game, as admins/hosts or whatever, take the host files and host private servers in the end?

Also, if someone says he has a shell server, he'll need to upload it, and you won't be able to check for server's key and if in the end, he lied and he's having some BS laggy server up, you can easily shut it down.
Well, that's a solid point.

Hmmm.... Someone should think of a way to be able to see what servers are up. Impossible feet, but meh. Still a good idea.

I do like your code.
In response to Kidpaddle45
I wonder if using something similiar to this you could write code that only allows servers that have a certain connectivity to host your games (like prevent people with lagging servers from hosting)
I'd definitely use something like that.

The snippet you posted is pretty useful too though thanks.
Of course it can, and that's the actual reason I posted this snippet, you can shut down any server that you don't like...Even if the host doesn't want to.
In response to Kidpaddle45
Kidpaddle45 wrote:
Of course it can, and that's the actual reason I posted this snippet, you can shut down any server that you don't like...Even if the host doesn't want to.

But it also requires completely killing your game until you make checks to stop that host from hosting, which is counter productive.

To elaborate, if you change your version suddenly EVERY server will be shut down, and once you upload new host files with the new version suddenly the old host can host again, unless you make it so that he can't hardcoded.

Which begs the question why don't you just keep a list of hosts that aren't allowed to host (Using your BYOND membership storage) and then compare to that, instead of the hub version?

Still, this is an effective way of stopping specific versions of your game from being hosted (Especially useful if said version had a game breaking bug like giving people infinate money or something)

Although this only checks on world/New(), not consistently, meaning shell servers left up won't be touched, you should probably change that.
True. I didn't thought of it that way though. I was more thinking about these people claiming to have "shell servers" just to get host files and leak them/ host private servers.

You can't really know who's going to get your host files if it gets leaked and you can't either make sure the game is only hosted on a shell (at least to my knowledge).

Which means the best thing to do is , in case the host files get leaked to numerous people and you see too much unwanted private servers of your game, simply, change license number and hub version, and bam, they're all down.

Thanks for making me notice about the proc check though.
Any suggestion on where I could make it constantly check? I feel this could be heavy on server if I turn it into a loop.
In response to Kidpaddle45
HostCheck()
//call on world new
spawn(everyfew mins).()


Runs in the background, checks every few mins that you wish it to check- no loop necessary.
In response to Dariuc
Dariuc wrote:
> HostCheck()
> //call on world new
> spawn(everyfew mins).()
>

Runs in the background, checks every few mins that you wish it to check- no loop necessary.

Recursive calls are more CPU intensive and prone to breaking than reiteration, you should just be doing
HostCheck()
set background = 1
while(1)
//stuff
sleep(600)


Plus you forgot to set background = 1 so it'd break anyway.
I feel compelled to post simply because I don't want people thinking that your example somehow prevents people from losing control over their host files.

Your example isn't secure as someone could simply host a dud version of http://www.byond.com/games/Kidpaddle45/ PokemonOnline?format=text on their own webserver, and change the version value to whatever they'd like.
In response to Murrawhip
Could they really do that using THE EXACT same URL? Don't forget we're talking about hosts not having the source.
In response to Murrawhip
Murrawhip wrote:
I feel compelled to post simply because I don't want people thinking that your example somehow prevents people from losing control over their host files.

Your example isn't secure as someone could simply host a dud version of http://www.byond.com/games/Kidpaddle45/ PokemonOnline?format=text on their own webserver, and change the version value to whatever they'd like.

But they'd have to have the exact URL in the source, which is impossible...
In response to Kidpaddle45
Yes. You'd have a webserver set up on the host's PC, change byond.com to point to localhost in hosts, then just make games/Kidpaddle45/PokemonOnline?format=text a text file in their web root.
In response to Murrawhip
Murrawhip wrote:
Yes. You'd have a webserver set up on the host's PC, change byond.com to point to localhost in hosts, then just make games/Kidpaddle45/PokemonOnline?format=text a text file in their web root.

Oh fair enough, that's an incredibly overcomplicated way of spoofing for a BYOND server. In fact there's literally no way of getting around that without hash checks, I guess.
In response to Rushnut
Rushnut wrote:
Oh fair enough, that's an incredibly overcomplicated way of spoofing for a BYOND server.

I've seen it done a good 3-4 times with one of those DBZ games that has a 'allowed hosts' list.
These aren't especially bright people doing it, either.

Edit: I don't think it's complicated at all, actually. All you'd need is a webserver and less than 3 minutes of time.
In response to Murrawhip
Murrawhip wrote:
Yes. You'd have a webserver set up on the host's PC, change byond.com to point to localhost in hosts, then just make games/Kidpaddle45/PokemonOnline?format=text a text file in their web root.

Damn ... I didn't understand a single thing but...
I hope what you're saying isn't something easy to do, I mean, people stealing host files are usually dumb so I'm just hoping this method you just explained isn't something anyone can do easily.
In response to Murrawhip
Murrawhip wrote:
Rushnut wrote:
Oh fair enough, that's an incredibly overcomplicated way of spoofing for a BYOND server.

I've seen it done a good 3-4 times with one of those DBZ games that has a 'allowed hosts' list.
These aren't especially bright people doing it, either.

Edit: I don't think it's complicated at all, actually. All you'd need is a webserver and less than 3 minutes of time.

Actually all you'd need to do to avoid the situation is just not disclose the location of the .txt file with the list of names in it, and use the hide it feature in your member files.
Page: 1 2 3 4