Call Of Duty: PHP Rules Checker 1.5

Utility ke hrám
User avatar
Ashus
Administrátor
Posts: 417
Joined: 07. 07. 2007 10:51
Location: Ostrava - Polanka nad Odrou
Contact:

Call Of Duty: PHP Rules Checker 1.5

Postby Ashus » 08. 07. 2007 16:20

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.

PHP-Rules-Checker.rar
(5.81 KiB) Downloaded 363 times

Changelog (1.5)
Added: Scheduled commands. (thx. for idea goes to leonpadi)
Image
Coffee phreak!
PietroTC
Posts: 3
Joined: 29. 04. 2008 20:07

Re: Call Of Duty 2/4: PHP Rules Checker 1.2

Postby PietroTC » 18. 06. 2008 21:50

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 :P
User avatar
Ashus
Administrátor
Posts: 417
Joined: 07. 07. 2007 10:51
Location: Ostrava - Polanka nad Odrou
Contact:

Re: Call Of Duty 2/4: PHP Rules Checker 1.2

Postby Ashus » 18. 06. 2008 22:22

Hi, PietroTC.

Edit line 184 of rcon-rules.php to:

Code: Select all

	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). :)

Ashus
Image
Coffee phreak!
jurchi
Posts: 1
Joined: 27. 06. 2008 19:07

Re: Call Of Duty 2/4: PHP Rules Checker 1.2

Postby jurchi » 27. 06. 2008 19:12

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 ???? :)
User avatar
Ashus
Administrátor
Posts: 417
Joined: 07. 07. 2007 10:51
Location: Ostrava - Polanka nad Odrou
Contact:

Re: Call Of Duty 2/4: PHP Rules Checker 1.2

Postby Ashus » 27. 06. 2008 19:18

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/viewtop ... f=2&t=7650)
Image
Coffee phreak!
rbjordy
Posts: 11
Joined: 21. 04. 2008 22:36

Re: Call Of Duty 2/4: PHP Rules Checker 1.2

Postby rbjordy » 17. 08. 2008 10:19

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
User avatar
Ashus
Administrátor
Posts: 417
Joined: 07. 07. 2007 10:51
Location: Ostrava - Polanka nad Odrou
Contact:

Re: Call Of Duty 2/4: PHP Rules Checker 1.2

Postby Ashus » 17. 08. 2008 12:19

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
Coffee phreak!
rbjordy
Posts: 11
Joined: 21. 04. 2008 22:36

Re: Call Of Duty 2/4: PHP Rules Checker 1.2

Postby rbjordy » 17. 08. 2008 15:10

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
User avatar
Ashus
Administrátor
Posts: 417
Joined: 07. 07. 2007 10:51
Location: Ostrava - Polanka nad Odrou
Contact:

Re: Call Of Duty 2/4: PHP Rules Checker 1.2

Postby Ashus » 17. 08. 2008 15:14

* * * * * 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
Coffee phreak!
rbjordy
Posts: 11
Joined: 21. 04. 2008 22:36

Re: Call Of Duty 2/4: PHP Rules Checker 1.2

Postby rbjordy » 17. 08. 2008 15:16

when doing php-v I receive the following output:

Code: Select all

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 ;))

Who is online

Users browsing this forum: No registered users and 1 guest

cron