Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Call Of Duty: PHP Rules Checker 1.5
#1

Requirements: Apache webserver with PHP5 support.

This script guards keeping the rules you may have set. It is designed to be run via crontab. Each minute it parses "rcon status".

Functions:
1) If you choose, it can warn and then kick players with no nick (or Unknown Soldiers) - for those, who like neat statistics.

2) Next, it guards ping. Eg. the default settings does this: if a player has ping over 250, he gets warned. If his ping gets over 300 in next minute, he gets warned again and kicked. If it doesn't exceed 300, he gets warned again, or if the ping is lower than 250, the warning is cancelled.

3) Current time is announced by console to all players everytime minute digit matches preset. Once an hour, half an hour, etc. This might make your players more aware of reality and they could change more often one with another on your server.

4) IP logging feature. If enabled, players and their IP addresses are logged. You can keep track of players from the same IP and also you can ban bad guys, who try to steal admins' nicknames.

5) Gametype change on low number of present players. Let's say the vote ends up in SD and all players go away, maybe two or three remain. The game can be set to automatically change the gametype to DM if not playing already.

6) Scheduler. You can plan executing a command or more if current hour and minute match your preset - scheduled commands can include anything including exec of another config file. Maybe you could use it to disable a map or two in your vote system.


.rar PHP-Rules-Checker.rar Size: 5,81 KB  Downloads: 1 134



Changelog (1.5)
Added: Scheduled commands. (thx. for idea goes to leonpadi)

[Image: kavove-zrnka-lajna.jpg]
Coffee phreak!
Reply
#2

Nice tool !!
Can you add another fuctions to warn and then kick players with bad word in their nick (or like nick "console" or "ADMIN") ?

Thank You for your reply Tongue
Reply
#3

Hi, PietroTC.

Edit line 184 of rcon-rules.php to:
Code:
    if (($rules_kick_bad_named) && (($i_name == '') || ($i_name == 'Unknown Soldier') || (stripos($i_name, 'console')!==false) || (stripos($i_name, 'admin')!==false) ) && ($i_ping != '-1') && ($i_ping != '999'))

It will prevent anyone from having console or admin anywhere inside his nickname (case insensitive). Smile

Ashus

[Image: kavove-zrnka-lajna.jpg]
Coffee phreak!
Reply
#4

Hello Ashus i don't know how i can chanege my password for my server in call of duty 2....
Can you ansver to me ???? Smile
Reply
#5

Hi, edit these variables in your server's config file:

g_password / Password to join game
sv_private / Private Slot Password
rcon_Password / Remote console password

(from http://www.codjumper.com/forums/viewtopi...f=2&t=7650)

[Image: kavove-zrnka-lajna.jpg]
Coffee phreak!
Reply
#6

Hey Ashus,

I have a Dedicated server where I run some CoD2/CoD4 servers on.
I would really like to use you Rules Checker, but I have no idea to set it up.
The readme file is not clear to me.

Can you please give some extra information on how to install.

Thanks in advance.

Jordy
Reply
#7

rbjordy:
Download the archive. Extract the file rcon-rules.php from it. Upload it somewhere to your gameserver, into a directory you can write to (so must the user, which runs the script). Then edit it, fill your rcon IP/port/password.

If it is a linux server, just edit the file /etc/crontab , if it is a windows one, install the nnCron utility first. Then open the crontab file for editing from your start menu.
At the end of the file, add one line to ensure, this script will run each minute of each hour of each day. If you have the CLI PHP version installed as well, and you can use the command php directly from command line, you can use something like this on Linux:
* * * * * root php /var/www/cod2/rcon-rules.php > /dev/null 2>&1 &
or
* * * * * php c:\docs\www\cod2\rcon-rules.php
on Windows.

You should be done, other scripts are used just to display the list of kicked users on your webpage or to log their IPs.

[Image: kavove-zrnka-lajna.jpg]
Coffee phreak!
Reply
#8

Ashus thnx for your fast reply!

I have one question though, I have a linux server so I need to add this string in the crontab file right?
* * * * * root php /var/www/cod2/rcon-rules.php > /dev/null 2>&1 &
but with section do I need to change? the www section?
the rcon_rules.php is in the following folder: /home/game1/rules

regards,

Jordy
Reply
#9

* * * * * root php /home/game1/rules/rcon-rules.php > /dev/null 2>&1 &

This should work for you. You can run the command php -v to verify that you have the CLI php installed.

[Image: kavove-zrnka-lajna.jpg]
Coffee phreak!
Reply
#10

when doing php-v I receive the following output:

Code:
php -v
PHP 5.2.0-8+etch11 (cli) (built: May 10 2008 10:46:24)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2006 Zend Technologies
    with the ionCube PHP Loader v3.1.32, Copyright (c) 2002-2007, by ionCube Ltd., and
    with Zend Extension Manager v1.2.2, Copyright (c) 2003-2007, by Zend Technologies
    with Zend Optimizer v3.3.3, Copyright (c) 1998-2007, by Zend Technologies

what is the best command to add the line in the crontab file? (I'm not a Linux guru Wink)
Reply




Users browsing this thread: 7 Guest(s)