1. Awesome! Thank you! by the way, how can I make the picture removed while typing as admin?
     
  2. im stupid...nvm
     
    Last edited by a moderator: Feb 1, 2015
  3. Domestos updated Chat Handler with a new update entry:

    fixes

     
  4. Hidden admin:
    Code:
    function PLUGIN:BroadcastChat(player, name, msg)
        local steamID = rust.UserIDFromPlayer(player)
        local color = self.Config.Settings.NameColor.NormalUser
        if IsAdmin(player) then
            --color = self.Config.Settings.NameColor.Admin
            steamID = 0
        end
        global.ConsoleSystem.Broadcast("chat.add", steamID, "<color="..color..">"..name.."</color>  "..msg)
    end
    I just commented out the line that sets admin color. Also I added line that sets steamID to 0 if you are admin. Player's icon get from steamID64.
     
    Last edited by a moderator: Feb 1, 2015
  5. after installing the plug-in is not created Log.Chat.txt
     
  6. This is a potential vulnerability that allows anyone impersonate himself as admin:
    Code:
    Line 48:     if name == self.Config.Settings.AdminMode.AdminChatName then
    Need to move global vars to the top or just declare AdminMode[] there and replace condition (line 48) by this:
    Code:
    if AdminMode[steamID] then
     
  7. You're right, thanks for noticing. I fixed it in the next version.
     
  8. Domestos updated Chat Handler with a new update entry:

    more fixes

     
  9. mute only for repetitive posts

     

    Attached Files:

    Last edited by a moderator: Feb 2, 2015
  10. Can you also flag all capital sentences as spam? they are annoying..
     
  11. How to disable history for players ? history only for admins
     
  12. I'll think about this.
    There is no option for this and i dont see a reason why it should be.
     
  13. Who can share a list of bad words in Russian and English? I added a few manually, but imagination of the players is unlimited :)
     
  14. How about t0 add little mode, what blocks people only for same message spam OR for way too much messages per interval?
    For example:

    line 513 replace with:
    Code:
    local isSpam, punishTime = self:AntiSpamCheck(player, msg)
    line 545 function replace:
    Code:
    function PLUGIN:AntiSpamCheck(player, msg)
        local steamID = rust.UserIDFromPlayer(player)
        local now = time.GetUnixTimestamp()
        if muteData[steamID] then return false, false end
        if AdminMode[steamID] then return false, false end
        if AntiSpam[steamID] then
            local firstMsg = AntiSpam[steamID].timestamp
            local forcePunish = false
            local msgCount = AntiSpam[steamID].msgcount
            if AntiSpam[steamID].lastmsg == msg and (AntiSpam[steamID].samemsg < self.Config.Settings.AntiSpam.MaxLines) then
                AntiSpam[steamID].samemsg = AntiSpam[steamID].samemsg + 1
            elseif AntiSpam[steamID].samemsg >= self.Config.Settings.AntiSpam.MaxLines then
                forcePunish = true
            else
                AntiSpam[steamID].lastmsg = msg
                AntiSpam[steamID].samemsg = 1
            end      
          
            if (msgCount < self.Config.Settings.AntiSpam.MaxLines) and not forcePunish then
                AntiSpam[steamID].msgcount = AntiSpam[steamID].msgcount + 1
                return false, false
            else
                if now - firstMsg <= self.Config.Settings.AntiSpam.TimeFrame or forcePunish then
                    -- punish
                    local punishCount = 1
                    local expiration, punishTime, newEntry
                    if spamData[steamID] then
                        newEntry = false
                        punishCount = spamData[steamID].punishcount + 1
                        spamData[steamID].punishcount = punishCount
                        self:SaveDataFiles()
                    end
                    if punishCount == 1 then
                        expiration =  now + 300
                        punishTime = "5 minutes"
                    elseif punishCount == 2 then
                        expiration = now + 3600
                        punishTime = "1 hour"
                    else
                        expiration = 0
                        punishTime = "permanent"
                    end
                    if newEntry ~= false then
                        spamData[steamID] = {}
                        spamData[steamID].steamID = steamID
                        spamData[steamID].punishcount = punishCount
                        table.insert(spamData, spamData[steamID])
                        self:SaveDataFiles()
                    end
                    muteData[steamID] = {}
                    muteData[steamID].steamID = steamID
                    muteData[steamID].expiration = expiration
                    table.insert(muteData, muteData[steamID])
                    self:SaveDataFiles()
                    AntiSpam[steamID] = nil
                    return true, punishTime
                else
                    AntiSpam[steamID].timestamp = now
                    AntiSpam[steamID].msgcount = 1
                    AntiSpam[steamID].samemsg = 1
                    AntiSpam[steamID].lastmsg = msg
                    return false, false
                end
            end
        else
            AntiSpam[steamID] = {}
            AntiSpam[steamID].timestamp = now
            AntiSpam[steamID].msgcount = 1
            AntiSpam[steamID].samemsg = 1
            AntiSpam[steamID].lastmsg = msg
            return false, false
        end
    end
    
    after those changes plugin will block people for MaxLines amount of same messages or MaxLines amount of messages per TimeFrame.
     
    Last edited by a moderator: Feb 4, 2015
  15. As i said previously i'll consider such a feature and may add something in a future version. I cant push an update every day.
    Not sure if i'd realise it exactly the way you did but we'll see.
     
  16. @Domestos @Wulf
    Chat messages are not displayed in the RustWeb and RCON tools. So is it possible to make compatible Chat Handler plugin with these things?
     
  17. Worked for me in Rusty when i tested it a while ago.
     
  18. Indeed. My mistake.
    But what about RustWeb?
     
  19. It depends on how these tools are obtaining the chat. If i let chathandler send the chat in 5 diferent ways for 5 different tools all messages will be displayed 5 times.
     
  20. Wulf

    Wulf Community Admin

    Temporary build compatible with Oxide builds 266+.
     

    Attached Files: