Jump to content

spams chat when settings set to faulse

Pending 1.0.8

GooberGrape

Posted

"Notification settings": {
    "Send announcements via in-game chat?": false,

imthenewguy

Posted

Can you please show me word for word what the text is that is spamming?

imthenewguy

Posted

That message is locked behing "Send announcements via in-game chat?".

            foreach (var player in BasePlayer.activePlayerList)
            {
                string str = string.Format(lang.GetMessage("BuildingCreated_Success", this, player.UserIDString), GetGrid(pos, false), Math.Round(randomTime, 0));
                if (config.notificationSettings.send_chat_announcements) PrintToChat(player, str);
                SendGUIAnnouncement(player, str);
                if (config.notificationSettings.UINotify.send_on_spawn) SendNotify(player, str);
            }

 

GooberGrape

Posted (edited)

{
  "Notification settings": {
    "Send announcements via in-game chat?": false,
    "GUIAnnouncements plugin settings": {
      "Send announcements using the GUIAnnouncements plugin?": false,
      "Banner colour - see GUIAnnouncements for colours": "Purple",
      "Text colour - see GUIAnnouncements for colours": "Yellow",
      "Position adjustment": 0.0
    },
    "UINotify plugin settings": {
      "Send shop spawn announcements?": true,
      "Send shop de-spawn announcements?": false,
      "UINotify notification type": 0
    }
  },

Edited by GooberGrape
GooberGrape

Posted

yes version  1.0.8 only way it stops is  "UINotify plugin settings": {
      "Send shop spawn announcements?": false,
      "Send shop de-spawn announcements?": false,

 

so it means  Chat is coming through the "UINotify plugin settings" also

imthenewguy

Posted

It was added in 1.0.7

 

This is the code with comments showing that it does not send if those options are set to false.

            foreach (var player in BasePlayer.activePlayerList)
            {
                // This is the string that is built to send through chat, UINotify and SendGUIAnnouncement
                string str = string.Format(lang.GetMessage("BuildingCreated_Success", this, player.UserIDString), GetGrid(pos, false), Math.Round(randomTime, 0));

                // This handles sending the message via chat. The send_chat_announcements is that config option. If its false, the code won't reach the PrintToChat method.
                if (config.notificationSettings.send_chat_announcements) PrintToChat(player, str);

                // This triggers SendGUIAnnouncement method, which handles the checks in the method itself.
                SendGUIAnnouncement(player, str);

                // This handles sending the message via UINotify. It won't reach the method if send_on_spawn is set to false.
                if (config.notificationSettings.UINotify.send_on_spawn) SendNotify(player, str);
            }

 

This the code the SendNotify, showing that there are no chat message methods inside of the SendNotify method.

        void SendNotify(BasePlayer player, string message)
        {
            if (string.IsNullOrEmpty(message)) return;
            if ((Notify != null && Notify.IsLoaded) || (UINotify != null && UINotify.IsLoaded))
                Interface.Oxide.CallHook("SendNotify", player, config.notificationSettings.UINotify.type, message);            
        }

Short of the notify plugin having built in chat messages (why would it), it should not be sending chat messages.

This is also the SendGUIAnnouncement method for reference.

        void SendGUIAnnouncement(BasePlayer player, string message)
        {
            if (!config.notificationSettings.GUIAnnouncements.enabled || GUIAnnouncements == null || !GUIAnnouncements.IsLoaded) return;
            GUIAnnouncements.Call("CreateAnnouncement", message, config.notificationSettings.GUIAnnouncements.banner_colour, config.notificationSettings.GUIAnnouncements.text_colour, player, config.notificationSettings.GUIAnnouncements.position_adjustment);
        }

 

GooberGrape

Posted

1 minute ago, imthenewguy said:

It was added in 1.0.7

 

This is the code with comments showing that it does not send if those options are set to false.

            foreach (var player in BasePlayer.activePlayerList)
            {
                // This is the string that is built to send through chat, UINotify and SendGUIAnnouncement
                string str = string.Format(lang.GetMessage("BuildingCreated_Success", this, player.UserIDString), GetGrid(pos, false), Math.Round(randomTime, 0));

                // This handles sending the message via chat. The send_chat_announcements is that config option. If its false, the code won't reach the PrintToChat method.
                if (config.notificationSettings.send_chat_announcements) PrintToChat(player, str);

                // This triggers SendGUIAnnouncement method, which handles the checks in the method itself.
                SendGUIAnnouncement(player, str);

                // This handles sending the message via UINotify. It won't reach the method if send_on_spawn is set to false.
                if (config.notificationSettings.UINotify.send_on_spawn) SendNotify(player, str);
            }

 

This the code the SendNotify, showing that there are no chat message methods inside of the SendNotify method.

        void SendNotify(BasePlayer player, string message)
        {
            if (string.IsNullOrEmpty(message)) return;
            if ((Notify != null && Notify.IsLoaded) || (UINotify != null && UINotify.IsLoaded))
                Interface.Oxide.CallHook("SendNotify", player, config.notificationSettings.UINotify.type, message);            
        }

Short of the notify plugin having built in chat messages (why would it), it should not be sending chat messages.

This is also the SendGUIAnnouncement method for reference.

        void SendGUIAnnouncement(BasePlayer player, string message)
        {
            if (!config.notificationSettings.GUIAnnouncements.enabled || GUIAnnouncements == null || !GUIAnnouncements.IsLoaded) return;
            GUIAnnouncements.Call("CreateAnnouncement", message, config.notificationSettings.GUIAnnouncements.banner_colour, config.notificationSettings.GUIAnnouncements.text_colour, player, config.notificationSettings.GUIAnnouncements.position_adjustment);
        }

 

it stopped after this setting

  "Send shop spawn announcements?": false,
      "Send shop de-spawn announcements?": false,

1.4m

Downloads

Total number of downloads.

6.9k

Customers

Total customers served.

102.3k

Files Sold

Total number of files sold.

2m

Payments Processed

Total payments processed.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.