Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion osu.Game/Online/Chat/StandAloneChatDisplay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -700,12 +700,13 @@ private void postMessage(TextBox sender, bool newText)
}
else
{
void printRefsList() => EnqueueBotMessage($@"Match referees: {string.Join(", ", multiplayerRefereeTracker.Referees)}");
void printRefsList() => EnqueueBotMessage($@"Match referees: {string.Join(", ", new[] { API.LocalUser.Value }.Concat(multiplayerRefereeTracker.Referees))}");

switch (parts.Length)
{
// special-case addref. only handle it locally
case 3 when parts[1] == @"addref":
APIUser? localUser = API.LocalUser.Value;
queryUsername(parts[2]).ContinueWith(t =>
{
APIUser? user = t.GetResultSafely();
Expand All @@ -716,6 +717,12 @@ private void postMessage(TextBox sender, bool newText)
return;
}

if (user.Id == localUser.Id)
{
EnqueueBotMessage(@"You can't addref yourself. Just make sure you have the host.");
return;
}

multiplayerRefereeTracker.AddRef(user);
printRefsList();
});
Expand Down