]> jfr.im git - irc/unrealircd/unrealircd-rpc-php.git/commit - lib/Rpc.php
Add $rpc->rpc()->add_timer(); and ->del_timer()
authorBram Matthys <redacted>
Wed, 12 Apr 2023 08:48:27 +0000 (10:48 +0200)
committerBram Matthys <redacted>
Wed, 12 Apr 2023 08:48:27 +0000 (10:48 +0200)
commitbffb11f10883a792db123a6689a994432b62e300
tree8df6f03520accc21e78e6575ea2031a630439fbc
parent1fa5515c7556bd3f8af8ebaad2f5a191bf7b7eaa
Add $rpc->rpc()->add_timer(); and ->del_timer()

Add a timer. Requires UnrealIRCd 6.1.0+
@param timer_id         Name of the timer (so you can .del_timer later)
@param every_msec       Every -this- milliseconds the command must be executed
@param method           The JSON-RPC method to execute (lowlevel name, eg "stats.get")
@param params           Parameters to the JSON-RPC call that will be executed, can be NULL
@param id               Set JSON-RPC id to be used in the timer, leave NULL for auto id.
@return stdClass|array|bool

Example usage would be:
$rpc->rpc()->add_timer("timer", 1000, "stats.get");
lib/Rpc.php