Class DuneModule
A client module to easily hook into DuneNet's client functionality.
Implements
Inherited Members
Namespace: DuneNet.Client
Assembly: DuneNet.Client.dll
Syntax
public abstract class DuneModule : DuneBehaviour, IEventCompatible
Remarks
This is the preferable way to extend DuneNet's functionality.
Methods
OnHandshakeError(DuneConnection, String)
Overridable method called when the server rejects the authentication request.
Declaration
protected virtual void OnHandshakeError(DuneConnection conn, string error)
Parameters
Type | Name | Description |
---|---|---|
DuneConnection | conn | The connection that performed the authentication. |
System.String | error | The descriptive error the server provided as a reason for rejecting the authentication. |
OnHandshakeErrorInternal(EventArguments)
Declaration
[EventReg("OnClientAuthenticationError", NetworkContext.Client, false)]
protected void OnHandshakeErrorInternal(EventArguments args)
Parameters
Type | Name | Description |
---|---|---|
EventArguments | args |
OnHandshakeSuccessful(DuneConnection)
Overridable method called when the server accepted the authentication request.
Declaration
protected virtual void OnHandshakeSuccessful(DuneConnection conn)
Parameters
Type | Name | Description |
---|---|---|
DuneConnection | conn | The connection that performed the authentication. |
OnHandshakeSuccessfulInternal(EventArguments)
Declaration
[EventReg("OnClientAuthenticationSuccess", NetworkContext.Client, false)]
protected void OnHandshakeSuccessfulInternal(EventArguments args)
Parameters
Type | Name | Description |
---|---|---|
EventArguments | args |
OnNetBadMessage(DuneConnection)
Overridable method called when the NetworkController gets disconnected from the server because a message was invalid.
Declaration
protected virtual void OnNetBadMessage(DuneConnection conn)
Parameters
Type | Name | Description |
---|---|---|
DuneConnection | conn | The connection the error occurred in. |
OnNetBadMessageInternal(EventArguments)
Declaration
[EventReg("OnClientErrorBadMessage", NetworkContext.Client, false)]
protected void OnNetBadMessageInternal(EventArguments args)
Parameters
Type | Name | Description |
---|---|---|
EventArguments | args |
OnNetConnected(DuneConnection)
Overridable method called when the NetworkController connects to a server.
Declaration
protected virtual void OnNetConnected(DuneConnection conn)
Parameters
Type | Name | Description |
---|---|---|
DuneConnection | conn | The connection that got connected. |
OnNetConnectedInternal(EventArguments)
Declaration
[EventReg("OnClientConnect", NetworkContext.Client, false)]
protected void OnNetConnectedInternal(EventArguments args)
Parameters
Type | Name | Description |
---|---|---|
EventArguments | args |
OnNetDisconnected(DuneConnection)
Overridable method called when the NetworkController disconnects from a server.
Declaration
protected virtual void OnNetDisconnected(DuneConnection conn)
Parameters
Type | Name | Description |
---|---|---|
DuneConnection | conn | The connection that got disconnected. |
OnNetDisconnectedInternal(EventArguments)
Declaration
[EventReg("OnClientDisconnect", NetworkContext.Client, false)]
protected void OnNetDisconnectedInternal(EventArguments args)
Parameters
Type | Name | Description |
---|---|---|
EventArguments | args |
OnNetDnsFailure(DuneConnection)
Overridable method called when the NetworkController cannot resolve the FQDN provided for the connection.
Declaration
protected virtual void OnNetDnsFailure(DuneConnection conn)
Parameters
Type | Name | Description |
---|---|---|
DuneConnection | conn | The connection the error occurred in. |
OnNetDnsFailureInternal(EventArguments)
Declaration
[EventReg("OnClientErrorDNSFailure", NetworkContext.Client, false)]
protected void OnNetDnsFailureInternal(EventArguments args)
Parameters
Type | Name | Description |
---|---|---|
EventArguments | args |
OnNetErrorUnknown(DuneConnection, NetworkError)
Overridable method called when the NetworkController experiences an unknown connection error.
Declaration
protected virtual void OnNetErrorUnknown(DuneConnection conn, NetworkError error)
Parameters
Type | Name | Description |
---|---|---|
DuneConnection | conn | The connection the error occurred in. |
NetworkError | error | The connection error. |
OnNetErrorUnknownInternal(EventArguments)
Declaration
[EventReg("OnClientErrorGeneric", NetworkContext.Client, false)]
protected void OnNetErrorUnknownInternal(EventArguments args)
Parameters
Type | Name | Description |
---|---|---|
EventArguments | args |
OnNetNotReady(DuneConnection)
Overridable method called when the NetworkController is set not ready by the server.
Declaration
protected virtual void OnNetNotReady(DuneConnection conn)
Parameters
Type | Name | Description |
---|---|---|
DuneConnection | conn | The connection that was set not ready. |
OnNetNotReadyInternal(EventArguments)
Declaration
[EventReg("OnClientNotReady", NetworkContext.Client, false)]
protected void OnNetNotReadyInternal(EventArguments args)
Parameters
Type | Name | Description |
---|---|---|
EventArguments | args |
OnNetReady(DuneConnection)
Overridable method called when the NetworkController is set ready by the server.
Declaration
protected virtual void OnNetReady(DuneConnection conn)
Parameters
Type | Name | Description |
---|---|---|
DuneConnection | conn | The connection that was set ready. |
OnNetReadyInternal(EventArguments)
Declaration
[EventReg("OnClientReady", NetworkContext.Client, false)]
protected void OnNetReadyInternal(EventArguments args)
Parameters
Type | Name | Description |
---|---|---|
EventArguments | args |
OnNetTimeout(DuneConnection)
Overridable method called when the NetworkController's connection to a server times out.
Declaration
protected virtual void OnNetTimeout(DuneConnection conn)
Parameters
Type | Name | Description |
---|---|---|
DuneConnection | conn | The connection the error occurred in. |
OnNetTimeoutInternal(EventArguments)
Declaration
[EventReg("OnClientErrorTimeout", NetworkContext.Client, false)]
protected void OnNetTimeoutInternal(EventArguments args)
Parameters
Type | Name | Description |
---|---|---|
EventArguments | args |
OnSendHandshake(HandshakeRequest)
Overridable method called when the client is expected to send its authentication request to the server.
Declaration
protected virtual HandshakeRequest OnSendHandshake(HandshakeRequest previous)
Parameters
Type | Name | Description |
---|---|---|
HandshakeRequest | previous | The HandshakeRequest received from the previous module. This is never null but it may contain empty elements if this is the first module of the chain. |
Returns
Type | Description |
---|---|
HandshakeRequest | A HandshakeRequest instance to be passed onto the next module of the chain. |
Remarks
Since modules are chained together, multiple modules can be used to generate the final HandshakeRequest by modifying the previous HandshakeRequest and returning it.
OnStopUsing()
Overridable method called when the module is removed from the module chain.
Declaration
protected virtual void OnStopUsing()
OnUpdate()
Overridable method called every frame.
Declaration
protected virtual void OnUpdate()
OnUse()
Overridable method called when the module is added to the module chain.
Declaration
protected virtual void OnUse()
StartCoroutine(IEnumerator)
Starts a coroutine
Declaration
protected Coroutine StartCoroutine(IEnumerator routine)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.IEnumerator | routine |
Returns
Type | Description |
---|---|
Coroutine |