[DEV] Autoreload plugins
1 Attachment(s)
Description:
By default, SourceMod reloads plugin on map change only (in case its file modification time is changed).*New features: - Notify in chat about reloading, loading, unloading.Commands: Settings (ConVars): Located at: cfg/sourcemod/sm_autoreload.cfgForwards:
Spoiler
Using: Place smx in "plugins" folder.Credits: - Timiditas - author of idea and original plugin
Full changelog:
// TODO: - Integrity check. - Adding dynamically loaded/unloaded plugins to tracking list. Also, need help in issue #1482. Donate Donates are very appreciated and welcomed for further inspiration, make me happy, and make next updates came out more often: |
Re: [DEV] Plugin reload
good, that will save me one or two seconds on each reaload when I testing my plugins... I gess it will add up to a few minutes =P
|
Re: [DEV] Plugin reload
At last can add new plugins without having to refresh the plugins list (albeit I use sm_refresh but still typing in console when Im not in-game using the keybind I set).
Thanks! |
Re: [DEV] Plugin reload
Thanks!
|
Re: [DEV] Plugin reload
Updated.
Quote:
|
Re: [DEV] Plugin reload
I don't know if it will be a good addition, but I'm used to run the "sm_reload_translations" together with the "sm plugins refresh", to reload the translations file (because some times I have to update both .smx and .phrases file),
So maybe you can include that in the plugin and make a cvar (maybe not necessary) allowing it to reload the translations file (at the end) if some plugin is updated. IMO is just a suggestion to improve it. Thanks for you effort. Nice plugin as always. |
Re: [DEV] Plugin reload
Thanks for suggestion, Marttt! Very useful.
Updated. Quote:
|
Re: [DEV] Plugin reload
You have a mistake. Instead of reloading the updated plugin, the "Loading" of the plugin occurs.
|
Re: [DEV] Plugin reload
Can you show server logs?
|
Re: [DEV] Plugin reload
I replace the file speclist.smx
[AutoReload] test/speclist.smx has changed timestamp. Reloading... [SM] Plugin test\speclist.smx is already loaded. sm plugins reload test/speclist [SM] Plugin Spectator List reloaded successfully. sm_autoreload_delay = 2.0 sm_autoreload_track_new = 1 sm_autoreload_error_lines = 4 P.S. Another error with chat messages if you delete a file. And then add the file again test/speclist2.smx plugin is deleted. Unloading... test/speclist2.smx plugin reloaded. Status: NOT Loaded But in the server console it writes like this: [AutoReload] test/speclist2.smx plugin is deleted. Unloading... [SM] Plugin Spectator List unloaded successfully. [AutoReload] test/speclist2.smx has changed timestamp. Reloading... [SM] Loaded plugin test\speclist2.smx successfully. |
Re: [DEV] Plugin reload
1 Attachment(s)
There is nothing wrong with functionality. Plugin executes both operations "load" and "reload" for plugins with unrecognized statuses.
To beautify server output and prevent one additional superfluous operation, please make the same log using this v.1.8d. You may receive msg like this: Quote:
|
Re: [DEV] Plugin reload
Nothing changed.
Let me show you the example plugin "speclist.smx" The plugin is already loaded on the server. I am throwing a new plugin (with the new sm_test command) Server console: [AutoReload] test/speclist.smx has changed timestamp. Reloading... [SM] Plugin test\speclist.smx is already loaded. In game chat : test/speclist.smx plugin reloaded. Status: NOT Loaded I check the performance: Unknown command "sm_test" I manually restart the plugin: Server console: sm plugins reload test/speclist [SM] Plugin Spectator List reloaded successfully. And only after that the plugin rebooted and the sm_test command started working. And the second error is this: The server is on. Delete the plugin: Server console: [AutoReload] test/speclist.smx plugin is deleted. Unloading... [SM] Plugin Spectator List unloaded successfully. I am returning the plugin Server console: [AutoReload] test/speclist.smx has changed timestamp. Reloading... [SM] Loaded plugin test\speclist.smx successfully. In game chat : test/speclist.smx plugin reloaded. Status: NOT Loaded |
Re: [DEV] Plugin reload
Windows?
Is everything OK when you do same tests using root folder "plugins" (without "test" subfolder) ? |
Re: [DEV] Plugin reload
Windows
Without without the "test" subfolder, everything works. The game chat also shows the status correctly. |
Re: [DEV] Plugin reload
Updated.
Quote:
|
Re: [DEV] Plugin reload
Cosmetic change.
Quote:
|
Re: [DEV] Autoreload plugins
Updated.
Quote:
- See details in scripting/include/autoreload.inc - See examples in scripting/include/test_forwards.sp |
Re: [DEV] Autoreload plugins
Updated.
Quote:
|
Re: [DEV] Autoreload plugins
This plugin saves me so much time. Thank you Timiditas and Dragokas!
|
Re: [DEV] Autoreload plugins
Updated.
Quote:
|
Re: [DEV] Autoreload plugins
Is it possible you can add a custom route of where you want plugins to be detected in a cvar maybe with multiple paths where the plugin can reload other plugins?
example: sm_cvar sm_autoreload_paths "plugins\disabled\boost\c2m1" "plugins\all\" |
Re: [DEV] Autoreload plugins
Plugins are detected by Autoreloader anywhere in /plugins/ (recursively) same as SourceMod do; an exception is /plugins/disabled/ and all its subfolders which aren't loaded. This is default behaviour of SourceMod and I'm going to follow it.
|
Re: [DEV] Autoreload plugins
As about tracking dynamically loaded plugins made by 3rd-party side call (via "sm plugins load"), it's impossible to do until new forward been implemented according to issue #1482. I'm not going to inject low-level hooks directly in sm engine just for such a rarely used feature.
PS. Ahh, well, it is still possible to track them by calculating delta between cached and current plugin list in memory. This will cause consuming more CPU cycles. Maybe I will think about that as an optional feature. Surely, not soon, cos I'm too busy for nearest months. |
Re: [DEV] Autoreload plugins
Updated.
Quote:
|
| All times are GMT -4. The time now is 22:16. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.