I need this Key banning code edited to ban IP addresses.
proc/BanGuy(mob/M as mob)
var/savefile/F = new("Bans.sav")
F["[M.key]"] << M.key
proc/CheckBan(mob/M as mob)
var/savefile/F = new("Bans.sav")
var/checking
F["[M.key]"] >> checking
if(M.key == checking)
M << "You have been banned!"
del(M)
If you dont know how to do it, please dont post, and dont refere me to the online guide or some resource, as normally the stuff isnt what i need.</<>
ID:261816
Aug 9 2003, 1:38 pm
|
|
WTS_Leader wrote:
If you dont know how to do it, please dont post, and dont refere me to the online guide or some resource, as normally the stuff isnt what i need. RaeKwon has a good IP Ban code, so does Crispy :P. Maybe you should try searching the hub first.. -Camaro- |
In response to Airjoe
|
|
i tried changing M.key to M.client.address, but when the game is launched, it blocks unbanned ppl from entering, and causes a runtime error.
|
In response to Camaro
|
|
[link]
There are many things you can do to help yourself with coding, and fix problems: 1) Search the forums. MANY topics have been posted. Chances are you will find what you are looking for. People take their precious time to help you with what has already been helped with. If you are really lucky, people will give you coding. If you pretty lucky, people will tell you how to make a code you need help with. If you're lucky, they will search through the forums and find you a post. If people are in a good mood, they will tell you to look through the forums, which really only happens when topics have been discussed HUNDREDS of times (like the hosting problems) Wow, I never put the hub in that post.... Good one Camaro ;) <-Airjoe-> |
In response to Camaro
|
|
Camaro wrote:
RaeKwon has a good IP Ban code, so does Crispy :P. Maybe you should try searching the hub first.. I said not to refer me, i just want my code i posted edited in a reply to ban the IP address of M without causing errors. |
In response to WTS_Leader
|
|
Once again, people arn't going to give you hot code on a silver platter.
|
In response to Airjoe
|
|
MMMM, hot code....so tasty, yet so fatty and bad for you....
|
In response to Airjoe
|
|
I've tried to be nice about it, I said i dont want to be refered cuz most of time its not what I need, or dont work, I gave the exact code i want, and all im asking is for some 1 to copy whats there, and adapt it to ban IP addresses without causing errors when coming to check the ban on log in.
|
In response to WTS_Leader
|
|
Well then, you're asking too much, because there are several libs/demos on IP banning.
|
In response to Airjoe
|
|
Yea all of which are lengthy codes that confuse me, where as the key ban i want editied to IP ban is small and compact to 6-10 lines, where as the others are 40-80 lines
|
In response to WTS_Leader
|
|
They might be 40-80 lines for a reason.
|
In response to Jon88
|
|
yea but when im adding them to my game which has a good Key banning system which i provided, all i want is that edited to IP ban, to stop the person banned from logging in on a diff key, so 40-80 lines is to much when all i want is 2 procs, 1 to add that users IP to a savefile, and 1 to read that savefile.
|
In response to WTS_Leader
|
|
You can have it add their IP into a global variable, and then search their IP using findtext. Thats very crude coding, but im sure you could understand that over the other lengthy codes.
James |
In response to WTS_Leader
|
|
You can't convert a keyban code to an IP ban code. So what you're asking for is impossible, and I gave you two VERY good ban codes. If you wanted to convert a keyban to an IP ban, you might as well just open up a new DM file and start fresh.
-Camaro- |
In response to Camaro
|
|
Libraries are good source to use. I would look into how to impliment them into your game, it should say how right on the library itself.
James |
In response to WTS_Leader
|
|
Go here: http://developer.byond.com/hub/Crispy/FullBan
Download the library. Then open your project in Dream Maker, scroll down to the "Lib" section on the left pane (with all the files on it), expand it, look for the entry "Crispy.FullBan", and tick the checkbox on it. When you want to ban a player (including IP ban), call: <code>crban_fullban(M)</code> To unban someone (again, including IP banning), call: <code>crban_unban(playerkey)</code> In these examples, M is assumed to be the player you want to ban and playerkey is assumed to be the key name of the player you want to unban. There you go! Complete banning functionality in a mere two lines (minus the verbs themselves, which you already know how to do). |
In response to WTS_Leader
|
|
Honestly if you were able to create a keyban code like that, you shouldn't have too big of a problem creating a IP ban code using client.address. The way that's setup you can easily create make that an IP ban code. Just as Airjoe said.
PS. You really should't be using M.key. You should be using M.ckey. -Camaro- |
In response to Camaro
|
|
Well whats the difference between key and ckey??
|
In response to WTS_Leader
|
|
For example, if someone's key is "Super Man", their ckey is "superman". It just is uncapitalized and the spaces are taken away.
~~Dragon Lord~~ |
<-Airjoe->