Skip to content
This repository has been archived by the owner on Oct 25, 2024. It is now read-only.

Commit

Permalink
Revert "introduce rate limiting of chat"
Browse files Browse the repository at this point in the history
This reverts commit 34e3c01.
  • Loading branch information
maxsupermanhd committed Sep 19, 2024
1 parent 33d5b51 commit 2ccef84
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 157 deletions.
9 changes: 0 additions & 9 deletions connfilter.go
Original file line number Diff line number Diff line change
Expand Up @@ -166,15 +166,6 @@ where g.game_time < 60000 and g.time_started + $1::interval > now() and (i.pkey
}
}

// stage 8 chat rate limit mute
if account == nil {
rlcDuration, rlcExceeded := ratelimitChatCheck(inst, ip)
if rlcExceeded {
jd.AllowChat = false
jd.Messages = append(jd.Messages, "You were limited to quickchat due to spamming for "+rlcDuration.String())
}
}

inst.logger.Printf("connfilter resolved key %v nljoin %v (acc %v) nlplay %v (action %v) nlchat %v (allowed %v)",
pubkeyB64,
allowNonLinkedJoin, account,
Expand Down
2 changes: 0 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@ func main() {

go routineDiscordErrorReporter()

ratelimitChatPenalties = ratelimitChatLoadPenalties()

recoverInstances()

signals := make(chan os.Signal, 1)
Expand Down
8 changes: 0 additions & 8 deletions messageProcessor.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,14 +386,6 @@ func messageHandlerProcessChat(inst *instance, msg string) bool {
if msgtype == "WZCHATCMD" && (strings.HasPrefix(string(msgcontent), "/votekick")) {
instWriteFmt(inst, `chat direct %s %s`, msgb64pubkey, "If you would like to become a part of Autohoster moderation team, feel free to contact us: https://wz2100-autohost.net/about#contact")
}
if msgtype == "WZCHATLOB" {
ratelimitChatHandleMessage(inst, msgip)
rlcDuration, rlcExceeded := ratelimitChatCheck(inst, msgip)
if rlcExceeded {
instWriteFmt(inst, `set chat quickchat %s`, msgb64pubkey)
instWriteFmt(inst, `chat direct %s %s`, msgb64pubkey, "You were limited to quickchat due to spamming for "+rlcDuration.String())
}
}
return false
}

Expand Down
138 changes: 0 additions & 138 deletions ratelimit.go

This file was deleted.

0 comments on commit 2ccef84

Please sign in to comment.