automatic !stats into battleroom at end of game?

automatic !stats into battleroom at end of game?

SpringRTS Perl Autohost for Dedicated Server

Moderators: Moderators, Lobby Developers, SPADS AutoHost

Post Reply
User avatar
ThinkSome
Posts: 387
Joined: 14 Jun 2015, 13:36

automatic !stats into battleroom at end of game?

Post by ThinkSome »

Is there a quick way to do this or would it involve a plug-in? I guess the spads.pl/hstats subroutine could not be used directly due to the SayPrivate call. Should it not use answer() instead?
User avatar
Jools
XTA Developer
Posts: 2816
Joined: 23 Feb 2009, 16:29

Re: automatic !stats into battleroom at end of game?

Post by Jools »

Would be easy to achieve with a plugin. IIRC it's called sayBattle or something like that.
User avatar
bibim
Lobby Developer
Posts: 952
Joined: 06 Dec 2007, 11:12

Re: automatic !stats into battleroom at end of game?

Post by bibim »

The hStats subroutine doesn't use answer() because it would be too easy to flood the battleroom with a few !stats commands (so that the antiflood protection wouldn't be effective). Basically only commands which generate small output use answer().

The easiest way to do what you want is indeed to create a plugin starting from the simple plugin template and implement the onGameEnd callback by copy pasting the relevant parts of the hStats subroutine code (and replacing the sayPrivate call by a sayBattle call).

I could isolate the stats output generating code into a new subroutine if you want, so that you can re-use the code in a plugin without duplicating it.
User avatar
ThinkSome
Posts: 387
Joined: 14 Jun 2015, 13:36

Re: automatic !stats into battleroom at end of game?

Post by ThinkSome »

Could the flood happen together with the awards printout? It would be appropriate there. Similarly, issuing !stats could output both the stats and awards into PM.
Post Reply

Return to “SPADS AutoHost”