Class WolfClient
A default base wolf client implementation.
Inheritance
Namespace: TehGM.Wolfringo
Assembly: Wolfringo.Core.dll
Syntax
public class WolfClient : IWolfClient, IWolfClientCacheAccessor, IDisposable
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
Constructors
| Improve this Doc View SourceWolfClient()
Creates a new wolf client instance.
Declaration
[Obsolete("Use WolfClientBuilder instead")]
public WolfClient()
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
WolfClient(ILogger)
Creates a new wolf client instance.
Declaration
[Obsolete("Use WolfClientBuilder instead")]
public WolfClient(ILogger log)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogger | log | Logger to use with this client. If null, no messages will be logged. |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
WolfClient(ILoggerFactory)
Creates a new wolf client instance.
Declaration
[Obsolete("Use WolfClientBuilder instead")]
public WolfClient(ILoggerFactory logFactory)
Parameters
| Type | Name | Description |
|---|---|---|
| ILoggerFactory | logFactory | Logger factory to use with this client. If null, no messages will be logged. |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
WolfClient(IServiceProvider, WolfClientOptions)
Creates a new wolf client instance.
Declaration
public WolfClient(IServiceProvider services, WolfClientOptions options)
Parameters
| Type | Name | Description |
|---|---|---|
| System.IServiceProvider | services | Services provider to resolve dependencies from. |
| WolfClientOptions | options | Options for this client. |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
Properties
| Improve this Doc View SourceApiKey
API Key used to connect.
Declaration
protected string ApiKey { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
Cache
Caches container.
Declaration
protected IWolfClientCache Cache { get; set; }
Property Value
| Type | Description |
|---|---|
| IWolfClientCache |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
CallbackDispatcher
Callbacks dispatcher used by this WOLF client.
Declaration
protected MessageCallbackDispatcher CallbackDispatcher { get; }
Property Value
| Type | Description |
|---|---|
| MessageCallbackDispatcher |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
CurrentUserID
Currently logged in user. Null if not connected.
Declaration
public uint? CurrentUserID { get; protected set; }
Property Value
| Type | Description |
|---|---|
| System.Nullable<System.UInt32> |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
Device
Device to pass to the server when connecting.
Declaration
public WolfDevice Device { get; }
Property Value
| Type | Description |
|---|---|
| WolfDevice |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
DisposablesHandler
Handler for tracking services that should be disposed when this WolfClient is being disposed.
Declaration
protected DisposableServicesHandler DisposablesHandler { get; }
Property Value
| Type | Description |
|---|---|
| DisposableServicesHandler |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
IgnoreOwnChatMessages
Whether the client should skip raising events for messages it sent.
Declaration
protected bool IgnoreOwnChatMessages { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
IsConnected
Is this client currently connected?
Declaration
public bool IsConnected { get; }
Property Value
| Type | Description |
|---|---|
| System.Boolean |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
Log
Logger for all log messages.
Declaration
protected ILogger Log { get; }
Property Value
| Type | Description |
|---|---|
| ILogger |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
MessageSerializers
Message serializers mapping used when serializing and deserializing messages.
Declaration
protected ISerializerProvider<string, IMessageSerializer> MessageSerializers { get; }
Property Value
| Type | Description |
|---|---|
| ISerializerProvider<System.String, IMessageSerializer> |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
ResponseSerializers
Response serializers mapping used when deserializing responses.
Declaration
protected ISerializerProvider<Type, IResponseSerializer> ResponseSerializers { get; }
Property Value
| Type | Description |
|---|---|
| ISerializerProvider<System.Type, IResponseSerializer> |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
ResponseTypeResolver
Response type resolver used when deserializing responses.
Declaration
protected IResponseTypeResolver ResponseTypeResolver { get; }
Property Value
| Type | Description |
|---|---|
| IResponseTypeResolver |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
SocketClient
Socket client used by this WOLF client.
Declaration
protected ISocketClient SocketClient { get; }
Property Value
| Type | Description |
|---|---|
| ISocketClient |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
Token
Token used with the connection.
Declaration
protected string Token { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
Url
URL of the server.
Declaration
public string Url { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
Methods
| Improve this Doc View SourceAddMessageListener(IMessageCallback)
Adds event listener.
Declaration
public void AddMessageListener(IMessageCallback listener)
Parameters
| Type | Name | Description |
|---|---|---|
| IMessageCallback | listener | Callback to invoke on event. |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
BuildDefaultServiceProvider(ILogger)
Builds default service provider. Used to temporarily support obsolete non-builder constructors.
Declaration
[Obsolete]
protected static IServiceProvider BuildDefaultServiceProvider(ILogger log = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ILogger | log | A logger to add to the services. If null, logging will be disabled. |
Returns
| Type | Description |
|---|---|
| System.IServiceProvider | A System.IServiceProvider with default services added. |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
Clear()
Clears all connection-bound variables.
Declaration
protected virtual void Clear()
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
ConnectAsync(CancellationToken)
Connects to the server.
Declaration
public Task ConnectAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Threading.CancellationToken | cancellationToken | Token to abort entire connection. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
ConnectAsync(WolfDevice, CancellationToken)
A default base wolf client implementation.
Declaration
public async Task ConnectAsync(WolfDevice device, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| WolfDevice | device | Device to connect as. |
| System.Threading.CancellationToken | cancellationToken | Cancellation token that can be used for Task cancellation. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
DisconnectAsync(CancellationToken)
Disconnects from the server.
Declaration
public Task DisconnectAsync(CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| System.Threading.CancellationToken | cancellationToken |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
Dispose()
A default base wolf client implementation.
Declaration
public virtual void Dispose()
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken)
Internal method for handling additional actions on received message.
Declaration
protected virtual Task OnMessageReceivedAsync(IWolfMessage message, SerializedMessageData rawMessage, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| IWolfMessage | message | Received message. |
| SerializedMessageData | rawMessage | Raw received message. |
| System.Threading.CancellationToken | cancellationToken | Cancellation token that can be used for Task cancellation. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Remarks
This method is invoked after client parses current user (for welcome) and caches the entities.
OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken)
Internal method for handling additional actions on sent message.
Declaration
protected virtual Task OnMessageSentAsync(IWolfMessage message, IWolfResponse response, SerializedMessageData rawResponse, CancellationToken cancellationToken = default(CancellationToken))
Parameters
| Type | Name | Description |
|---|---|---|
| IWolfMessage | message | Sent message. |
| IWolfResponse | response | Response received. |
| SerializedMessageData | rawResponse | Raw response data. |
| System.Threading.CancellationToken | cancellationToken | Cancellation token that can be used for Task cancellation. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task |
Remarks
This method is invoked after client parses current user (for login/logout), populates chat message body data, and caches the entities.
RemoveMessageListener(IMessageCallback)
Removes event listener.
Declaration
public void RemoveMessageListener(IMessageCallback listener)
Parameters
| Type | Name | Description |
|---|---|---|
| IMessageCallback | listener | Callback to remove. |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
SendAsync<TResponse>(IWolfMessage, CancellationToken)
Sends message, and waits for response from the server.
Declaration
public async Task<TResponse> SendAsync<TResponse>(IWolfMessage message, CancellationToken cancellationToken = default(CancellationToken))
where TResponse : IWolfResponse
Parameters
| Type | Name | Description |
|---|---|---|
| IWolfMessage | message | Message to send. |
| System.Threading.CancellationToken | cancellationToken | Cancellation token that can be used for Task cancellation. |
Returns
| Type | Description |
|---|---|
| System.Threading.Tasks.Task<TResponse> | Sending response. |
Type Parameters
| Name | Description |
|---|---|
| TResponse | Response type to use for casting of response. |
Remarks
If client uses ResponseTypeResolver, the type of response provided with
ResponseTypeAttribute on message will be used for deserialization,
and TResponse will be used only for casting. If ResponseTypeAttribute is not set on
message, TResponse will be used for deserialization as normal.
Exceptions
| Type | Condition |
|---|---|
| MessageSendingException | Server responded with error. |
TryLogMessageTrace(SocketMessageEventArgs, String)
Logs socket message event with trace log level.
Declaration
protected void TryLogMessageTrace(SocketMessageEventArgs e, string keyword)
Parameters
| Type | Name | Description |
|---|---|---|
| SocketMessageEventArgs | e | Received socket event. |
| System.String | keyword | Keyword to prepend in log message, for example "Sent" or "Received". |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
TryParseCommandEvent(SocketMessage, out String, out JToken)
Tries to parse command and payload object.
Declaration
protected static bool TryParseCommandEvent(SocketMessage message, out string command, out JToken payload)
Parameters
| Type | Name | Description |
|---|---|---|
| SocketMessage | message | Received socket message. |
| System.String | command | Parsed message command; null if not a command message. |
| JToken | payload | Extracted payload. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if command parsed and is not null; otherwise false. |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
Events
| Improve this Doc View SourceConnected
Rasied when the client connects to the server.
Declaration
public event EventHandler Connected
Event Type
| Type | Description |
|---|---|
| System.EventHandler |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
Disconnected
Raised when the client disconnects from the server.
Declaration
public event EventHandler Disconnected
Event Type
| Type | Description |
|---|---|
| System.EventHandler |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
ErrorRaised
Raised when an error has occured.
Declaration
public event EventHandler<UnhandledExceptionEventArgs> ErrorRaised
Event Type
| Type | Description |
|---|---|
| System.EventHandler<System.UnhandledExceptionEventArgs> |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
MessageReceived
Raised when the client receives an event from the server.
Declaration
public event EventHandler<WolfMessageEventArgs> MessageReceived
Event Type
| Type | Description |
|---|---|
| System.EventHandler<WolfMessageEventArgs> |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
MessageSent
Raised when the client sends a message to the server.
Declaration
public event EventHandler<WolfMessageSentEventArgs> MessageSent
Event Type
| Type | Description |
|---|---|
| System.EventHandler<WolfMessageSentEventArgs> |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
Explicit Interface Implementations
| Improve this Doc View SourceIWolfClientCacheAccessor.GetCachedAchievement(WolfLanguage, UInt32)
Get achievement from cache.
Declaration
WolfAchievement IWolfClientCacheAccessor.GetCachedAchievement(WolfLanguage language, uint id)
Parameters
| Type | Name | Description |
|---|---|---|
| WolfLanguage | language | Language of achievement's translations. |
| System.UInt32 | id | ID of the achievement. |
Returns
| Type | Description |
|---|---|
| WolfAchievement | Cached achievement if found in requested language; otherwise null. |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
IWolfClientCacheAccessor.GetCachedCharm(UInt32)
Get charm from cache.
Declaration
WolfCharm IWolfClientCacheAccessor.GetCachedCharm(uint id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | id | ID of the charm. |
Returns
| Type | Description |
|---|---|
| WolfCharm | Cached charm if found; otherwise null. |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
IWolfClientCacheAccessor.GetCachedGroup(String)
Get group from cache.
Declaration
WolfGroup IWolfClientCacheAccessor.GetCachedGroup(string name)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | name | Name of the group. |
Returns
| Type | Description |
|---|---|
| WolfGroup | Cached group if found; otherwise null. |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
IWolfClientCacheAccessor.GetCachedGroup(UInt32)
Get group from cache.
Declaration
WolfGroup IWolfClientCacheAccessor.GetCachedGroup(uint id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | id | ID of the group. |
Returns
| Type | Description |
|---|---|
| WolfGroup | Cached group if found; otherwise null. |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.
IWolfClientCacheAccessor.GetCachedUser(UInt32)
Get user from cache.
Declaration
WolfUser IWolfClientCacheAccessor.GetCachedUser(uint id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.UInt32 | id | ID of the user. |
Returns
| Type | Description |
|---|---|
| WolfUser | Cached user if found; otherwise null. |
Remarks
This implementation, together with IHostedWolfClient from Wolfringo.Hosting package, is the default intended way to use Wolfringo library. It's based on message and response serializers, which combined with constructor Dependency Injection provide high degree of customizability.
Custom SocketIO client SocketClient is used by this library. This client only provides functionality required for Wolf, and may not be suitable for other scenarios.
This implementation automatically handles cache updates whenever a correct type of message or response is sent or received. For this reason, it's important to be careful when overriding OnMessageSentAsync(IWolfMessage, IWolfResponse, SerializedMessageData, CancellationToken) and OnMessageReceivedAsync(IWolfMessage, SerializedMessageData, CancellationToken), as not calling base implementation (or not implementing replacement behaviour) might cause functionality loss.