internal static void CheckRankChangeReason( [CanBeNull] string reason, [NotNull] Player player, PlayerInfo targetInfo, bool promoting )
{
if ( player == null )
throw new ArgumentNullException( "player" );
if ( ConfigKey.RequireRankChangeReason.Enabled() && String.IsNullOrEmpty( reason ) ) {
string msg;
if ( promoting ) {
msg = "Please specify a promotion reason.";
} else {
msg = "Please specify a demotion reason.";
}
string colorMsg = "&S" + msg;
throw new PlayerOpException( player, targetInfo, PlayerOpExceptionCode.ReasonRequired, msg, colorMsg );
}
}