Page 1 of 1

Plugin API: addStartScriptTags usage?

Posted: 21 Jan 2015, 16:27
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/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;