AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Plugins (https://forums.alliedmods.net/forumdisplay.php?f=108)
-   -   [DEV] Autoreload plugins (https://forums.alliedmods.net/showthread.php?t=322045)

Dragokas 04-01-2020 10:30

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:

Plugin status code before reload: X

CrazyGhostRider 04-01-2020 16:17

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

Dragokas 04-01-2020 17:28

Re: [DEV] Plugin reload
 
Windows?

Is everything OK when you do same tests using root folder "plugins" (without "test" subfolder) ?

CrazyGhostRider 04-01-2020 17:40

Re: [DEV] Plugin reload
 
Windows

Without without the "test" subfolder, everything works.
The game chat also shows the status correctly.

Dragokas 04-01-2020 18:35

Re: [DEV] Plugin reload
 
Updated.

Quote:

1.9 (02-Apr-2020)
- Fixed Windows support. Reloader incorrectly selected load action type, because FindPluginByFile() can't normalize linux path separator (thanks to CrazyGhostRider for report).
- Plugin list is being updated now with newly added plugins on each map start (even if sm_autoreload_track_new == 0).
- Plugin reloading is blocked between map end and map start (for safe).

Dragokas 10-04-2020 18:55

Re: [DEV] Plugin reload
 
Cosmetic change.
Quote:

1.10 (05-Oct-2020)
- Fixed: not hooked dynamic change of "sm_autoreload_error_lines" ConVar.

Dragokas 04-16-2021 14:15

Re: [DEV] Autoreload plugins
 
Updated.

Quote:

1.11 (16-Apr-2021)
- Added TIMER_FLAG_NO_MAPCHANGE to prevent accidentally plugin double reload on map change.
- Added forwards (thanks to Silvers for request):

* AP_OnPluginUpdate - called when plugin list update sequence is about to start (or ended) - see the "pre" argument to determine.
> This happens when 1 or more plugins are to be planned for loading/reloading/unloading.
> Example: when 10 plugins are changed simultaneously, this forward is called 2 times: 1 - very first before all other forward, then 2 - it is called as last, after all other forwards.
* AP_OnPluginLoad - called before and after plugin is loaded (no matter successfully or not - see the "pre" and "status" arguments for details).
> This happens when plugin wasn't loaded yet, or its previous loading failed.
* AP_OnPluginReload - called before and after plugin is reloaded (no matter successfully or not - see the "pre" and "status" arguments for details).
> This happens when plugin is already loaded at the moment.
* AP_OnPluginUnload
> This happens when plugin is removed, moved or renamed from its initial location.
* Notice 1: You can prevent plugins from load/reload/unload by returning Plugin_Stop in forward (it is only applicable for actions done directly by this plugin).
* Notice 2: these forwards doesn't report about actions made by other plugins including sourcemod itself, like:
> when you manually load/reload/unload plugin via console;
> when SM load/reload/unload plugin between OnMapEnd and OnMapStart events.

About forwards:

- See details in scripting/include/autoreload.inc
- See examples in scripting/include/test_forwards.sp

Dragokas 06-30-2021 22:01

Re: [DEV] Autoreload plugins
 
Updated.

Quote:

1.13 (01-July-2021)
- Added command "sm_pluginsreload" - to force checking plugin files for newly updated (by SilverShot request).
- Added new allowed value "0" for "sm_autoreload_delay" ConVar - to disable checking plugins update by timer at all.

1.12 (09-May-2021)
- Little safe check to prevent error if < 4 character length filename for some reason is located at plugins folder.
Note: To update from the old version and be able to use new features, a server reboot is required.

ChrisP 11-02-2021 16:49

Re: [DEV] Autoreload plugins
 
This plugin saves me so much time. Thank you Timiditas and Dragokas!

Dragokas 11-27-2021 03:17

Re: [DEV] Autoreload plugins
 
Updated.

Quote:

1.14 (27-Nov-2021)
- Potential fix for rare crash, caused by file system error.
- Improved DEBUG version in attempt to track the rare case with server crash caused by false positive time stamp change detection for all plugins at once.


All times are GMT -4. The time now is 22:16.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.