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: 288
Joined: 14 Jun 2015, 13:36

automatic !stats into battleroom at end of game?

Post by ThinkSome » 09 Dec 2018, 01:49

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?
1 x

User avatar
Jools
XTA Developer
Posts: 2804
Joined: 23 Feb 2009, 16:29

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

Post by Jools » 15 Dec 2018, 17:45

Would be easy to achieve with a plugin. IIRC it's called sayBattle or something like that.
0 x

User avatar
bibim
Lobby Developer
Posts: 901
Joined: 06 Dec 2007, 11:12

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

Post by bibim » 15 Dec 2018, 23:15

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.
0 x

User avatar
ThinkSome
Posts: 288
Joined: 14 Jun 2015, 13:36

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

Post by ThinkSome » 16 Dec 2018, 02:50

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.
0 x

Post Reply

Return to “SPADS AutoHost”