Raised This Month: $12 Target: $400
 3% 

[DEV] Autoreload plugins


Post New Thread Reply   
 
Thread Tools Display Modes
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 04-01-2020 , 10:30   Re: [DEV] Plugin reload
Reply With Quote #11

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
Attached Files
File Type: sp Get Plugin or Get Source (autoreload.sp - 256 views - 14.9 KB)
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
CrazyGhostRider
Member
Join Date: Apr 2014
Location: Russia
Old 04-01-2020 , 16:17   Re: [DEV] Plugin reload
Reply With Quote #12

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

Last edited by CrazyGhostRider; 04-01-2020 at 17:40.
CrazyGhostRider is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 04-01-2020 , 17:28   Re: [DEV] Plugin reload
Reply With Quote #13

Windows?

Is everything OK when you do same tests using root folder "plugins" (without "test" subfolder) ?
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
CrazyGhostRider
Member
Join Date: Apr 2014
Location: Russia
Old 04-01-2020 , 17:40   Re: [DEV] Plugin reload
Reply With Quote #14

Windows

Without without the "test" subfolder, everything works.
The game chat also shows the status correctly.
CrazyGhostRider is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 04-01-2020 , 18:35   Re: [DEV] Plugin reload
Reply With Quote #15

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).
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 04-01-2020 at 19:39.
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 10-04-2020 , 18:55   Re: [DEV] Plugin reload
Reply With Quote #16

Cosmetic change.
Quote:
1.10 (05-Oct-2020)
- Fixed: not hooked dynamic change of "sm_autoreload_error_lines" ConVar.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 04-16-2021 , 14:15   Re: [DEV] Autoreload plugins
Reply With Quote #17

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
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]

Last edited by Dragokas; 04-16-2021 at 14:20.
Dragokas is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 06-30-2021 , 22:01   Re: [DEV] Autoreload plugins
Reply With Quote #18

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.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
ChrisP
Member
Join Date: Jan 2010
Old 11-02-2021 , 16:49   Re: [DEV] Autoreload plugins
Reply With Quote #19

This plugin saves me so much time. Thank you Timiditas and Dragokas!
ChrisP is offline
Dragokas
Veteran Member
Join Date: Nov 2017
Location: Ukraine on fire
Old 11-27-2021 , 03:17   Re: [DEV] Autoreload plugins
Reply With Quote #20

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.
__________________
Expert of CMD/VBS/VB6. Malware analyst. L4D fun (Bloody Witch & FreeZone)
[My plugins] [My tools] [GitHub] [Articles] [HiJackThis+] [Donate]
Dragokas is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 15:59.


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