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:
@ -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>
|
||||
|
Reference in New Issue
Block a user