Plugin API: addStartScriptTags usage?

Plugin API: addStartScriptTags usage?

SpringRTS Perl Autohost for Dedicated Server

Moderators: Moderators, Lobby Developers, SPADS AutoHost

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

Plugin API: addStartScriptTags usage?

Post by Jools »

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/ line 46.
References: ... -callbacks


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”