Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Not auto reloading #7

Open
RenaKunisaki opened this issue Apr 4, 2019 · 6 comments
Open

Not auto reloading #7

RenaKunisaki opened this issue Apr 4, 2019 · 6 comments

Comments

@RenaKunisaki
Copy link

I've been able to build and use the mod from source on Linux, but the game doesn't reload it. I have to exit and restart the game every time I make a change. Any ideas?

@Rychard
Copy link
Owner

Rychard commented Apr 5, 2019

I've always compiled the assembly from Visual Studio and relied on a post-build script in the project to deploy the assemblies to the mod directory. This script however, is unique to Windows.

I believe you can press F7 in-game to view the debug panel, which should show the log messages from the server as it is initialized/released. I'd be interested in knowing if changes to the source files are actually triggering the game to take any action, such as even stopping/starting the server.

@MrSlurp
Copy link

MrSlurp commented Apr 5, 2019

I think the C# assembly is probably not being reloaded unless the game is restarted (like if plugins were initialized only once at application load time, which make sense from a software implementation point of view), but all web resources (css/html/js) could be changed and reloaded as the user/developer want.
However it's been a long time I did not touch mod code, and I might be wrong regarding assembly load mechanism.

@RenaKunisaki
Copy link
Author

The logs suggest the server isn't being stopped/restarted at all.

@RenaKunisaki
Copy link
Author

Well, I found that I can use FileSystemWatcher to know when my DLL gets replaced, and PluginManager.instance.ForcePluginsChanged() to force a reload. But it doesn't actually reload the file, just stops and starts the plugins, so the server restarts but is still using the old version. (Also, some mods throw errors and/or crash the game when doing this...)

Any idea the correct way to reload a plugin from disk? Ideally without forcing reload of all other plugins?

No idea why the game doesn't do it automatically. Maybe it's just not supported on Linux for some reason.

@MrSlurp
Copy link

MrSlurp commented Apr 10, 2019

I did some reserch and it seems the there is some mod config per-requisites to allow live reload.
Page 6 of https://buildmedia.readthedocs.org/media/pdf/citiesskylinesmoddingguide/latest/citiesskylinesmoddingguide.pdf
"
To make the game reload your mod while running, change the last two lines in AssemblyInfo.cs to read:[assembly: AssemblyVersion("1.0.*")]
"

@RenaKunisaki
Copy link
Author

Right, I've done that, still no effect. I tried changing to "2.0.*" as well.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants