feat: add admin award winner command #13
@@ -208,6 +208,12 @@ public partial class Connection : Node {
|
||||
sendCommand("GAME", "TERMINATE:" + matchID);
|
||||
}
|
||||
|
||||
public void AwardGameWinner(int matchID, string winnerUsername) {
|
||||
if (!IsAdmin) return;
|
||||
if (string.IsNullOrWhiteSpace(winnerUsername)) return;
|
||||
sendCommand("GAME", "AWARD:" + matchID + ":" + winnerUsername.Trim());
|
||||
|
|
||||
}
|
||||
|
||||
public void SetMoveWait(float waitTime) {
|
||||
if (!IsAdmin) return;
|
||||
CurrentWaitTimeout = waitTime;
|
||||
|
||||
Reference in New Issue
Block a user
winnerUsernameis inserted into a colon-delimited wire format ("GAME:AWARD::"). If the username contains:it will change the segment structure and can lead to malformed commands / protocol injection. Consider trimming into a local variable and rejecting (or escaping) reserved delimiter characters like:(consistent withSendConnect, which blocks:in the client id).