flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph SharedLibraryCore
SharedLibraryCore.Utilities[[Utilities]]
end
Loading
Returns
Name
IServiceCollection
AddConfiguration
(IServiceCollection
serviceCollection, string
fileName, TConfigurationType
defaultConfig)
double``[]
AngleStuff
(Vector3
a, Vector3
b)
EFClient
AsConsoleClient
(IGameServer
server)
string
CapClientName
(string
name, int
maxLength) caps client name to the specified character length - 3 and adds ellipses to the end of the remaining client name
long
ConvertGuidToLong
(...
)
string
ConvertIPtoString
(Nullable
<int
> ip)
string
ConvertLevelToColor
(Permission
level, string
localizedLevel)
Nullable
<int
>
ConvertToIP
(string
str)
Dictionary
<string
, string
>
DictionaryFromKeyValue
(string
eventLine)
void
ExecuteAfterDelay
(...
)
Task
<string``[]
>
ExecuteCommandAsync
(...
)
string
FindRuleForReason
(string
reason, ApplicationConfiguration
appConfig, Server
server)
string
FixDirectoryCharacters
(string
path) replaces any directory separator chars with the platform specific character
Vector3
FixIW4Angles
(Vector3
vector)
string
FixIW4ForwardSlash
(string
str) returns a "fixed" string that prevents message truncation in IW4 (and probably other Q3 clients)
string
FormatExt
(string
input, object``[]
values)
string
FormatMessageForEngine
(string
str, IRConParserConfiguration
config)
string``[]
FragmentMessageForDisplay
(string
message)
long
GenerateGuidFromString
(string
value) generates a numerical hashcode from a string value
string
GetCommandLine
(int
pId)
Task
<Dvar
<T
>>
GetDvarAsync
(...
)
Task
<string
>
GetExternalIP
() retrieves the external IP address of the current running machine
Game
GetGame
(string
gameName)
Task
<IDictionary
<string
, string
>>
GetInfoAsync
(Server
server, Nullable
<TimeSpan
> delay)
string
GetLocalizedGametype
(string
input) Get the full gametype name
Task
<Dvar
<T
>>
GetMappedDvarValueOrDefaultAsync
(Server
server, string
dvarName, string
infoResponseName, IDictionary
<string
, string
> infoResponse, T
overrideDefault, CancellationToken
token)
int
GetStableHashCode
(string
str)
Task
<IStatusResponse
>
GetStatusAsync
(Server
server, CancellationToken
token)
double
GetVersionAsDouble
()
string
GetVersionAsString
()
bool
HasPermission
(...
)
string
HumanizeForCurrentCulture
(...
) wrapper method for humanizee that uses current current culture
EFClient
IW4MAdminClient
(Server
server)
bool
IsBotGuid
(string
guid) determines if the guid provided appears to be a bot guid "1277538174" - (Pluto?)WaW (T4)
bool
IsBroadcastCommand
(string
str, string
broadcastCommandPrefix)
bool
IsCodGame
(Server
server)
bool
IsInternal
(IPAddress
toTest)https://stackoverflow.com/questions/8113546/how-to-determine-whether-an-ip-address-in-private/39120248 An extension method to determine if an IP address is internal, as specified in RFC1918
bool
IsPrivileged
(EFClient
p) Helper extension that determines if a user is a privileged client
bool
IsQuickMessage
(string
message) Determines if the given message is a quick message
bool
IsRemoteLog
(string
log) indicates if the given log path is a remote (http) uri
bool
IsZombieServer
(Server
server) indicates if the given server is running a zombie game mode
PenaltyType``[]
LinkedPenaltyTypes
() returns a list of penalty types that should be shown across all profiles
string
MakeAbbreviation
(string
gameName)
Permission
MatchPermission
(string
str)
TimeSpan
ParseTimespan
(string
input)
Task
<string
>
ProcessMessageToken
(Server
server, IList
<MessageToken
> tokens, string
str)
bool
PromptBool
(string
question, string
description, bool
defaultValue) prompt user to answer a yes/no question
int
PromptInt
(string
question, string
description, int
minValue, int
maxValue, Nullable
<int
> defaultValue)
(int
Item1, T
Item2)
PromptSelection
(string
question, T
defaultValue, string
description, T``[]
selections)
string
PromptString
(string
question, string
description, string
defaultValue) prompt use to enter a string response
string
RemoveDiacritics
(string
text)
string
RemoveWords
(string
str, int
num)
Task
SetDvarAsync
(...
)
bool
ShouldHideLevel
(Permission
perm)
WebfrontTranslationHelper
[]
SplitTranslationTokens
(string
translationKey) parses translation string into tokens that are able to be formatted by the webfront
string
StripColors
(string
str) Remove all IW Engine color codes
string
ToBase64UrlSafeString
(string
src)
float
ToDegrees
(float
value)
string
ToLocalizedLevelName
(Permission
permission)
string
ToNumericalString
(...
)
EFClient
ToPartialClient
(EFClient
client)
float
ToRadians
(float
value)
string
ToStandardFormat
(...
)
string
ToTranslatedName
(MetaType
metaType)
string
TrimNewLine
(string
str) trims new line and whitespace from string
Task
<bool
>
TryCreatePenalty
(EFPenalty
penalty, IEntityService
<EFPenalty
> penaltyService, ILogger
logger)
Task
<T
>
WithTimeout
(...
)
Task
WithWaitCancellation
(...
)https://www.planetgeek.ch/2016/12/08/async-method-without-cancellation-support-do-it-my-way/
Returns
Name
string
[`g__InputOrDefault
string
[`g__InputOrDefault
Source code
public static string ToStandardFormat ( Nullable < DateTime > time )
Type
Name
Description
Nullable
<DateTime
>
time
Source code
public static string ToStandardFormat ( DateTime time )
Type
Name
Description
DateTime
time
Source code
public static EFClient IW4MAdminClient ( Server server )
Type
Name
Description
Server
server
Source code
public static EFClient AsConsoleClient ( IGameServer server )
Source code
public static string RemoveWords ( string str , int num )
Type
Name
Description
string
str
int
num
Source code
public static string CapClientName ( string name , int maxLength )
Type
Name
Description
string
name
client name
int
maxLength
max number of characters for the name
caps client name to the specified character length - 3
and adds ellipses to the end of the remaining client name
Source code
public static Permission MatchPermission ( string str )
Type
Name
Description
string
str
Source code
public static string StripColors ( string str )
Type
Name
Description
string
str
String containing color codes
Remove all IW Engine color codes
Source code
public static string FixIW4ForwardSlash ( string str )
Type
Name
Description
string
str
returns a "fixed" string that prevents message truncation in IW4 (and probably other Q3 clients)
Source code
public static string RemoveDiacritics ( string text )
Type
Name
Description
string
text
Source code
public static string FormatMessageForEngine ( string str , IRConParserConfiguration config )
Source code
public static bool IsZombieServer ( Server server )
Type
Name
Description
Server
server
indicates if the given server is running a zombie game mode
Source code
public static bool IsCodGame ( Server server )
Type
Name
Description
Server
server
Source code
public static string ConvertLevelToColor ( Permission level , string localizedLevel )
Type
Name
Description
Permission
level
string
localizedLevel
Source code
public static string ToLocalizedLevelName ( Permission permission )
Type
Name
Description
Permission
permission
Source code
public static async Task < string > ProcessMessageToken ( Server server , IList < MessageToken > tokens , string str )
Source code
public static bool IsBroadcastCommand ( string str , string broadcastCommandPrefix )
Type
Name
Description
string
str
string
broadcastCommandPrefix
Source code
public static string GetLocalizedGametype ( string input )
Type
Name
Description
string
input
Shorthand gametype reported from server
Get the full gametype name
Source code
public static long ConvertGuidToLong ( string str , NumberStyles numberStyle , Nullable < long > fallback )
Type
Name
Description
string
str
NumberStyles
numberStyle
Nullable
<long
>
fallback
Source code
public static long ConvertGuidToLong ( string str , NumberStyles numberStyle , bool convertSigned , Nullable < long > fallback )
Type
Name
Description
string
str
NumberStyles
numberStyle
bool
convertSigned
Nullable
<long
>
fallback
Source code
public static bool IsBotGuid ( string guid )
Type
Name
Description
string
guid
value of the guid
determines if the guid provided appears to be a bot guid
"1277538174" - (Pluto?)WaW (T4)
true if is bot guid, otherwise false
Source code
public static long GenerateGuidFromString ( string value )
Type
Name
Description
string
value
value string
generates a numerical hashcode from a string value
Source code
public static int GetStableHashCode ( string str )
Type
Name
Description
string
str
Source code
public static Nullable < int > ConvertToIP ( string str )
Type
Name
Description
string
str
Source code
public static string ConvertIPtoString ( Nullable < int > ip )
Type
Name
Description
Nullable
<int
>
ip
Source code
public static Game GetGame ( string gameName )
Type
Name
Description
string
gameName
Source code
public static TimeSpan ParseTimespan ( string input )
Type
Name
Description
string
input
Source code
public static bool HasPermission < TEntity , TPermission > ( IEnumerable < string > permissionsSet , TEntity entity , TPermission permission )
where TEntity : Enum
where TPermission : Enum
Type
Name
Description
IEnumerable
<string
>
permissionsSet
TEntity
entity
TPermission
permission
Source code
public static bool HasPermission < TEntity , TPermission > ( ApplicationConfiguration appConfig , Permission permissionLevel , TEntity entity , TPermission permission )
where TEntity : Enum
where TPermission : Enum
Type
Name
Description
ApplicationConfiguration
appConfig
Permission
permissionLevel
TEntity
entity
TPermission
permission
Source code
public static PenaltyType LinkedPenaltyTypes ( )
returns a list of penalty types that should be shown across all profiles
Source code
public static bool IsPrivileged ( EFClient p )
Helper extension that determines if a user is a privileged client
Source code
public static bool PromptBool ( string question , string description , bool defaultValue )
Type
Name
Description
string
question
question to prompt the user with
string
description
description of the question's value
bool
defaultValue
default value to set if no input is entered
prompt user to answer a yes/no question
Source code
public static Tuple < int , T > PromptSelection < T > ( string question , T defaultValue , string description , T [ ] selections )
where T :
Type
Name
Description
string
question
T
defaultValue
string
description
T``[]
selections
Source code
public static int PromptInt ( string question , string description , int minValue , int maxValue , Nullable < int > defaultValue )
Type
Name
Description
string
question
string
description
int
minValue
int
maxValue
Nullable
<int
>
defaultValue
Source code
public static string PromptString ( string question , string description , string defaultValue )
Type
Name
Description
string
question
question to prompt with
string
description
description of the question's value
string
defaultValue
default value to set the return value to
prompt use to enter a string response
Source code
public static Dictionary < string , string > DictionaryFromKeyValue ( string eventLine )
Type
Name
Description
string
eventLine
Source code
public static string GetCommandLine ( int pId )
Type
Name
Description
int
pId
Source code
public static bool IsRemoteLog ( string log )
Type
Name
Description
string
log
indicates if the given log path is a remote (http) uri
Source code
public static string ToBase64UrlSafeString ( string src )
Type
Name
Description
string
src
Source code
public static async Task < Dvar < T > > GetDvarAsync < T > ( Server server , string dvarName , T fallbackValue , CancellationToken token )
where T :
Type
Name
Description
Server
server
string
dvarName
T
fallbackValue
CancellationToken
token
Source code
public static async Task < Dvar < T > > GetDvarAsync < T > ( Server server , string dvarName , T fallbackValue )
where T :
Type
Name
Description
Server
server
string
dvarName
T
fallbackValue
GetMappedDvarValueOrDefaultAsync
Source code
public static async Task < Dvar < T > > GetMappedDvarValueOrDefaultAsync < T > ( Server server , string dvarName , string infoResponseName , IDictionary < string , string > infoResponse , T overrideDefault , CancellationToken token )
where T :
Type
Name
Description
Server
server
string
dvarName
string
infoResponseName
IDictionary
<string
, string
>
infoResponse
T
overrideDefault
CancellationToken
token
Source code
public static async Task SetDvarAsync ( Server server , string dvarName , object dvarValue , CancellationToken token )
Type
Name
Description
Server
server
string
dvarName
object
dvarValue
CancellationToken
token
Source code
public static async Task SetDvarAsync ( Server server , string dvarName , object dvarValue )
Type
Name
Description
Server
server
string
dvarName
object
dvarValue
ExecuteCommandAsync [1/2]
Source code
public static async Task < string > ExecuteCommandAsync ( Server server , string commandName , CancellationToken token )
Type
Name
Description
Server
server
string
commandName
CancellationToken
token
ExecuteCommandAsync [2/2]
public static async Task < string > ExecuteCommandAsync ( Server server , string commandName )
Type
Name
Description
Server
server
string
commandName
Source code
public static async Task < IStatusResponse > GetStatusAsync ( Server server , CancellationToken token )
Type
Name
Description
Server
server
CancellationToken
token
public static async Task < IDictionary < string , string > > GetInfoAsync ( Server server , Nullable < TimeSpan > delay )
Type
Name
Description
Server
server
Nullable
<TimeSpan
>
delay
Source code
public static double GetVersionAsDouble ( )
Source code
public static string GetVersionAsString ( )
Source code
public static string FormatExt ( string input , object [ ] values )
Type
Name
Description
string
input
object``[]
values
Source code
public static bool IsInternal ( IPAddress toTest )
Type
Name
Description
IPAddress
toTest
The IP address that will be tested
https://stackoverflow.com/questions/8113546/how-to-determine-whether-an-ip-address-in-private/39120248
An extension method to determine if an IP address is internal, as specified in RFC1918
Returns true if the IP is internal, false if it is external
Source code
public static async Task < string > GetExternalIP ( )
retrieves the external IP address of the current running machine
Source code
public static bool IsQuickMessage ( string message )
Type
Name
Description
string
message
Determines if the given message is a quick message
true if the
Source code
public static string TrimNewLine ( string str )
Type
Name
Description
string
str
source string
trims new line and whitespace from string
Source code
public static Vector3 FixIW4Angles ( Vector3 vector )
Type
Name
Description
Vector3
vector
Source code
public static float ToRadians ( float value )
Type
Name
Description
float
value
Source code
public static float ToDegrees ( float value )
Type
Name
Description
float
value
Source code
public static double AngleStuff ( Vector3 a , Vector3 b )
Source code
public static async Task < bool > TryCreatePenalty ( EFPenalty penalty , IEntityService < EFPenalty > penaltyService , ILogger logger )
WithWaitCancellation [1/2]
Source code
public static async Task WithWaitCancellation ( Task task , CancellationToken cancellationToken )
Type
Name
Description
Task
task
CancellationToken
cancellationToken
https://www.planetgeek.ch/2016/12/08/async-method-without-cancellation-support-do-it-my-way/
WithWaitCancellation [2/2]
Source code
public static async Task < T > WithWaitCancellation < T > ( Task < T > task , CancellationToken cancellationToken )
where T :
Type
Name
Description
Task
<T
>
task
CancellationToken
cancellationToken
Source code
public static async Task < T > WithTimeout < T > ( Task < T > task , TimeSpan timeout )
where T :
Type
Name
Description
Task
<T
>
task
TimeSpan
timeout
Source code
public static async Task WithTimeout ( Task task , TimeSpan timeout )
Type
Name
Description
Task
task
TimeSpan
timeout
Source code
public static bool ShouldHideLevel ( Permission perm )
Type
Name
Description
Permission
perm
Source code
public static WebfrontTranslationHelper SplitTranslationTokens ( string translationKey )
Type
Name
Description
string
translationKey
key for translation lookup
parses translation string into tokens that are able to be formatted by the webfront
Source code
public static string FixDirectoryCharacters ( string path )
Type
Name
Description
string
path
original file path
replaces any directory separator chars with the platform specific character
HumanizeForCurrentCulture [1/2]
Source code
public static string HumanizeForCurrentCulture ( TimeSpan timeSpan , int precision , TimeUnit maxUnit , TimeUnit minUnit , string collectionSeparator , bool toWords )
Type
Name
Description
TimeSpan
timeSpan
int
precision
TimeUnit
maxUnit
TimeUnit
minUnit
string
collectionSeparator
bool
toWords
wrapper method for humanizee that uses current current culture
HumanizeForCurrentCulture [2/2]
Source code
public static string HumanizeForCurrentCulture ( DateTime input , bool utcDate , Nullable < DateTime > dateToCompareAgainst , CultureInfo culture )
Type
Name
Description
DateTime
input
bool
utcDate
Nullable
<DateTime
>
dateToCompareAgainst
CultureInfo
culture
Source code
public static string ToTranslatedName ( MetaType metaType )
Source code
public static EFClient ToPartialClient ( EFClient client )
Source code
public static string ToNumericalString ( Nullable < int > value )
Type
Name
Description
Nullable
<int
>
value
Source code
public static string ToNumericalString ( int value )
Type
Name
Description
int
value
Source code
public static string ToNumericalString ( double value , int precision )
Type
Name
Description
double
value
int
precision
Source code
public static string ToNumericalString ( Nullable < double > value , int precision )
Type
Name
Description
Nullable
<double
>
value
int
precision
FragmentMessageForDisplay
Source code
public static string FragmentMessageForDisplay ( string message )
Type
Name
Description
string
message
Source code
public static string FindRuleForReason ( string reason , ApplicationConfiguration appConfig , Server server )
Source code
public static string MakeAbbreviation ( string gameName )
Type
Name
Description
string
gameName
Source code
public static IServiceCollection AddConfiguration < TConfigurationType > ( IServiceCollection serviceCollection , string fileName , TConfigurationType defaultConfig )
where TConfigurationType :
Type
Name
Description
IServiceCollection
serviceCollection
string
fileName
TConfigurationType
defaultConfig
Source code
public static void ExecuteAfterDelay ( TimeSpan duration , Func < CancellationToken , Task > action , CancellationToken token )
Type
Name
Description
TimeSpan
duration
Func
<CancellationToken
, Task
>
action
CancellationToken
token
Source code
public static void ExecuteAfterDelay ( int delayMs , Func < CancellationToken , Task > action , CancellationToken token )
Type
Name
Description
int
delayMs
Func
<CancellationToken
, Task
>
action
CancellationToken
token
Source code
public static void ExecuteAfterDelay ( Func < CancellationToken , Task > action , int delayMs , CancellationToken token )
Type
Name
Description
Func
<CancellationToken
, Task
>
action
int
delayMs
CancellationToken
token
Source code
internal static string < PromptInt > g__InputOrDefault| 55_0 ( )
Source code
internal static string < PromptString > g__InputOrDefault| 56_0 ( )
public static ILogger DefaultLogger { get ; set ; }
public static string OperatingDirectory { get ; }
public static TimeSpan DefaultCommandTimeout { get ; set ; }
public static char CommandPrefix { get ; set ; }
public static Dictionary < Permission , string > PermissionLevelOverrides { get ; }
public static bool IsDevelopment { get ; }
indicates if running in development mode
Generated with ModularDoc