Skip to content

Commit

Permalink
Add Logging For Assigned Teams
Browse files Browse the repository at this point in the history
  • Loading branch information
Deaod committed Apr 6, 2024
1 parent d668d7d commit 78cabc3
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions Classes/NewCTF.uc
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ function ParseAssignedTeamConfig(string Cfg) {

Cfg = Mid(Cfg, Pos + 1);
}

LogLine("Assigned Team Config:");
LogIndent();
for (Index = 0; Index < NumAssignedPlayers; Index += 1) {
LogLine("Player:"@AssignedPlayer[Index].PlayerName$", Pass:"@AssignedPlayer[Index].Pass$", Team:"@AssignedPlayer[Index].Team);
}
LogUnindent();
}

function ParseAssignment(string Part, int Team) {
Expand Down Expand Up @@ -419,6 +426,8 @@ event PlayerPawn Login(
Options = Options$"?OverrideClass=Botpack.CHSpectator";
}
LogLine("Login Options:"@Options);
bPlayerInit = true;
Result = super.Login(Portal, Options, Error, SpawnClass);
bPlayerInit = false;
Expand Down Expand Up @@ -1009,15 +1018,23 @@ function float GetFlagTimeout() {
}
function bool ChangeTeam(Pawn Other, int NewTeam) {
local bool Result;
if (bAllowChangingTeams || bPlayerInit) {
return super.ChangeTeam(Other, NewTeam);
Result = super.ChangeTeam(Other, NewTeam);
LogLine("ChangeTeam - Allowed - "@Result);
return Result;
}
LogLine("ChangeTeam - Forbidden");
return false;
}
function ChangeName(Pawn Other, string S, bool bNameChange) {
if (bAllowChangingNames || bPlayerInit)
if (bAllowChangingNames || bPlayerInit) {
super.ChangeName(Other, S, bNameChange);
LogLine("ChangeTeam - Allowed - "@S);
return;
}
LogLine("ChangeName - Forbidden");
}
function LogLine(coerce string S) {
Expand Down

0 comments on commit 78cabc3

Please sign in to comment.