Page 1 of 1

Server config: sending clients periodic messages

Posted: Thu Mar 12, 2009 9:54 pm
by Goop
I'm setting up an InstaUnlagged server, and I wanted to do something I've seen done on other servers.

I would like to periodically broadcast a few messages to all connected users every 5-10 minutes or so (notifying users about the stats website, scheduled downtime etc.)

Any help with this is appreciated.

Re: Server config: sending clients periodic messages

Posted: Thu Mar 12, 2009 10:09 pm
by missbehaving
You could do this with a remote rcon program if you have full server access.

My friend has a program here 'qcon' which can be run from the command line
http://ilovefps.y7.ath.cx/?q=qscore


I use a php based one which my admins helped me integrate displaying the top scores in game periodically using vsp stats...
http://www.scivox.net/smf/index.php?top ... 92#msg6892

If you simply want to say a message via a php script you could do...

i think this is right :D

Code: Select all

<?
//settings
$rconpass = "RCONPASS";
$port = "PORTNO";

// Script to send the message to the console
$start = "\xff\xff\xff\xffrcon " . $rconpass . " ";
$fp = fsockopen("udp://127.0.0.1", $port, $errno, $errstr, 10);
// Error checking
if (!$fp) {
echo "$errstr ($errno)<br />\n";
} else { stream_set_timeout($fp, 2); // SET LOW TIMEOUT

// Send commands
fputs($fp, $start . "say \"put stuff here\"\n");
   fclose($fp);
}

sleep(2);
?>
There is also a great little program called hennimation which can be useful for additional stuff
http://www.q3eu.com/site/modules.php?na ... it&lid=437

Re: Server config: sending clients periodic messages

Posted: Fri Mar 13, 2009 3:49 am
by Goop
Thanks for the info, these apps should be listed in the sticky post.

Re: Server config: sending clients periodic messages

Posted: Fri Mar 13, 2009 12:18 pm
by missbehaving
There is also a web script here which gives an rcon web based control panel

http://planetozh.com/download/webrcon.txt

I know there's more advanced ones around but you could modify it and execute it periodically by various methods such as wget/cron etc.

I made it into a nuke block a while back but never finished it.

Image