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

add ability to register custom event generators for event parsers / truncate long client names fix

This commit is contained in:
RaidMax
2020-04-04 12:40:23 -05:00
parent d45d99454b
commit 3b695a0d2c
24 changed files with 334 additions and 69 deletions

View File

@ -94,6 +94,18 @@ namespace SharedLibraryCore
return newStr;
}
/// <summary>
/// caps client name to the specified character length - 3
/// and adds ellipses to the end of the reamining client name
/// </summary>
/// <param name="str">client name</param>
/// <param name="maxLength">max number of characters for the name</param>
/// <returns></returns>
public static string CapClientName(this string str, int maxLength) =>
str.Length > maxLength ?
$"{str.Substring(0, maxLength - 3)}..." :
str;
/// <summary>
/// helper method to get the information about an exception and inner exceptions
/// </summary>