Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ Config = {
-- Broadcast moderation actions (warnings, kicks, bans, etc...) to the chat for other players to see?
BROADCAST_ACTIONS_TO_SERVER = true,

-- Show staff that banned player on join?
SHOW_STAFF_ON_BANNED_PLAYER_JOIN = true,

-- Configure templated actions
TEMPLATED_ACTIONS = {
{
Expand Down
39 changes: 27 additions & 12 deletions src/server/playerJoin.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,22 +60,37 @@ function HandleBan(def, banInfo)
if banInfo.rule == nil then
banInfo.rule = { name = "Not Specified" }
end
local message = '\n' .. [[
⚠️ You Are Banned From This Server ⚠️
--------------------------------------
🚫 Rule: {rule}
📝 Reason: {reason}
⏰ Expires: {expiration}
--------------------------------------
⚙️ Banned Using StaffWatch.app
--------------------------------------
📞 Want to appeal this ban?
Visit: {appealUrl}
]]

local lines = {
"--------------------------------------",
"⚠️ You Are Banned From This Server ⚠️",
"--------------------------------------",
"🚫 Rule: " .. banInfo.rule.name,
"📝 Reason: " .. banInfo.reason,
"⏰ Expires: " .. banInfo.expiration,
"--------------------------------------",
"⚙️ Banned Using StaffWatch.app",
"--------------------------------------",
"📞 Want to appeal this ban?",
"Visit: " .. banInfo.appealUrl,
"--------------------------------------"
}

if Config.SHOW_STAFF_ON_BANNED_PLAYER_JOIN then
table.insert(lines, 4, "👤 Staff: {staff}")
end

local message = '\n' .. table.concat(lines, '\n')

message = InputReplace(message, "rule", banInfo.rule.name)
message = InputReplace(message, "reason", banInfo.reason)
message = InputReplace(message, "expiration", banInfo.expiration)
message = InputReplace(message, "appealUrl", banInfo.appealUrl)

if Config.SHOW_STAFF_ON_BANNED_PLAYER_JOIN then
message = InputReplace(message, "staff", banInfo.staffUsername)
end

def.done(message)
end

Expand Down