Awesome! Thank you! by the way, how can I make the picture removed while typing as admin?
Chat Handler [Unmaintained]
Discussion in 'Plugin Support' started by Domestos, Nov 2, 2014.
-
Domestos updated Chat Handler with a new update entry:
fixes
-
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
Last edited by a moderator: Feb 1, 2015 -
after installing the plug-in is not created Log.Chat.txt
-
This is a potential vulnerability that allows anyone impersonate himself as admin:
Code:Line 48: if name == self.Config.Settings.AdminMode.AdminChatName then
Code:if AdminMode[steamID] then
-
-
Domestos updated Chat Handler with a new update entry:
more fixes
-
mute only for repetitive posts
Attached Files:
Last edited by a moderator: Feb 2, 2015 -
-
Can you also flag all capital sentences as spam? they are annoying..
-
How to disable history for players ? history only for admins
-
-
Who can share a list of bad words in Russian and English? I added a few manually, but imagination of the players is unlimited
-
For example:
line 513 replace with:
Code:local isSpam, punishTime = self:AntiSpamCheck(player, msg)
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
Last edited by a moderator: Feb 4, 2015 -
Not sure if i'd realise it exactly the way you did but we'll see. -
-
But what about RustWeb? -
-
Wulf Community Admin
Temporary build compatible with Oxide builds 266+.
Attached Files:
-