feat: add admin award winner command #13
Reference in New Issue
Block a user
Delete Branch "feature/admin-award-winner"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
Testing
Pull request overview
Adds an admin-only helper on
Connectionto send aGAME:AWARDcommand to the server to award a match winner.Changes:
Connection.AwardGame(int matchID, string winnerUsername)admin helper.💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
@@ -211,0 +211,4 @@public void AwardGameWinner(int matchID, string winnerUsername) {if (!IsAdmin) return;if (string.IsNullOrWhiteSpace(winnerUsername)) return;sendCommand("GAME", "AWARD:" + matchID + ":" + winnerUsername.Trim());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).