-
-
Notifications
You must be signed in to change notification settings - Fork 171
votemanager: added additional resource settings for ban votes #192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e0e9927
5500541
e88a420
556d2a5
ac663ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -58,6 +58,12 @@ addEventHandler("onResourceStart", thisResourceRoot, | |||
info.percentage = get(settingsGroup.."_percentage") or nil | ||||
info.timeout = get(settingsGroup.."_timeout") or nil | ||||
info.allowchange = get(settingsGroup.."_allowchange") | ||||
if name == "ban" then | ||||
info.banip = get(settingsGroup.."_banip") | ||||
info.banusername = get(settingsGroup.."_banusername") | ||||
info.banserial = get(settingsGroup.."_banserial") | ||||
info.duration = get(settingsGroup.."_duration") | ||||
end | ||||
info.blockedPlayers = {} | ||||
addCommandHandler("vote"..name, vote[name].handler ) | ||||
end | ||||
|
@@ -426,6 +432,8 @@ function voteKick(player, reason) | |||
local title = "Kick "..getPlayerName(player).."?" | ||||
if reason then | ||||
title = title.." ("..reason..")" | ||||
else | ||||
reason = "" | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. making reason an empty string if none is supplied for reasons explained in the pull request |
||||
end | ||||
return startPoll{ | ||||
title=title, | ||||
|
@@ -446,14 +454,16 @@ function voteBan(player, reason) | |||
local title = "Ban "..getPlayerName(player).."?" | ||||
if reason then | ||||
title = title.." ("..reason..")" | ||||
else | ||||
reason = "" | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. making reason an empty string if none is supplied for reasons explained in the pull request |
||||
end | ||||
return startPoll{ | ||||
title=title, | ||||
percentage = vote.ban.percentage, | ||||
visibleTo = rootElement, | ||||
timeout = vote.ban.timeout, | ||||
allowchange = vote.ban.allowchange; | ||||
[1]={"Yes",banPlayer,player,serverConsole,reason}, | ||||
[1]={"Yes",banPlayer,player,vote.ban.banip,vote.ban.banusername,vote.ban.banserial,serverConsole,reason,vote.ban.duration}, | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if reason was nil here it would result in the ban duration being ignored, because after unpacking the table in
|
||||
[2]={"No",outputVoteManager,"voteban: not enough votes to ban "..getPlayerName(player)..".",rootElement,vR,vG,vB;default=true}, | ||||
} | ||||
end | ||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not entirely sure whether this or
if settingsGroup == "voteban" then
would be better. I think either is fine.