Plugin commands are not sent on Linux.

Started by ., Jul 10, 2016, 04:23 PM

Previous topic - Next topic

.

I've encountered this issue recently. Where plugin commands are not send on Linux. Which means that their API is not registered with my host Squirrel plugin.

It's as if I'm not even sending that command:


How it looks on windows:


The commands are executed during the OnServerInitialise callback when all plugins have been loaded. There's a command executed before that (also ignored) which tells the other plugins to retrieve the Squirrel API and check if they're compatible with the host plugin. And then the one which tells the other plugins to register their API into the obtained Squirrel virtual machine.

Am I doing something wrong? If I remember correctly, the official plugin uses the same mechanism. Except I haven't tested there to be sure since their source is private after the last SDK update.
.

.

@Stormeus can you guys at least make the official modules source available so I can test for my self? The one's after the SDK update.
.

Thijn

Quote from: . on Jul 10, 2016, 07:15 PM@Stormeus can you guys at least make the official modules source available so I can test for my self? The one's after the SDK update.
I've been asking for those since the release, so far no update...

EK.IceFlake


.

#4
Also, before I forget. I tried to work around this issue and I think I've encountered something that is either an issue or a mistake on my part.

So I have the host plugin which is loaded before all other plugins. Then in the modules, within the plugin entry point `VcmpPluginInit` I looked for the host plugin with `FindPlugin()` (which was loaded already) after which I proceed to validating the returned identifier. After which I attempt to obtain the host plugin info with `GetPluginInfo()` because I used the lower half of the plugin version integer to store the version of the API that the modules work with `((plugin_version & 0xFFFF) << 16) | (api_version & 0xFFFF) `. However, the server would crash if I used `GetPluginInfo()` during the `VcmpPluginInit` stage. I haven't went any further with testing and confirming this but the code seemed to be alright. After all, I'm just calling a function with a plugin identifier properly validated.

Not sure if related to the issue mentioned in this topic but I just wanted to report it in case someone looks over the code anyway.
.

Stormeus

@.

Quote from: . on Jul 10, 2016, 04:23 PMI've encountered this issue recently. Where plugin commands are not send on Linux. Which means that their API is not registered with my host Squirrel plugin.

Cannot reproduce using a minimal pair of test plugins.

https://mega.nz/#!RRkRiADS!u6aeqk4FQDA6wbtMuH8UyNDPHE7HoviCinsdoAcGPro



Quote from: . on Jul 10, 2016, 07:15 PMcan you guys at least make the official modules source available so I can test for my self? The one's after the SDK update.

Believe it or not, I have no idea what @maxorator did with the source code for any of the plugins other than Squirrel. I don't see them in Bitbucket or on the build server. I'll probably just have to port things over again.

Quote from: . on Jul 14, 2016, 02:42 PMSo I have the host plugin which is loaded before all other plugins. Then in the modules, within the plugin entry point `VcmpPluginInit` I looked for the host plugin with `FindPlugin()` (which was loaded already) after which I proceed to validating the returned identifier. After which I attempt to obtain the host plugin info with `GetPluginInfo()` because I used the lower half of the plugin version integer to store the version of the API that the modules work with `((plugin_version & 0xFFFF) << 16) | (api_version & 0xFFFF) `. However, the server would crash if I used `GetPluginInfo()` during the `VcmpPluginInit` stage.

That's because you've done performed an illegal operation in the API. The server makes no promises that any plugin functions will be callable until OnServerInitialise is invoked. You're only allowed to populate the PluginInfo and PluginCallbacks fields.

.

Quote from: Stormeus on Jul 14, 2016, 04:36 PMThat's because you've done performed an illegal operation in the API. The server makes no promises that any plugin functions will be callable until OnServerInitialise is invoked. You're only allowed to populate the PluginInfo and PluginCallbacks fields.

Oh I see. However, `FindPlugin()` worked. I'm guessing that only critical functions were assigned. Never mind then.

As for the main issue of the topic. I'll try to replicate with a simple plugin or something. And see if I can provide more info about the issue.
.

.

Solved. Apparently, there was a name collision or something because the function that was supposed to bind the callbacks was not being called at all. Now I've moved the code for binding and unbinding from the server callbacks, directly into `VcmpPluginInit()` and `OnServerShutdown()` respectively. Which works as expected.

Sorry for the annoyance. Topic locked.
.