1
0
mirror of https://github.com/RaidMax/IW4M-Admin.git synced 2025-06-10 07:13:58 -05:00

finish color code support (I think)

This commit is contained in:
RaidMax
2019-08-02 18:04:34 -05:00
parent 9cf5fad387
commit 8bd67a1629
35 changed files with 990 additions and 70 deletions

View File

@ -146,12 +146,16 @@ namespace SharedLibraryCore
}
str = Regex.Replace(str, @"(\^+((?![a-z]|[A-Z]).){0,1})+", "");
string str2 = Regex.Match(str, @"(^\/+.*$)|(^.*\/+$)")
.Value
.Replace("/", " /");
return str2.Length > 0 ? str2 : str;
return str;
}
/// <summary>
/// returns a "fixed" string that prevents message truncation in IW4 (and probably other Q3 clients)
/// </summary>
/// <param name="str"></param>
/// <returns></returns>
public static string FixIW4ForwardSlash(this string str) => Regex.Match(str, @"(^\/+.*$)|(^.*\/+$)").Value.Replace("/", " /");
/// <summary>
/// Get the IW Engine color code corresponding to an admin level
/// </summary>