Class ServerBuilder
Inherited Members
Namespace: SlipeServer.Server.ServerBuilders
Assembly: SlipeServer.Server.dll
Syntax
public class ServerBuilder
Constructors
| Edit this page View SourceServerBuilder(bool)
Declaration
public ServerBuilder(bool withDependencyLoaders = true)
Parameters
Type | Name | Description |
---|---|---|
bool | withDependencyLoaders |
Properties
| Edit this page View SourceConfiguration
Declaration
public Configuration Configuration { get; }
Property Value
Type | Description |
---|---|
Configuration |
Methods
| Edit this page View SourceAddBehaviour<T>(params object[])
Adds a behaviour class to the server, purely for semantics otherwise identical to InstiantiatePersistent
Declaration
public void AddBehaviour<T>(params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
object[] | parameters |
Type Parameters
Name | Description |
---|---|
T |
AddBuildStep(Action<MtaServer>, ServerBuildStepPriority)
Adds an additional build step
Declaration
public void AddBuildStep(Action<MtaServer> step, ServerBuildStepPriority priority = ServerBuildStepPriority.Default)
Parameters
Type | Name | Description |
---|---|---|
Action<MtaServer> | step | Build step |
ServerBuildStepPriority | priority | Priority of the build step, determining in what order the build steps are executed. For fine control you can cast any integer to ServerBuildStepPriority |
AddLogic(Type, params object[])
Adds a game logic class to the server, purely for semantics otherwise identical to InstiantiatePersistent
Declaration
public void AddLogic(Type type, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
Type | type | |
object[] | parameters |
AddLogic<T>(params object[])
Adds a game logic class to the server, purely for semantics otherwise identical to InstiantiatePersistent
Declaration
public void AddLogic<T>(params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
object[] | parameters |
Type Parameters
Name | Description |
---|---|
T |
AddNetWrapper(string?, string, string?, ushort?, AntiCheatConfiguration?)
Adds a networking interface
Declaration
public void AddNetWrapper(string? directory = null, string dllPath = "net", string? host = null, ushort? port = null, AntiCheatConfiguration? antiCheatConfiguration = null)
Parameters
Type | Name | Description |
---|---|---|
string | directory | directory to run in |
string | dllPath | path to the net.dll, relative to the directory |
string | host | host ip for the server |
ushort? | port | UDP port for incoming traffic to the server, this is what port players connect to |
AntiCheatConfiguration | antiCheatConfiguration | anti cheat configuration to apply on this networking interface |
AddPacketHandler<TPacketHandler, TPacket>(params object[])
Adds a packet handler
Declaration
public void AddPacketHandler<TPacketHandler, TPacket>(params object[] parameters) where TPacketHandler : IPacketHandler<TPacket> where TPacket : Packet, new()
Parameters
Type | Name | Description |
---|---|---|
object[] | parameters |
Type Parameters
Name | Description |
---|---|
TPacketHandler | |
TPacket |
AddPacketHandler<TPacketQueueHandler, TPacketHandler, TPacket>(params object[])
Adds a packet handler
Declaration
public void AddPacketHandler<TPacketQueueHandler, TPacketHandler, TPacket>(params object[] parameters) where TPacketQueueHandler : class, IPacketQueueHandler<TPacket> where TPacketHandler : IPacketHandler<TPacket> where TPacket : Packet, new()
Parameters
Type | Name | Description |
---|---|---|
object[] | parameters |
Type Parameters
Name | Description |
---|---|
TPacketQueueHandler | |
TPacketHandler | |
TPacket |
AddResourceServer<TResourceServer>(params object[])
Adds a resource server
Declaration
public void AddResourceServer<TResourceServer>(params object[] parameters) where TResourceServer : IResourceServer
Parameters
Type | Name | Description |
---|---|---|
object[] | parameters |
Type Parameters
Name | Description |
---|---|
TResourceServer |
AddScopedLogic<T>(params object[])
Adds a game scoped logic class to the server, purely for semantics otherwise identical to InstantiateScopedPersistent
Declaration
public void AddScopedLogic<T>(params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
object[] | parameters |
Type Parameters
Name | Description |
---|---|
T |
ApplyTo(MtaServer)
Applies the build steps to the MTA server
Declaration
public void ApplyTo(MtaServer server)
Parameters
Type | Name | Description |
---|---|---|
MtaServer | server |
ConfigureServices(Action<IServiceCollection>)
Configures additional dependencies for the dependecy injection container
Declaration
public void ConfigureServices(Action<IServiceCollection> action)
Parameters
Type | Name | Description |
---|---|---|
Action<IServiceCollection> | action |
InstantiatePersistent(Type, params object[])
Will instantiate a certain type using the dependency injection container Will also keep a reference to the instantiated type to prevent it from being garbage collected
Declaration
public void InstantiatePersistent(Type type, params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
Type | type | The type to instiantiate |
object[] | parameters | parameters to pass to the constructor that cannot be supplied by the dependency injection container |
InstantiatePersistent<T>(params object[])
Will instantiate a certain type using the dependency injection container Will also keep a reference to the instantiated type to prevent it from being garbage collected
Declaration
public void InstantiatePersistent<T>(params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
object[] | parameters | parameters to pass to the constructor that cannot be supplied by the dependency injection container |
Type Parameters
Name | Description |
---|---|
T | Type to instantiate |
InstantiateScopedPersistent<T>(params object[])
Will instantiate a certain type using the dependency injection container with scoped lifetime Will also keep a reference to the instantiated type to prevent it from being garbage collected
Declaration
public void InstantiateScopedPersistent<T>(params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
object[] | parameters | parameters to pass to the constructor that cannot be supplied by the dependency injection container |
Type Parameters
Name | Description |
---|---|
T | Type to instantiate |
Instantiate<T>(params object[])
Will instantiate a certain type using the dependency injection container
Declaration
public void Instantiate<T>(params object[] parameters)
Parameters
Type | Name | Description |
---|---|---|
object[] | parameters | parameters to pass to the constructor that cannot be supplied by the dependency injection container |
Type Parameters
Name | Description |
---|---|
T | Type to instantiate |
LoadDependencies(IServiceCollection)
Loads additional dependencies to the dependency injection service collection
Declaration
public void LoadDependencies(IServiceCollection services)
Parameters
Type | Name | Description |
---|---|---|
IServiceCollection | services |
UseConfiguration(Configuration)
Specifies the Configuration
instance to be used.
this should generally be the first call in a builder since this configuration may be used in other build steps.
Declaration
public void UseConfiguration(Configuration configuration)
Parameters
Type | Name | Description |
---|---|---|
Configuration | configuration |
Exceptions
Type | Condition |
---|---|
Exception |