Skip to content

Commit ca85374

Browse files
committed
allow anyone to spec afk players, to prevent possible lockup of hosts
1 parent c2d1714 commit ca85374

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

ZkLobbyServer/autohost/Commands/CmdSpec.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,5 +45,12 @@ public override async Task ExecuteArmed(ServerBattle battle, Say e)
4545

4646
await battle.SayBattle($"forcing {target ?? "AFK"} to spectator");
4747
}
48+
49+
public override RunPermission GetRunPermissions(ServerBattle battle, string userName, out string reason)
50+
{
51+
var ret = base.GetRunPermissions(battle, userName, out reason);
52+
if (target == null && ret >= RunPermission.Vote) return RunPermission.Run;
53+
return ret;
54+
}
4855
}
4956
}

0 commit comments

Comments
 (0)