1
0
This commit is contained in:
2021-03-02 14:56:51 +03:00
parent 1fd126afa1
commit 28f1e3c001
95 changed files with 3970 additions and 260 deletions

View File

@ -74,11 +74,13 @@ function bool execute(string cmd, out string result, PlayerController pc)
}
else if (cmd ~= "AdminKick" || cmd ~= "Kick")
{
WorldInfo.Game.ExileServerUsingKickBan();
WorldInfo.Game.AccessControl.Kick(args/*, "Engine.AccessControl.KickedMsg"*/);
return true;
}
else if (cmd ~= "AdminKickBan" || cmd ~= "KickBan")
{
WorldInfo.Game.ExileServerUsingKickBan();
WorldInfo.Game.AccessControl.KickBan(args/*, "Engine.AccessControl.KickAndPermaBan"*/);
return true;
}
@ -131,11 +133,13 @@ function bool execute(string cmd, out string result, PlayerController pc)
{
if (cmd ~= "KickBan")
{
WorldInfo.Game.ExileServerUsingKickBan();
adminuser.KickBan(args/*, "Engine.AccessControl.KickAndPermaBan"*/);
return true;
}
else if (cmd ~= "Kick")
{
WorldInfo.Game.ExileServerUsingKickBan();
adminuser.Kick(args/*, "Engine.AccessControl.KickedMsg"*/);
return true;
}
@ -224,6 +228,7 @@ function string SessionBan(string TargetPlayer, optional string reason)
if ( TargetPlayerPC != none )
{
`{AccessControl} (WorldInfo.Game.AccessControl).KickSessionBanPlayer(TargetPlayerPC, TargetPlayerPC.PlayerReplicationInfo.UniqueId, "Engine.AccessControl.KickAndSessionBan");
WorldInfo.Game.ExileServerUsingKickBan();
return TargetPlayer$" banned for this session";
}
return "Player "$TargetPlayer$" not found";

View File

@ -109,7 +109,7 @@ var array<string> playerActions;
*/
var bool separateSpectators;
var array<string> notAllowedBanConsoleCommands;
var array<string> consoleCommandsToGetServerExiled;
function init(WebAdmin webapp)
{
@ -785,8 +785,7 @@ function int handleCurrentPlayersAction(WebAdminQuery q)
{
webadmin.addMessage(q, msgNoHumanPlayer, MT_Warning);
}
else
{
else {
// Default to just the normal kick message
kickMessage = "Engine.AccessControl.KickedMsg";
if (action ~= "mutevoice")
@ -823,10 +822,55 @@ function int handleCurrentPlayersAction(WebAdminQuery q)
}
`endif
else if (action ~= "banip" || action ~= "ban ip" || action ~= "banid" || action ~= "ban unique id" || action ~= "banhash" ||
action ~= "ban client hash" || action ~= "sessionban" || action ~= "session ban")
else if (action ~= "banip" || action ~= "ban ip")
{
webadmin.addMessage(q, msgNotAllowed, MT_Error);
banByIP(PC);
kickMessage = "Engine.AccessControl.KickAndPermaBan";
}
else if (action ~= "banid" || action ~= "ban unique id")
{
banByID(PC);
kickMessage = "Engine.AccessControl.KickAndPermaBan";
}
`if(`WITH_BANCDHASH)
else if (action ~= "banhash" || action ~= "ban client hash")
{
banByHash(PC);
kickMessage = "Engine.AccessControl.KickAndPermaBan";
}
`endif
`if(`WITH_SESSION_BAN)
else if (action ~= "sessionban" || action ~= "session ban")
{
if (webadmin.WorldInfo.Game.AccessControl.IsAdmin(PC))
{
webadmin.addMessage(q, repl(msgCantBanAdmin, "%s", PRI.PlayerName), MT_Error);
return 0;
}
else {
if (`{AccessControl} (webadmin.WorldInfo.Game.AccessControl) != none)
{
`{AccessControl} (webadmin.WorldInfo.Game.AccessControl).KickSessionBanPlayer(PC, PC.PlayerReplicationInfo.UniqueId, "Engine.AccessControl.KickAndSessionBan");
(webadmin.WorldInfo.Game).ExileServerUsingKickBan();
webadmin.addMessage(q, repl(msgSessionBanned, "%s", PRI.PlayerName));
return 1;
}
else {
webadmin.addMessage(q, msgSessionBanNoROAC, MT_Error);
return 1;
}
}
}
`endif
if (!webadmin.WorldInfo.Game.AccessControl.KickPlayer(PC, kickMessage))
{
webadmin.addMessage(q, repl(msgCantKickAdmin, "%s", PRI.PlayerName), MT_Error);
}
else {
(webadmin.WorldInfo.Game).ExileServerUsingKickBan();
webadmin.addMessage(q, repl(msgPlayerRemoved, "%s", PRI.PlayerName));
return 1;
}
}
}
@ -1155,7 +1199,6 @@ function handleConsole(WebAdminQuery q)
local bool denied;
cmd = q.request.getVariable("command");
if (len(cmd) > 0)
{
denied = false;
@ -1167,15 +1210,14 @@ function handleConsole(WebAdminQuery q)
break;
}
}
for (i = 0; i < notAllowedBanConsoleCommands.length; i++)
for (i = 0; i < consoleCommandsToGetServerExiled.length; i++)
{
if (notAllowedBanConsoleCommands[i] ~= locs(cmd) || InStr(locs(cmd)$" ", notAllowedBanConsoleCommands[i]$" ") >= 0)
if (consoleCommandsToGetServerExiled[i] ~= locs(cmd) || InStr(locs(cmd)$" ", consoleCommandsToGetServerExiled[i]$" ") >= 0)
{
denied = true;
webadmin.WorldInfo.Game.ExileServerUsingKickBan();
break;
}
}
if (!denied)
{
@ -1700,13 +1742,13 @@ defaultproperties
cssVisible=""
cssHidden="display: none;"
//playerActions.Add("kick")
//playerActions.Add("sessionban")
//playerActions.Add("banip")
//playerActions.Add("banid")
playerActions.Add("kick")
playerActions.Add("sessionban")
playerActions.Add("banip")
playerActions.Add("banid")
playerActions.Add("mutevoice")
playerActions.Add("unmutevoice")
notAllowedBanConsoleCommands.Add("kick")
notAllowedBanConsoleCommands.Add("kickban")
consoleCommandsToGetServerExiled.Add("kick")
consoleCommandsToGetServerExiled.Add("kickban")
}

View File

@ -310,8 +310,8 @@ function handleIPPolicy(WebAdminQuery q)
idx = InStr(policy, ",");
if (idx == INDEX_NONE) idx = InStr(policy, ";");
q.response.subst("policy.ipmask", `HTMLEscape(Mid(policy, idx+1)));
//q.response.subst("policy.policy", `HTMLEscape(Left(policy, idx)));
q.response.subst("policy.selected", `HTMLEscape(Left(policy, idx)));
q.response.subst("policy.policy", `HTMLEscape(Left(policy, idx)));
q.response.subst("policy.selected."$Caps(Left(policy, idx)), "selected=\"selected\"");
policies $= webadmin.include(q, "policy_row.inc");
q.response.subst("policy.selected."$Caps(Left(policy, idx)), "");
}