Show / Hide Table of Contents

Class ServerBuilder

Inheritance
object
ServerBuilder
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: SlipeServer.Server.ServerBuilders
Assembly: SlipeServer.Server.dll
Syntax
public class ServerBuilder

Constructors

| Edit this page View Source

ServerBuilder(bool)

Declaration
public ServerBuilder(bool withDependencyLoaders = true)
Parameters
Type Name Description
bool withDependencyLoaders

Properties

| Edit this page View Source

Configuration

Declaration
public Configuration Configuration { get; }
Property Value
Type Description
Configuration

Methods

| Edit this page View Source

AddBehaviour<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
| Edit this page View Source

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

| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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

| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

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
| Edit this page View Source

ApplyTo(MtaServer)

Applies the build steps to the MTA server

Declaration
public void ApplyTo(MtaServer server)
Parameters
Type Name Description
MtaServer server
| Edit this page View Source

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
| Edit this page View Source

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

| Edit this page View Source

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

| Edit this page View Source

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

| Edit this page View Source

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

| Edit this page View Source

LoadDependencies(IServiceCollection)

Loads additional dependencies to the dependency injection service collection

Declaration
public void LoadDependencies(IServiceCollection services)
Parameters
Type Name Description
IServiceCollection services
| Edit this page View Source

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

Extension Methods

LuaMapperBuilderExtensions.AddDefaultLuaMappings(ServerBuilder)
LuaMapperBuilderExtensions.AddFromLuaMapping(ServerBuilder, Func<LuaValue, object>, Type)
LuaMapperBuilderExtensions.AddFromLuaMapping<T>(ServerBuilder, Func<LuaValue, T>)
LuaMapperBuilderExtensions.AddLuaMapping(ServerBuilder, Type, Func<object, LuaValue>)
LuaMapperBuilderExtensions.AddLuaMapping<T>(ServerBuilder, Func<T, LuaValue>)
LuaMapperBuilderExtensions.AddStructLuaMapping<T>(ServerBuilder, Func<T, LuaValue>)
LuaMapperBuilderExtensions.AddVectorMappings(ServerBuilder)
DefaultServerBuilderExtensions.AddDefaultBehaviours(ServerBuilder, ServerBuilderDefaultBehaviours)
DefaultServerBuilderExtensions.AddDefaultLogging(ServerBuilder)
DefaultServerBuilderExtensions.AddDefaultNetWrapper(ServerBuilder)
DefaultServerBuilderExtensions.AddDefaultPacketHandler(ServerBuilder, ServerBuilderDefaultPacketHandlers)
DefaultServerBuilderExtensions.AddDefaultResourceInterpreters(ServerBuilder, ServerBuilderDefaultResourceInterpreters)
DefaultServerBuilderExtensions.AddDefaultServices(ServerBuilder, ServerBuilderDefaultServices, ServerBuilderDefaultMiddleware)
DefaultServerBuilderExtensions.AddDefaults(ServerBuilder, ServerBuilderDefaultPacketHandlers, ServerBuilderDefaultBehaviours, ServerBuilderDefaultServices, ServerBuilderDefaultMiddleware, ServerBuilderDefaultResourceInterpreters, bool)
DefaultServerBuilderExtensions.AddHostedDefaults(ServerBuilder, ServerBuilderDefaultPacketHandlers, ServerBuilderDefaultBehaviours, ServerBuilderDefaultMiddleware, ServerBuilderDefaultResourceInterpreters, bool)
ResourceServerBuilderExtensions.AddResourceInterpreter<TResourceInterpreter>(ServerBuilder)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX