How to ban a dynamic ip?
yikes! what a thread
while you're at it, since yer using perl, just make an external file with a list of "bad words" and load 'em into a hash or something, you can put variable values directly into regular expressions.
or was that already discusses ?:P
would it lag the server if you had a script constantly checking through every line of chat text? or is the load pretty insignificant...
while you're at it, since yer using perl, just make an external file with a list of "bad words" and load 'em into a hash or something, you can put variable values directly into regular expressions.
or was that already discusses ?:P
would it lag the server if you had a script constantly checking through every line of chat text? or is the load pretty insignificant...
Okay, so I spent a few hours thinking about that tail thing that was posted a LONG time ago on this thread.
What I did is: there are two files, a "talk_in" file and a "talk_out" file. The dedicated server is run via. that wonderful tail command given earlier (I have to use just tail -f, for some reason tail -fn0 doesn't work well). Then I wrote a little perl script that will talk to the server via the talk_in file, and will read server information via. the talk_out file. So it's a sort of "hook" that hooks into a running server that's executed with this tail dealy, so you can communicate with it as it's running.
This can be modified to do stuff like monitor IP's and language and whatnot. It comes with a tail routine that isn't based on the perl Tail module. Since I'm only dealing with whole lines it does this:
the first time it opens the file-to-be-tailed it just counts the number of lines, stores that number and closes the file. Then it periodically opens the file again and checks to see if there are any new lines, if there are, they will be displayed to the console. You can set a delay so the file isn't constantly opened, but the delay number is just the size of a for loop because I figured seconds were too long and i didn't want to get into hi-res time.
Anyway, I just got done testing it and it works pretty well...
I'd like to put in a lock so that you can't run more than one of these at a time on the same files, but I'll deal with that later.
All you need to do is put the two attached files in the same folder as the dedicated server executable. Then make two blank files "talk_in.txt" and "talk_out.txt" then run the dedicated server via the tail command, which is included as a bash script in this email to feed IO through those two txt files. Then do "perl ArmaHook.pl".
Armahook fires up two threads, one called "runliner", which handles STDIN and another called "tailer" which tails the "talk_out.txt" file (your server output).
you can send commands to the server by prefixing them with a slash /,
so /center_message poopyface will center_message the word poopyface.
Then you can talk to the tailer thread too, type "tailer help" to get a brief list of commands for it. It starts out in the "off" mode, so you have to turn it on with "tailer on" to see any of the server output.
It was a quick little ditty so please, don't bash my poor little child
thoughtful comments are welcome tho.
hmm, forum won't let me attach .sh or .pl files, so I'm going to archive this on a mac. Hopefully anyone who wants to see it will be able to unpack it.
What I did is: there are two files, a "talk_in" file and a "talk_out" file. The dedicated server is run via. that wonderful tail command given earlier (I have to use just tail -f, for some reason tail -fn0 doesn't work well). Then I wrote a little perl script that will talk to the server via the talk_in file, and will read server information via. the talk_out file. So it's a sort of "hook" that hooks into a running server that's executed with this tail dealy, so you can communicate with it as it's running.
This can be modified to do stuff like monitor IP's and language and whatnot. It comes with a tail routine that isn't based on the perl Tail module. Since I'm only dealing with whole lines it does this:
the first time it opens the file-to-be-tailed it just counts the number of lines, stores that number and closes the file. Then it periodically opens the file again and checks to see if there are any new lines, if there are, they will be displayed to the console. You can set a delay so the file isn't constantly opened, but the delay number is just the size of a for loop because I figured seconds were too long and i didn't want to get into hi-res time.
Anyway, I just got done testing it and it works pretty well...
I'd like to put in a lock so that you can't run more than one of these at a time on the same files, but I'll deal with that later.
All you need to do is put the two attached files in the same folder as the dedicated server executable. Then make two blank files "talk_in.txt" and "talk_out.txt" then run the dedicated server via the tail command, which is included as a bash script in this email to feed IO through those two txt files. Then do "perl ArmaHook.pl".
Armahook fires up two threads, one called "runliner", which handles STDIN and another called "tailer" which tails the "talk_out.txt" file (your server output).
you can send commands to the server by prefixing them with a slash /,
so /center_message poopyface will center_message the word poopyface.
Then you can talk to the tailer thread too, type "tailer help" to get a brief list of commands for it. It starts out in the "off" mode, so you have to turn it on with "tailer on" to see any of the server output.
It was a quick little ditty so please, don't bash my poor little child
thoughtful comments are welcome tho.
hmm, forum won't let me attach .sh or .pl files, so I'm going to archive this on a mac. Hopefully anyone who wants to see it will be able to unpack it.
- Attachments
-
- ArmaHook.zip
- run_arma.sh is the bash script
- (2.68 KiB) Downloaded 154 times
-
- On Lightcycle Grid
- Posts: 37
- Joined: Tue Jan 08, 2008 1:40 pm
Re: How to ban a dynamic ip?
Long time no news in here
All this thread is very interesting. Thank you for the inspiration.
I'm using screen to run my multiple servers (Fast Track).
Screen is able to make a log, and is able to send commands to the console. So I expected that it would be able to get a script running at each new line in the log (greping on bad words to avoid high overhead) and send a command to ban the user.
Unfortunately, I am unsuccesful in sending a command to the screen window
I used: screen -S session -X command
i.e.
screen -S fightnow -X say Do not swear
but the command is not relayed How could I address this ?
All this thread is very interesting. Thank you for the inspiration.
I'm using screen to run my multiple servers (Fast Track).
Screen is able to make a log, and is able to send commands to the console. So I expected that it would be able to get a script running at each new line in the log (greping on bad words to avoid high overhead) and send a command to ban the user.
Unfortunately, I am unsuccesful in sending a command to the screen window
I used: screen -S session -X command
i.e.
screen -S fightnow -X say Do not swear
but the command is not relayed How could I address this ?
Re: How to ban a dynamic ip?
The -X command does not work like you think it does. It sends screen commands, not direct input. Change it to
and it should work. The quotes and embedded newline are important, I found no less convoluted way of sending the newline to the screen session.
Code: Select all
screen -S fightnow -X stuff "say Do not swear
"
-
- On Lightcycle Grid
- Posts: 37
- Joined: Tue Jan 08, 2008 1:40 pm
Re: How to ban a dynamic ip?
Works perfectly Tx a lot.
For the carriage return, CTRL-V then ENTER
It gives a litteral ^M which is correctly interpreted.
I will post my script as soon as I've made it.
For the carriage return, CTRL-V then ENTER
It gives a litteral ^M which is correctly interpreted.
I will post my script as soon as I've made it.
- Infa(mous)
- Round Winner
- Posts: 255
- Joined: Thu Aug 14, 2008 11:27 pm
Re: How to ban a dynamic ip?
With the whole censoring thing, should the list be some type of xml?
The sort of thing I was thinking is attached. Just not sure if it would really be terribly useful.
The sort of thing I was thinking is attached. Just not sure if it would really be terribly useful.
- Attachments
-
- censor.aalist.xml
- A sort of censorlist thingy...
- (7.64 KiB) Downloaded 81 times
-Infamous
- -=VcL.Rajinn
- Round Winner
- Posts: 242
- Joined: Fri Aug 29, 2008 9:35 pm
Re: How to ban a dynamic ip?
I would like it if Arma did have a way of range banning an IP using the wildcard characters.
Plausible?
Plausible?
-
- Adjust Outside Corner Grinder
- Posts: 2003
- Joined: Tue Nov 07, 2006 6:02 pm
- Location: paris
- Contact:
Re: How to ban a dynamic ip?
Plausible, but busy with more important stuff.