SEModCommunity / SE-Community-Mod-API

Space Engineers Community Modding API
GNU Lesser General Public License v3.0
60 stars 47 forks source link

BUG: Plugin not loading without refresh. Update() not being called after a few hours. #96

Closed Tyrsis closed 10 years ago

Tyrsis commented 10 years ago

A) I have a strange bug in that my plugin doesn't get detected most of the time without hitting the refresh button. It looks like it's scanning for plugins before the game world is up completely. If I hit refresh the plugin initializes / works just fine.

B) After the world has been up for many hours (lots of traffic on the server, usually 10+ players), basically all the plugin events stop getting triggered. Update() isn't being hit, and the OnChatReceived event isn't being hit. I've looked through the logs and no exceptions are generated. In the SEModAPIInternal.log, it will list this:

2014-08-06 09:25:05.886 - Thread: 16 -> PluginManager - Update interval = 106.575185396181ms 2014-08-06 09:25:05.886 - Thread: 16 -> PluginManager - Update time = 6.47753539618077ms 2014-08-06 09:25:05.886 - Thread: 16 -> PluginManager - Events per update = 154.032312405375

When the above is shown in the log the plugin is working fine. But after a few hours the above stops appearing, and the plugin stops receiving updates and onchatreceived events. I know it's a bit vague, but there is no more debug information in logs that I can see.

Tyrsis commented 10 years ago

Update on A) This only appears to happen when autostart is specified.

Tyrsis commented 10 years ago

LoadPlugins is not working with autostart. This is the problem: SandboxGameAssemblyWrapper.Instance.InitMyFileSystem(instanceName); string modsPath = MyFileSystem.ModsPath;

modsPath is incorrect when called due to autostart, so no plugins are being found. LoadPlugins does work when you refresh plugins though.

Tyrsis commented 10 years ago

This can be fixed if LoadPlugins is in PluginManagerMain just before the plugin init. (after ensuring game is started).

The other issue now is that if there is a gui, it's not properly selecting the instance specified in the command line, and plugin refresh is trying to load mods in the wrong directory (the instance selected in the combo box and not the command line. a quick fix would just be setting the combo box text to the command line instance)

chessmaster42 commented 10 years ago

Please retest on the latest release build and let us know if this is still an issue.

Tyrsis commented 10 years ago

A) is fixed in my situation, but nogui has pathing issues still with plugins. (I tried nogui on my live server, and had to restart because plugins didn't load and there was no way to refresh).

B) I haven't seen this issue in awhile, so I'm going to assume it's not there anymore.

chessmaster42 commented 10 years ago

Please test with the latest dev build and let us know if it's any better. A number of things were fixed relating to path detection that should help with plugin loading.

chessmaster42 commented 10 years ago

As there has been no response in over a week I am closing this issue.