ID:137444
 
Is there a way to block a user? ...namely those you try to hack the system.
block a user:
from a game?
or from pager?
In response to FIREking
From a game...
In response to CableMonkey
Not unless the game maker has the person banned.
In response to Nadrew
heh...I doubt SilkWizard would do that.
In response to CableMonkey
Make some banning code, if you want to have a boot code, ill show you that

mob
verb
Boot(mob/M as mob in world)
del(M)

that will boot someone out of the game, and delete their connection

for banning, you will have to save a list of people you dont allow in the game, then when someone logs in, check to see if they are on the list.

proc/SaveBan(mob/M as mob)
var/savefile/F = new("Banned.sav")
F[""] << M.key
proc/CheckPerson(mob/M as mob)
var/savefile/F = new("Banned.sav")
var/check
F[""] >> check
if(M.key == check)
del(M)
return 1
else
return 0

now on login, you would do something like

mob
Login()
CheckPerson(src)
//other code here

note that this isnt tested.

to ban someone, just do the following,

mob
GM
verb
Ban(mob/M as mob in world)
SaveBan(M)
Boot(M)
Boot(mob/M as mob in world)
del(M)

i also added it so you can check it with an if statement if you would like

mob
Login()
if(CheckPerson(src)==0)
src << "You are not banned!"
else
src << "You are banned!"

im sure that the else will never happen, since the mob will be deleted before hand, but i havent tested it.

remember, none of the code is tested, but in theory it should work.

FIREking
In response to FIREking
ok...you went a little futher than where I was...I'm just hosting a game someone else made. But I have now gathered that it is impossible unless you set up a firewall to block that person's IP.

Thanks for your help anyway.
In response to CableMonkey
CableMonkey wrote:
ok...you went a little futher than where I was...I'm just hosting a game someone else made. But I have now gathered that it is impossible unless you set up a firewall to block that person's IP.

You can check players' IPs with client.address and block them that way if you wish. The trouble is that a person might not have the same IP each time he signs on.

Z

There is a configuration file where you can list the people you want to ban. It currently does not support IP banning, only BYOND Key banning.

Anyway, it's cfg/keyban.txt. The format is something like this:

Dan
Tom


We will be adding an interface for this in the future.

NOTE: in Linux, the configu files are in ~/.byond/cfg/ and in Windows they are in Byond/users/you/cfg/.

--Dan