Plugin API: addStartScriptTags usage?

Plugin API: addStartScriptTags usage?

SpringRTS Perl Autohost for Dedicated Server

Moderators: Moderators, Lobby Developers, SPADS AutoHost

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

Plugin API: addStartScriptTags usage?

Post by Jools » 21 Jan 2015, 16:27

Another question regarding the spads api:

I'm sure it's something stupid I'm doing, but I can't get the customization callin addStartScriptTags(\%additionalData) to work. The callin itself does execute, but it doesn't seem to have access to the additionalData hash.

When I try to add the version from the api to that callin like this:
line 46: $additionalData{"game/modoptions/hiddenoption"}="test
I get an error in spads.log like this:
ERROR - [SPADS] Unable to load plugin module "DayOfYear": Global symbol "$additionalData" requires explicit package name at /home/jools/semprini/var/plugins/DayOfYear.pm line 46.
References:

http://planetspads.free.fr/spads/doc/sp ... -callbacks

Edit:

Here's the solution:

The callback has to be declared like this:
sub addStartScriptTags {
my ($plugin,$p_additionalData)=@_;
And then the value has to be updated like this:
$p_additionalData->{"game/modoptions/year"} = $year;
0 x

Post Reply

Return to “SPADS AutoHost”