Empeld
Empeld plugin documentation.
pluginbase.Objects.Libs.Rpc.RpcTarget Class Reference

Class that specifies the target of an RPC class More...

Public Member Functions

override bool Equals (object obj)
 Compares two targets More...
 
override int GetHashCode ()
 Serves as a hash function for a pluginbase.Objects.Libs.Rpc.RpcTarget object. More...
 

Static Public Member Functions

static bool operator== (RpcTarget a, RpcTarget b)
 Compares two targets More...
 
static bool operator!= (RpcTarget a, RpcTarget b)
 Compares two targets More...
 
static RpcTarget Client (ushort id)
 Create a target for a specific client More...
 
static RpcTarget Client (IUser user)
 Create a target for a specific client More...
 
static RpcTarget ClientList (IEnumerable< ushort > ids)
 Create a target for a list of clients More...
 
static RpcTarget ClientList (IEnumerable< IUser > users)
 Create a target for a list of clients More...
 

Public Attributes

readonly ushort [] IdList
 The list of clients (if any) the call is targeting More...
 
readonly RpcTargetEnum Target
 The target enum More...
 

Static Public Attributes

static readonly RpcTarget Server = new RpcTarget(RpcTargetEnum.Server)
 Static that only targets the server More...
 
static readonly RpcTarget Others = new RpcTarget(RpcTargetEnum.Others)
 Static that only targets other clients More...
 
static readonly RpcTarget Everyone = new RpcTarget(RpcTargetEnum.Everyone)
 Static that targets everyone and everything. More...
 

Properties

bool IsSingleTarget [get]
 Gets a value indicating whether this instance is only targeting one client or only the server More...
 

Detailed Description

Class that specifies the target of an RPC class

Member Function Documentation

◆ Client() [1/2]

static RpcTarget pluginbase.Objects.Libs.Rpc.RpcTarget.Client ( ushort  id)
static

Create a target for a specific client

Parameters
idIdentifier.
191  {
192  return new RpcTarget(new[]{id});
193  }

◆ Client() [2/2]

static RpcTarget pluginbase.Objects.Libs.Rpc.RpcTarget.Client ( IUser  user)
static

Create a target for a specific client

Parameters
userUser.
200  {
201  return Client(user.ClientIdent);
202  }
ushort ClientIdent
The Id of the user
Definition: IUser.cs:20
static RpcTarget Client(ushort id)
Create a target for a specific client
Definition: RpcTarget.cs:190

◆ ClientList() [1/2]

static RpcTarget pluginbase.Objects.Libs.Rpc.RpcTarget.ClientList ( IEnumerable< ushort >  ids)
static

Create a target for a list of clients

Returns
The list.
Parameters
idsIdentifiers.
210  {
211  return new RpcTarget(ids);
212  }

◆ ClientList() [2/2]

static RpcTarget pluginbase.Objects.Libs.Rpc.RpcTarget.ClientList ( IEnumerable< IUser users)
static

Create a target for a list of clients

Returns
The list.
Parameters
usersUsers.
220  {
221  return ClientList(users.Select(x => x.ClientIdent));
222  }
static RpcTarget ClientList(IEnumerable< ushort > ids)
Create a target for a list of clients
Definition: RpcTarget.cs:209

◆ Equals()

override bool pluginbase.Objects.Libs.Rpc.RpcTarget.Equals ( object  obj)

Compares two targets

150  {
151  if (obj is RpcTarget)
152  {
153  return (RpcTarget)obj == this;
154  }
155  return base.Equals(obj);
156  }

◆ GetHashCode()

override int pluginbase.Objects.Libs.Rpc.RpcTarget.GetHashCode ( )

Serves as a hash function for a pluginbase.Objects.Libs.Rpc.RpcTarget object.

Returns
A hash code for this instance that is suitable for use in hashing algorithms and data structures such as a hash table.
164  {
165  return (int)Target;
166  }
readonly RpcTargetEnum Target
The target enum
Definition: RpcTarget.cs:31

◆ operator!=()

static bool pluginbase.Objects.Libs.Rpc.RpcTarget.operator!= ( RpcTarget  a,
RpcTarget  b 
)
static

Compares two targets

142  {
143  return !(a == b);
144  }

◆ operator==()

static bool pluginbase.Objects.Libs.Rpc.RpcTarget.operator== ( RpcTarget  a,
RpcTarget  b 
)
static

Compares two targets

134  {
135  return a.Target == b.Target;
136  }

Member Data Documentation

◆ Everyone

readonly RpcTarget pluginbase.Objects.Libs.Rpc.RpcTarget.Everyone = new RpcTarget(RpcTargetEnum.Everyone)
static

Static that targets everyone and everything.

◆ IdList

readonly ushort [] pluginbase.Objects.Libs.Rpc.RpcTarget.IdList

The list of clients (if any) the call is targeting

◆ Others

readonly RpcTarget pluginbase.Objects.Libs.Rpc.RpcTarget.Others = new RpcTarget(RpcTargetEnum.Others)
static

Static that only targets other clients

◆ Server

readonly RpcTarget pluginbase.Objects.Libs.Rpc.RpcTarget.Server = new RpcTarget(RpcTargetEnum.Server)
static

Static that only targets the server

◆ Target

readonly RpcTargetEnum pluginbase.Objects.Libs.Rpc.RpcTarget.Target

The target enum

Property Documentation

◆ IsSingleTarget

bool pluginbase.Objects.Libs.Rpc.RpcTarget.IsSingleTarget
get

Gets a value indicating whether this instance is only targeting one client or only the server

true if this instance is single target; otherwise, false.


The documentation for this class was generated from the following file: