Class CosmosNetworker
Namespace: Clavusaurus.Cosmos
Assembly: cs.temp.dll.dll
Syntax
public class CosmosNetworker
Properties
Client
Returns console client instance
Declaration
public IConsoleClient Client { get; }
Property Value
Type | Description |
---|---|
IConsoleClient |
NetworkMode
Current active network mode
Declaration
public NetworkMode NetworkMode { get; }
Property Value
Type | Description |
---|---|
NetworkMode |
Server
Returns console server instance
Declaration
public IConsoleServer Server { get; }
Property Value
Type | Description |
---|---|
IConsoleServer |
SupportsClient
Returns whether you can start this console in client-mode
Declaration
public bool SupportsClient { get; }
Property Value
Type | Description |
---|---|
Boolean |
SupportsServer
Returns whether you can start this console in server-mode
Declaration
public bool SupportsServer { get; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
StartClient(IPEndPoint, UserCredentials)
Attempt to connect to the server at the specified endpoint, if successful the console will go into client-mode
Declaration
public async Task StartClient(IPEndPoint serverEndPoint, UserCredentials credentials)
Parameters
Type | Name | Description |
---|---|---|
IPEndPoint | serverEndPoint | |
UserCredentials | credentials |
Returns
Type | Description |
---|---|
Task |
StartServer()
Change the console to server-mode, allowing remote clients to connect
Declaration
public void StartServer()
StopClient()
Stop the console client, disconnecting from the server, and return to local mode
Declaration
public void StopClient()
StopServer()
Stop the console server and return to local mode
Declaration
public void StopServer()
Events
OnCommandSenderConnectedToServerEvent
Event called when a new client connects to the server console, represented by its command sender instance
Declaration
public event Action<ICommandSender> OnCommandSenderConnectedToServerEvent
Event Type
Type | Description |
---|---|
Action<ICommandSender> |
OnCommandSenderDisconnectedFromServerEvent
Event called when a client disconnects from the server console
Declaration
public event Action<ICommandSender> OnCommandSenderDisconnectedFromServerEvent
Event Type
Type | Description |
---|---|
Action<ICommandSender> |
OnNetworkModeChangedEvent
Event called when network mode changes. Occurs when a server or client is started or stopped.
Declaration
public event Action OnNetworkModeChangedEvent
Event Type
Type | Description |
---|---|
Action |