Server config: sending clients periodic messages

Locked
Goop
Posts: 7
Joined: Wed Mar 11, 2009 8:16 pm

Server config: sending clients periodic messages

Post 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.
missbehaving
Posts: 25
Joined: Mon Mar 09, 2009 9:15 pm

Re: Server config: sending clients periodic messages

Post 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
Goop
Posts: 7
Joined: Wed Mar 11, 2009 8:16 pm

Re: Server config: sending clients periodic messages

Post by Goop »

Thanks for the info, these apps should be listed in the sticky post.
missbehaving
Posts: 25
Joined: Mon Mar 09, 2009 9:15 pm

Re: Server config: sending clients periodic messages

Post 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
Locked