Class Client
Class that implements an IClient for any sort of connection.
Inheritance
Implements
Inherited Members
Namespace: Fibula.Client
Assembly: Fibula.Client.dll
Syntax
public class Client : IClient
Constructors
| Improve this Doc View SourceClient(ILogger, IConnection)
Initializes a new instance of the Client class.
Declaration
public Client(ILogger logger, IConnection connection)
Parameters
Type | Name | Description |
---|---|---|
Serilog.ILogger | logger | A reference to the logger to use. |
IConnection | connection | The connection that this client uses. |
Properties
| Improve this Doc View SourceConnection
Gets the connection enstablished by this client.
Declaration
public IConnection Connection { get; }
Property Value
Type | Description |
---|---|
IConnection |
Information
Gets the information about the client on the other side of this connection.
Declaration
public ClientInformation Information { get; }
Property Value
Type | Description |
---|---|
ClientInformation |
IsIdle
Gets a value indicating whether this client is idle.
Declaration
public bool IsIdle { get; }
Property Value
Type | Description |
---|---|
System.Boolean |
PlayerId
Gets or sets the id of the player that this client is tied to.
Declaration
public uint PlayerId { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 |
Methods
| Improve this Doc View SourceAddKnownCreature(UInt32)
Adds the given creature to this player's known collection.
Declaration
public void AddKnownCreature(uint creatureId)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | creatureId | The id of the creature to add to the known creatures collection. |
ChooseCreatureToRemoveFromKnownSet(Int32)
Chooses a creature to remove from this player's known creatures collection, if it has reached the collection size limit.
Declaration
public uint ChooseCreatureToRemoveFromKnownSet(int skip = 0)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | skip | Optional. A number of creatures to skip during selection. Used for multiple creature picking. |
Returns
Type | Description |
---|---|
System.UInt32 | The id of the chosen creature, if any, or System.UInt32.MinValue if no creature was chosen. |
KnowsCreatureWithId(UInt32)
Checks if this player knows the given creature.
Declaration
public bool KnowsCreatureWithId(uint creatureId)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | creatureId | The id of the creature to check. |
Returns
Type | Description |
---|---|
System.Boolean | True if the player knows the creature, false otherwise. |
RemoveKnownCreature(UInt32)
Removes the given creature from this player's known collection.
Declaration
public void RemoveKnownCreature(uint creatureId)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | creatureId | The id of the creature to remove from the known creatures collection. |
Send(IEnumerable<IOutboundPacket>)
Sends the packets supplied over the Connection.
Declaration
public void Send(IEnumerable<IOutboundPacket> packetsToSend)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IEnumerable<IOutboundPacket> | packetsToSend | The packets to send. |