Skip to content

Commit

Permalink
Don't show FCL warning for "online" status only on logins.
Browse files Browse the repository at this point in the history
  • Loading branch information
Distortions81 committed Dec 16, 2024
1 parent 48145aa commit 4bac83a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions banlist/banList.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ type banDataType struct {
Reason string `json:"reason,omitempty"`
}

func CheckBanList(name string) bool {
func CheckBanList(name string, doWarn bool) bool {
pname := strings.ToLower(name)
BanListLock.Lock()
defer BanListLock.Unlock()

for _, ban := range BanList {
if strings.EqualFold(ban.UserName, pname) {
if doWarn && strings.EqualFold(ban.UserName, pname) {
warn := "Warning: [FCL] ban found for '" + pname + "': " + ban.Reason

if fact.PlayerLevelGet(ban.UserName, true) < 2 {
Expand Down
4 changes: 2 additions & 2 deletions support/pipeHandle.go
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ func handlePlayerJoin(input *handleData) bool {

if input.noDatestampListLen > 1 {
pname := sclean.UnicodeCleanup(input.noDatestampList[1])
if banlist.CheckBanList(pname) {
if banlist.CheckBanList(pname, true) {
return true
}
plevelname := fact.AutoPromote(pname, false, true)
Expand Down Expand Up @@ -1217,7 +1217,7 @@ func handleOnlineMsg(input *handleData) bool {
go fact.UpdateSeen(pname)

/* Check if user is banned */
banlist.CheckBanList(pname)
banlist.CheckBanList(pname, false)

timeInt, _ := strconv.Atoi(ptime)
scoreInt, _ := strconv.Atoi(pscore)
Expand Down

0 comments on commit 4bac83a

Please sign in to comment.