How do I make it to where it doesnt affect the server description? I use magicdescription and its putting "Powered by: server.pve: "False"" in my description
RealtimeWipeInfo
Moved
Total Downloads: 1,533 - First Release: May 19, 2017 - Last Update: Mar 16, 2018
- 5/5, 8 likes
-
-
-
Ryan updated RealtimeWipeInfo with a new update entry:
1.0.7
-
[RealtimeWipeInfo] Your title exceeds the suggested amount of chacters! (75 should be 64!)
Failed to call hook 'OnServerInitialized' on plugin 'RealtimeWipeInfo v1.0.7' (FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.)
at System.String.FormatHelper (System.Text.StringBuilder result, IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in :0 at System.String.Format (IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in :0 at System.String.Format (System.String format, System.Object[] args) [0x00000] in :0 at Oxide.Plugins.RealtimeWipeInfo.Lang (System.String key, System.String id, System.Object[] args) [0x00000] in :0 at Oxide.Plugins.RealtimeWipeInfo.FormatDescription () [0x00000] in :0 at Oxide.Plugins.RealtimeWipeInfnServerInitialized () [0x00000] in :0 at Oxide.Plugins.RealtimeWipeInfo.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in :0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in :0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in :0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in :0
-
Have any problem with dercription? Plz see the image. Thx.
Attached Files:
-
-
[DOUBLEPOST=1499451080][/DOUBLEPOST] -
Ryan updated RealtimeWipeInfo with a new update entry:
1.0.8
-
Data in RealtimeWipeInfo.json is outdated by months somehow, and using "Enable Description Refresh": true, produces this:
Code:Loaded plugin RealtimeWipeInfo v1.0.7 by Ryan Failed to call hook 'OnServerInitialized' on plugin 'RealtimeWipeInfo v1.0.7' (FormatException: Index (zero based) must be greater than or equal to zero and less than the size of the argument list.) at System.String.FormatHelper (System.Text.StringBuilder result, IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in :0 at System.String.Format (IFormatProvider provider, System.String format, System.Object[] args) [0x00000] in :0 at System.String.Format (System.String format, System.Object[] args) [0x00000] in :0 at Oxide.Plugins.RealtimeWipeInfo.Lang (System.String key, System.String id, System.Object[] args) [0x00000] in :0 at Oxide.Plugins.RealtimeWipeInfo.FormatDescription () [0x00000] in :0 at Oxide.Plugins.RealtimeWipeInfo.OnServerInitialized () [0x00000] in :0 at Oxide.Plugins.RealtimeWipeInfo.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in :0 at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in :0 at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in :0 at Oxide.Core.Plugins.Plugin.CallHook (System.String hook, System.Object[] args) [0x00000] in :0
-
-
Version 1.0.8 still shows UTC time in title.
-
any way i can add d/M format to the server title
-
-
Have you tested the Phrases functionality recently? I uncommented the IsAdmin checks and played with it a bit... it seems to respond multiple times and quite frankly the code doesn't make much sense to me...
Code:private object OnPlayerChat(ConsoleSystem.Arg arg) { var player = arg.Connection.player as BasePlayer; if (player.IsAdmin) return null; foreach (var phrase in _Config.PhraseConfig.Phrases) { if (arg.FullString.ToLower().Contains(phrase.Key.ToLower())) { PrintToChat(player, FormatMsg(player)); if (phrase.Value) return false; } } return null; } private object OnBetterChat(Dictionary<string, object> data) { var player = data["Player"] as IPlayer; var bPlayer = player.Object as BasePlayer; if (bPlayer.IsAdmin) return null; foreach (var phrase in _Config.PhraseConfig.Phrases) { if (data["Text"].ToString().ToLower().Contains(phrase.Key.ToLower())) if(phrase.Value) return true; } return null; }
- Why doesn't it check if phrase.Value is true BEFORE sending a message to the player? Checking after can result in it sending a message for a disabled phrase...
- Why doesn't OnBetterChat() ever call PrintToChat()?
- Why does OnBetterChat return true if the phrase.Value is true?
Unless something on my server was preventing it from working right and making sense, I'd suggest the following changes:
Code:private object OnPlayerChat(ConsoleSystem.Arg arg) { var player = arg.Connection.player as BasePlayer; if (player.IsAdmin) return null; foreach (var phrase in _Config.PhraseConfig.Phrases) { if (phrase.Value && arg.FullString.ToLower().Contains(phrase.Key.ToLower())) { PrintToChat(player, FormatMsg(player)); return false; } } return null; } private object OnBetterChat(Dictionary<string, object> data) { var player = data["Player"] as IPlayer; var bPlayer = player.Object as BasePlayer; if (bPlayer.IsAdmin) return null; foreach (var phrase in _Config.PhraseConfig.Phrases) { if (phrase.Value && data["Text"].ToString().ToLower().Contains(phrase.Key.ToLower())) { PrintToChat(bPlayer, FormatMsg(bPlayer)); /** * Because BetterChat doesn't provide us a way to prevent the * message from being sent, we shall build a List<> of all * players and Add them to the BlockedReceivers instead. */ List<string> blockedReceivers = new List<string>(); foreach (BasePlayer p in BasePlayer.activePlayerList) { blockedReceivers.Add(p.UserIDString); } data["BlockedReceivers"] = blockedReceivers; return data; } } return null; }
Code:if (!isSupported) { PrintWarning("This plugin is only compatible with BetterChat version 5.0.6 or greater!"); Unsubscribe(nameof(OnBetterChat)); } else Unsubscribe(nameof(OnPlayerChat)); }
Aside from these few issues with the phrases feature, love the mod! Thanks for sharing. -
). I return false if the dictionary value is true so it intercepts the players message.
2) If I printed to chat in OnBetterChat, it would print to chat twice because OnPlayerChat would also be called.
3) Again, if the dictionary's value is true it intercepts the better chat message from being sent.
Regarding the unsub of OnPlayerChat when BetterChat is installed, if you return false with OnBetterChat, it would just send their message in vanilla chat instead. So you have to intercept the message in both hooks unfortunately. -
Ahh, ok... that makes a bit more sense - might want to clarify that in the overview. However, there is a bit of an issue still. If you look at your default config, you have:
Code:"Phrases": { "wipe": false, "when wipe?": true, "wiped?": true }
In other words, because it's not breaking out of the loop after the first match, it creates a glitch where it could possibly spam multiple times depending upon the given phrases, global boolean values, and what the user enters. -
-
I hate using break; outside of a switch statement, but it would be the easy solution in this situation.
-
@Ryan i don't get logics, why you need to use refresh timers? you can't wipe server without restarting, so hostname and description should be changed only once, on server starting. now i forced to use refresh timers, otherwise info don't appear..
[DOUBLEPOST=1503211675][/DOUBLEPOST]also, maximum hostname lenght is 63, not 64. -