RealtimeWipeInfo

Moved

Total Downloads: 1,533 - First Release: May 19, 2017 - Last Update: Mar 16, 2018

5/5, 8 likes
  1. 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
     
  2. Then that'd be to do with MagicDescription, this plugin does not put the server settings into the server description.
     
  3. Hmmm, alright. Wasn't there before adding this plugin but ok. I guess they dont want to play together
     
  4. [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.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
     
  5. Have any problem with dercription? Plz see the image. Thx.
     

    Attached Files:

  6. Looking into these now
    [DOUBLEPOST=1499451080][/DOUBLEPOST]
    @GreenRazerz Can you send me your config so I can reproduce this please?
     
  7. Ryan updated RealtimeWipeInfo with a new update entry:

    1.0.8

     
  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 
     
  9. Hmm I can never find the cause of that yet I imagine it’s such a simple fix haha. I’ll have a look tomorrow
     
  10. Version 1.0.8 still shows UTC time in title.
     
  11. any way i can add d/M format to the server title
     
  12. Enable "Enable the use of date in the title" and change the "DateFormat" inside the "Title configuration" section to your liking, in your case "d/M" (like it already is)
     
  13. 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;
            }
    Looking at this section of the code, I see a few things that don't quite make sense.
    1. 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...
    2. Why doesn't OnBetterChat() ever call PrintToChat()?
    3. Why does OnBetterChat return true if the phrase.Value is true?
    Additionally, why do you not unsubscribe from OnPlayerChat after determining the server is running a compatible version of BetterChat?

    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;
            }
    
    And: fix "compatable" typo + unsub from OnPlayerChat:
    Code:
                    if (!isSupported)
                    {
                        PrintWarning("This plugin is only compatible with BetterChat version 5.0.6 or greater!");
                        Unsubscribe(nameof(OnBetterChat));
                    }
                    else
                        Unsubscribe(nameof(OnPlayerChat));
                }
    Personally, I'd keep the phrases enabled for admins too if enabled on the server - or include a config value as previously suggested by another user.

    Aside from these few issues with the phrases feature, love the mod! Thanks for sharing. :)
     
  14. 1) The dictionary value determines whether the server owner wants to stop the message from being sent to the global chat, not determining whether they want the message to be sent (if they didn't want the message to be sent they wouldn't have it in the config ;)). 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.
     
  15. 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
        }
    If the user types "when wipe?", the code will loop over this, see "when wipe?" contains "wipe" and print it's message locally, because it's false, it won't return and therefore the loop will continue, it'll see "when wipe?" contains itself, print the message again, and then because it's true it'll return which breaks the loop.

    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.
     
  16. Ah yea, I need to update this plugin with a better word checking method anyway. I guess just a break out of the loop like you said would solve all of my issues anyway.
     
  17. I hate using break; outside of a switch statement, but it would be the easy solution in this situation. :)
     
  18. @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.
     
  19. If I don’t use refesh timers then when it restarts and makes the deacription / title “wiped JUST NOW” for the remainder of the servers uptime. That isn’t that accurate is it? :p