-
-
Notifications
You must be signed in to change notification settings - Fork 44
sharedlibrarycore Server
RaidMax edited this page May 21, 2023
·
1 revision
flowchart LR
classDef interfaceStyle stroke-dasharray: 5 5;
classDef abstractStyle stroke-width:4px
subgraph SharedLibraryCore
SharedLibraryCore.Server[[Server]]
class SharedLibraryCore.Server abstractStyle;
end
subgraph SharedLibraryCore.Interfaces
SharedLibraryCore.Interfaces.IGameServer[[IGameServer]]
class SharedLibraryCore.Interfaces.IGameServer interfaceStyle;
end
SharedLibraryCore.Interfaces.IGameServer --> SharedLibraryCore.Server
Type | Name | Methods |
---|---|---|
List <ChatInfo > |
ChatHistory |
get, protected set |
ClientHistoryInfo |
ClientHistory |
get |
int |
ClientNum |
get |
List <EFClient > |
Clients |
get, protected set |
IReadOnlyList <EFClient > |
ConnectedClients |
get |
Map |
CurrentMap |
get, set |
bool |
CustomCallback |
get, protected set |
long |
EndPoint |
get |
IEventParser |
EventParser |
get, set |
SemaphoreSlim |
EventProcessing |
get |
Game |
GameCode |
get |
Game |
GameName |
get, set |
string |
GamePassword |
get, protected set |
string |
Gametype |
get, set |
string |
GametypeName |
get |
string |
Hostname |
get, protected set |
string |
IP this is actually the listen address now |
get, protected set |
string |
Id |
get |
bool |
IsInitialized |
get, set |
bool |
IsLegacyGameIntegrationEnabled |
get |
long |
LegacyDatabaseId |
get |
string |
ListenAddress |
get |
int |
ListenPort |
get |
string |
LogPath |
get, protected set |
ILogger |
Logger |
get |
IManager |
Manager |
get, protected set |
Map |
Map |
get |
List <Map > |
Maps |
get, protected set |
Nullable <DateTime > |
MatchEndTime |
get, protected set |
Nullable <DateTime > |
MatchStartTime |
get, protected set |
int |
MaxClients |
get, protected set |
string |
Password |
get |
string |
PerformanceBucket |
get, init |
int |
Port |
get, protected set |
int |
PrivateClientSlots |
get, protected set |
IRConParser |
RconParser |
get, set |
IRConConnection |
RemoteConnection |
get, protected set |
List <Report > |
Reports |
get, set |
IPEndPoint |
ResolvedIpEndPoint |
get, protected set |
bool |
RestartRequested |
get, set |
ServerConfiguration |
ServerConfig |
get |
string |
ServerName |
get |
bool |
Throttled |
get, protected set |
string |
Version |
get, protected set |
string |
Website |
get, protected set |
string |
WorkingDirectory |
get, protected set |
Returns | Name |
---|---|
Task |
Ban (string reason, EFClient target, EFClient origin, bool isEvade)Perm ban a player from the server |
GameEvent |
Broadcast (... )Send a message to all players |
Task |
BroadcastAsync (IEnumerable <string > messages, EFClient sender, CancellationToken token) |
Task <string``[] > |
ExecuteCommandAsync (string command, CancellationToken token) |
Task |
ExecuteEvent (GameEvent E) |
List <EFClient > |
GetClientByName (string pName)Get a player by name todo: make this an extension |
EFClient |
GetClientByNumber (int clientNumber) |
List <EFClient > |
GetClientsAsList ()Returns list of all current players |
Task <long > |
GetIdForServer (Server server) |
void |
InitializeTokens ()Initalize the macro variables |
Task |
Kick (... ) |
Task |
LoadMap (string mapName)Change the current server map |
Task <EFClient > |
OnClientConnected (EFClient P)Add a player to the server's player list |
Task |
OnClientDisconnected (EFClient client)Remove player by client number |
Task <bool > |
ProcessUpdatesAsync (CancellationToken token) |
Task |
SetDvarAsync (string name, object value, CancellationToken token) |
Task |
TempBan (string reason, TimeSpan length, EFClient target, EFClient origin)Temporarily ban a player ( default 1 hour ) from the server |
void |
ToAdmins (string message)Send a message to all admins on the server |
string |
ToString () |
Task |
Unban (string reason, EFClient targetClient, EFClient originClient)Unban a player by npID / GUID |
Task |
Warn (string reason, EFClient target, EFClient origin) |
Returns | Name |
---|---|
void |
InitializeAutoMessages ()Initialize the messages to be broadcasted |
Task <bool > |
ProcessEvent (GameEvent E)Process any server event |
Task <bool > |
ScriptLoaded () |
Task |
Tell (string message, EFClient targetClient)Send a message to a particular players |
Game
public Server(ILogger<Server> logger, ILogger deprecatedLogger, ServerConfiguration config, IManager mgr, IRConConnectionFactory rconConnectionFactory, IGameLogReaderFactory gameLogReaderFactory, IServiceProvider serviceProvider)
Type | Name | Description |
---|---|---|
ILogger <Server > |
logger | |
ILogger |
deprecatedLogger | |
ServerConfiguration |
config | |
IManager |
mgr | |
IRConConnectionFactory |
rconConnectionFactory | |
IGameLogReaderFactory |
gameLogReaderFactory | |
IServiceProvider |
serviceProvider |
public abstract Task Kick(string reason, EFClient target, EFClient origin, EFPenalty originalPenalty)
Type | Name | Description |
---|---|---|
string |
reason | |
EFClient |
target | |
EFClient |
origin | |
EFPenalty |
originalPenalty |
public abstract Task<string> ExecuteCommandAsync(string command, CancellationToken token)
Type | Name | Description |
---|---|---|
string |
command | |
CancellationToken |
token |
public abstract Task SetDvarAsync(string name, object value, CancellationToken token)
Type | Name | Description |
---|---|---|
string |
name | |
object |
value | |
CancellationToken |
token |
public List<EFClient> GetClientsAsList()
Returns list of all current players
public abstract Task<EFClient> OnClientConnected(EFClient P)
Type | Name | Description |
---|---|---|
EFClient |
P | EFClient pulled from memory reading |
Add a player to the server's player list
True if player added successfully, false otherwise
public abstract Task OnClientDisconnected(EFClient client)
Type | Name | Description |
---|---|---|
EFClient |
client |
Remove player by client number
true if removal succeeded, false otherwise
public List<EFClient> GetClientByName(string pName)
Type | Name | Description |
---|---|---|
string |
pName | EFClient name to search for |
Get a player by name todo: make this an extension
Matching player if found
public virtual Task<bool> ProcessUpdatesAsync(CancellationToken token)
Type | Name | Description |
---|---|---|
CancellationToken |
token |
protected abstract Task<bool> ProcessEvent(GameEvent E)
Type | Name | Description |
---|---|---|
GameEvent |
E | Event |
Process any server event
True on sucess
public abstract Task ExecuteEvent(GameEvent E)
Type | Name | Description |
---|---|---|
GameEvent |
E |
public GameEvent Broadcast(string message, EFClient sender)
Type | Name | Description |
---|---|---|
string |
message | Message to be sent to all players |
EFClient |
sender | Client that initiated the broadcast |
Send a message to all players
public void Broadcast(IEnumerable<string> messages, EFClient sender)
Type | Name | Description |
---|---|---|
IEnumerable <string > |
messages | |
EFClient |
sender |
public async Task BroadcastAsync(IEnumerable<string> messages, EFClient sender, CancellationToken token)
Type | Name | Description |
---|---|---|
IEnumerable <string > |
messages | |
EFClient |
sender | |
CancellationToken |
token |
protected async Task Tell(string message, EFClient targetClient)
Type | Name | Description |
---|---|---|
string |
message | Message to send |
EFClient |
targetClient | EFClient to send message to |
Send a message to a particular players
public void ToAdmins(string message)
Type | Name | Description |
---|---|---|
string |
message | Message to send out |
Send a message to all admins on the server
public Task Kick(string reason, EFClient target, EFClient origin)
Type | Name | Description |
---|---|---|
string |
reason | Reason for kicking |
EFClient |
target | EFClient to kick |
EFClient |
origin | Client initating the kick |
Kick a player from the server
public abstract Task TempBan(string reason, TimeSpan length, EFClient target, EFClient origin)
Type | Name | Description |
---|---|---|
string |
reason | Reason for banning the player |
TimeSpan |
length | Duration of the ban |
EFClient |
target | The client to ban |
EFClient |
origin | The client performing the ban |
Temporarily ban a player ( default 1 hour ) from the server
public abstract Task Ban(string reason, EFClient target, EFClient origin, bool isEvade)
Type | Name | Description |
---|---|---|
string |
reason | The reason for the ban |
EFClient |
target | The person to ban |
EFClient |
origin | The person who banned the target |
bool |
isEvade | obsolete |
Perm ban a player from the server
public abstract Task Warn(string reason, EFClient target, EFClient origin)
Type | Name | Description |
---|---|---|
string |
reason | |
EFClient |
target | |
EFClient |
origin |
public abstract Task Unban(string reason, EFClient targetClient, EFClient originClient)
Type | Name | Description |
---|---|---|
string |
reason | reason for unban |
EFClient |
targetClient | client being unbanned |
EFClient |
originClient | client performing the unban |
Unban a player by npID / GUID
public async Task LoadMap(string mapName)
Type | Name | Description |
---|---|---|
string |
mapName | Non-localized map name |
Change the current server map
public abstract void InitializeTokens()
Initalize the macro variables
protected void InitializeAutoMessages()
Initialize the messages to be broadcasted
public override string ToString()
protected async Task<bool> ScriptLoaded()
public abstract Task<long> GetIdForServer(Server server)
Type | Name | Description |
---|---|---|
Server |
server |
public EFClient GetClientByNumber(int clientNumber)
Type | Name | Description |
---|---|---|
int |
clientNumber |
public long EndPoint { get; }
public abstract long LegacyDatabaseId { get; }
public virtual string Id { get; }
public IManager Manager { get; protected set; }
public ILogger Logger { get; }
public ServerConfiguration ServerConfig { get; }
public List<Map> Maps { get; protected set; }
public List<Report> Reports { get; set; }
public List<ChatInfo> ChatHistory { get; protected set; }
public ClientHistoryInfo ClientHistory { get; }
public Game GameName { get; set; }
public virtual Game GameCode { get; }
public Nullable<DateTime> MatchEndTime { get; protected set; }
public Nullable<DateTime> MatchStartTime { get; protected set; }
public string Hostname { get; protected set; }
public virtual string ServerName { get; }
public string Website { get; protected set; }
public string Gametype { get; set; }
public string GametypeName { get; }
public string GamePassword { get; protected set; }
public int PrivateClientSlots { get; protected set; }
public Map CurrentMap { get; set; }
public virtual Map Map { get; }
public int ClientNum { get; }
public int MaxClients { get; protected set; }
public List<EFClient> Clients { get; protected set; }
public virtual IReadOnlyList<EFClient> ConnectedClients { get; }
public string Password { get; }
public bool Throttled { get; protected set; }
public bool CustomCallback { get; protected set; }
public virtual bool IsLegacyGameIntegrationEnabled { get; }
public string WorkingDirectory { get; protected set; }
public IRConConnection RemoteConnection { get; protected set; }
public IRConParser RconParser { get; set; }
public IEventParser EventParser { get; set; }
public string LogPath { get; protected set; }
public bool RestartRequested { get; set; }
public SemaphoreSlim EventProcessing { get; }
public string IP { get; protected set; }
this is actually the listen address now
public virtual string ListenAddress { get; }
public IPEndPoint ResolvedIpEndPoint { get; protected set; }
public string Version { get; protected set; }
public bool IsInitialized { get; set; }
public int Port { get; protected set; }
public virtual int ListenPort { get; }
public string PerformanceBucket { get; init; }
Generated with ModularDoc