diff --git a/osu.Game/Online/Chat/StandAloneChatDisplay.cs b/osu.Game/Online/Chat/StandAloneChatDisplay.cs index 6fffb7ca7f..d8d6911eaa 100644 --- a/osu.Game/Online/Chat/StandAloneChatDisplay.cs +++ b/osu.Game/Online/Chat/StandAloneChatDisplay.cs @@ -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(); @@ -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(); });