-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
118 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
// Copyright (c) ppy Pty Ltd <[email protected]>. Licensed under the MIT Licence. | ||
// See the LICENCE file in the repository root for full licence text. | ||
|
||
using System; | ||
using System.Linq; | ||
using osu.Framework.Allocation; | ||
using osu.Framework.Bindables; | ||
|
@@ -86,12 +87,13 @@ protected override ChatLine CreateMessage(Message message) | |
var currentMatch = ladderInfo.CurrentMatch; | ||
bool isCommand = false; | ||
|
||
// Try to recognize and verify bot commmands | ||
if (currentMatch.Value != null && currentMatch.Value.Round.Value != null) | ||
// Try to recognize and verify bot commands | ||
if (currentMatch.Value?.Round.Value != null) | ||
{ | ||
isCommand = message.Content[0] == '[' && message.Content[1] == '*' && message.Content[2] == ']'; | ||
bool isRef = currentMatch.Value.Round.Value.Referees.Count != 0 | ||
&& currentMatch.Value.Round.Value.Referees.Any(p => p.OnlineID == message.SenderId); | ||
isCommand = message.Content.StartsWith("[*]", StringComparison.Ordinal); | ||
|
||
bool isRef = currentMatch.Value.Round.Value.Referees.Any(p => p.OnlineID == message.SenderId); | ||
|
||
// Automatically block duplicate messages, since we have multiple chat displays available. | ||
if ((isRef || currentMatch.Value.Round.Value.TrustAll.Value) | ||
&& isCommand && !currentMatch.Value.PendingMsgs.Any(p => p.Equals(message))) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.