GUIAnnouncements

Moved

Total Downloads: 11,756 - First Release: Jul 13, 2015 - Last Update: Oct 20, 2017

5/5, 66 likes
  1. @maxaki
    What version of the plugin are you using? And have you restarted your server since the errors have been happening?
     
  2. [Info("GUIAnnouncements", "JoeSheep", "1.6.24", ResourceId = 1222)]

    Tried redownloading the plugin. Removed data files completely. Reset the config.
    Now I tried adding it while the server was in starting phase. People got the error as soon as they joined the server.
    Restarted multiple times.

    We usually have around 80-150players online.
    Have you tested teleporting i.e /home with plugin NTeleportation?

    I have some more info here
    Code:
    15:06 [Info] [Death Notes] A Wolf ☠ [Royal] Σrandan while sleeping.
    15:06 [Error] Failed to call hook 'OnPlayerSleepEnded' on plugin 'GUIAnnouncements v1.6.24' (KeyNotFoundException: The given key was not present in the dictionary.)
    15:06 [Debug]   at System.Collections.Generic.Dictionary`2[System.UInt64,Oxide.Plugins.GUIAnnouncements+PlayerTimesJoined].get_Item (UInt64 key) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.GUIAnnouncements.OnPlayerSleepEnded (.BasePlayer player) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.GUIAnnouncements.DirectCallHook (System.String name, System.Object& ret, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Plugins.CSharpPlugin.InvokeMethod (HookMethod method, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.CSPlugin.OnCallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0
      at Oxide.Core.Plugins.Plugin.CallHook (System.String name, System.Object[] args) [0x00000] in <filename unknown>:0 
    I think it happens whenever someone dies.
    Or respawn
     
  3. JoeSheep updated GUI Announcements with a new update entry:

    1.6.25



    @maxaki Can you try this update please and let me know how you get on?
     
  4. Seems like it works!
     
  5. I could setup a permission to use a command which would put them in an exclusion list for announcements until the server restarts.
     
  6. that would be great if you could. Thanks
     
  7. First, thanks for taking the time to make this plugin.

    Trying to use new just new player announcements and welcome announcement. Welcome announcement displays but the new player ones do not.

    Looking through the code, I see that in the function OnPlayerSleepEnded(), when WelcomeAnnouncement() is called, it will remove the current player ID from the JustJoined List<>. The problem is that JustJoined is checked again a bit further down in that function before displaying the new player announcements. The user it is checking for has already been removed by the welcome announcement function.

    It also appears that the current player ID is only added to JustJoined if the welcome message is set to true so you can't have new player announcements without it.

    I was going to patch it in my server but I thought I'd bring that to your attention.
     
  8. JoeSheep updated GUI Announcements with a new update entry:

    1.8.27

     
  9. The new player announcement doesn't work for me :(
     
  10. You are very correct. I will have to change that.

    If you have the welcome message set to false, at the moment it won't work. As per my above quote I will need to change it.
     
  11. i have the welcome message set to true
     
  12. How many times have you joined? Even if new player announcements may have previously been turned off it is still logging how many times each player has joined. You can open the data file and search for your name.
     
  13. I think the first bug I pointed out will prevent announcements from working no matter the welcome message setting.
     
  14. The just joined list is only ever accessed if welcome messages is true.
     
  15. Correct, but even if it set to true, the welcome message function calls CreateMsgGUI and then LoadPrivateGUI. LoadPrivateGUI clears the player ID from JustJoined so when the OnPlayerSleepEnded function continues to the new player announcement section and checks JustJoined again which has now had the player ID removed. The player announcement, never shows in any case. See notes below.


    Code:
    void OnPlayerSleepEnded(BasePlayer player)
            {
                if (welcomeAnnouncement)
                {
                    if (JustJoined.Contains(player.userID))
                    {
                        WelcomeAnnouncement(player);  <--Eventually calls LoadPrivateGUI() function that clears player.userID from JustJoined List
                    }
                }
                if (newPlayerAnnouncements)
                {
            if (JustJoined.Contains(player.userID)) <--- This is always empty
            {
                        if (storedData.PlayerData[player.userID].TimesJoined <= newPlayerAnnouncementsShowTimes)
                        {
                            if (welcomeAnnouncement)
                            {
                                timer.Once(welcomeAnnouncementDuration, () => NewPlayerAnnouncements(player));
                            }
                            else
                            {
                                NewPlayerAnnouncements(player);
                            }
                        }
            }
                }
            }


    I believe something like this would solve it:

    Code:
            void OnPlayerSleepEnded(BasePlayer player)
            {
             if (JustJoined.Contains(player.userID))
                    {
              if (welcomeAnnouncement)
              {
                WelcomeAnnouncement(player);
              }
              if (newPlayerAnnouncements)
              {
                        if (storedData.PlayerData[player.userID].TimesJoined <= newPlayerAnnouncementsShowTimes)
                        {
                            if (welcomeAnnouncement)
                            {
                                timer.Once(welcomeAnnouncementDuration, () => NewPlayerAnnouncements(player));
                            }
                            else
                            {
                                NewPlayerAnnouncements(player);
                            }
                        }
              }
            }
            }
     
    Last edited by a moderator: Jun 19, 2016
  16. It's alright I got it. :)
     
  17. so i need to wait an update ;)
     
  18. Best idea for now, then we can see if you are still having problems.
     
  19. @michelemarri
    Trello <--- Dev build
    Not tested thoroughly yet but your issue should be fixed. Lots of changes in this so would be a good idea to generate a new language, data (if it goes null) and config file. Might be nice if you could let it write on your current config file and see if anything goes weird or looks weird like duplicated settings etc and let me know.
     
    Last edited by a moderator: Jun 21, 2016
  20. i've just uploaded your DEV build. New config & language. Seems not working at all