Save announcement message not showing
P4R4NORM4L
When does the plugin know when the server saves? I have a scheduled a command in RustAdmin every 5 minutes and the message does not popup? I also have autosave in the server configuration set to 300 seconds (saveinterval="300" # Auto-save in seconds)? What's going on?
nitkon
Hey P4R4NORM4L,

everytime when the server saves, the plugin get triggerd by the "OnServerSave" event. At this point the plugin generates the message.

However it could be that your server doesn't communicate in the right way to your plugin.
Check your server log if it prompts you any error message. "oxide/logs/oxide_2019-11-09.txt"

I run SaveAnnouncer on 2 servers, one server without any issues.

The other server prompts me this message in the server log:
(00:33:51) | [Save Announcer] Server is saving 34,079 entities.
00:33:51) | Failed to call hook 'OnServerSave' on plugin 'SaveAnnouncer v1.0.4' (FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.)
at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x000ff] in :0
at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00023] in :0
at System.String.Format (System.String format, System.Object[] args) [0x00020] in :0
at Oxide.Plugins.SaveAnnouncer.Lang (System.String key, System.String id, System.Object[] args) [0x0000e] in <30d5aba72e2d4618a3382bffad019455>:0
at Oxide.Plugins.SaveAnnouncer.constructMsg () [0x00041] in <30d5aba72e2d4618a3382bffad019455>:0
at Oxide.Plugins.SaveAnnouncer.OnServerSave () [0x00089] in <30d5aba72e2d4618a3382bffad019455>:0
at Oxide.Plugins.SaveAnnouncer.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x002ec] in <30d5aba72e2d4618a3382bffad019455>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0
(00:33:51) | Saved 25,172 ents, cache(0.02), write(0.02), disk(0.00).
(00:33:51) | Saving complete​

bst rgds
NITKON
Wulf
uMod Admin
nitkon
Hey P4R4NORM4L,

everytime when the server saves, the plugin get triggerd by the "OnServerSave" event. At this point the plugin generates the message.

However it could be that your server doesn't communicate in the right way to your plugin.
Check your server log if it prompts you any error message. "oxide/logs/oxide_2019-11-09.txt"

I run SaveAnnouncer on 2 servers, one server without any issues.

The other server prompts me this message in the server log:
(00:33:51) | [Save Announcer] Server is saving 34,079 entities.
00:33:51) | Failed to call hook 'OnServerSave' on plugin 'SaveAnnouncer v1.0.4' (FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.)
at System.Text.StringBuilder.AppendFormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x000ff] in :0
at System.String.FormatHelper (System.IFormatProvider provider, System.String format, System.ParamsArray args) [0x00023] in :0
at System.String.Format (System.String format, System.Object[] args) [0x00020] in :0
at Oxide.Plugins.SaveAnnouncer.Lang (System.String key, System.String id, System.Object[] args) [0x0000e] in <30d5aba72e2d4618a3382bffad019455>:0
at Oxide.Plugins.SaveAnnouncer.constructMsg () [0x00041] in <30d5aba72e2d4618a3382bffad019455>:0
at Oxide.Plugins.SaveAnnouncer.OnServerSave () [0x00089] in <30d5aba72e2d4618a3382bffad019455>:0
at Oxide.Plugins.SaveAnnouncer.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x002ec] in <30d5aba72e2d4618a3382bffad019455>:0
at Oxide.Plugins.CSharpPlugin.InvokeMethod (Oxide.Core.Plugins.HookMethod method, System.Object[] args) [0x00079] in <9affce1cd15c4ec183941adef8db1722>:0
at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x000d8] in <4452f821def6406d834e4149849fe7ea>:0
at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00060] in <4452f821def6406d834e4149849fe7ea>:0
(00:33:51) | Saved 25,172 ents, cache(0.02), write(0.02), disk(0.00).
(00:33:51) | Saving complete​

bst rgds
NITKON

Looks like your oxide/lang for the plugin is invalid and may need to be fixed on your end.

nitkon
The plugin runs on both servers with the default config.
I didn't change anything in the plugin.
Wulf
uMod Admin
nitkon
The plugin runs on both servers with the default config.
I didn't change anything in the plugin.

Could you paste your oxide/lang/en/SaveAnnouncer.json here please?

P4R4NORM4L
Original Poster
Oh boy have I ever changed stuff around since this post. I now have a script that does all this for me no plugin needed.