Photon Server API Documentation v5.0RC1

Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Properties | List of all members
Photon.Hive.Actor Class Reference

An actor is the glue between HivePeer and Room. In addition to the peer it has a number and Properties. More...

Inheritance diagram for Photon.Hive.Actor:
Photon.Hive.Plugin.IActor

Public Member Functions

 Actor (HivePeer peer)
 Initializes a new instance of the Actor class. More...
 
void UpdateSecure (string key, object value)
 
void Deactivate ()
 
void Reactivate (HivePeer peer)
 
void AddGroup (ActorGroup group)
 
void RemoveGroups (byte[] groupIds)
 
override string ToString ()
 
SerializableActor Serialize (bool withDebugInfo)
 
void KillInActiveActorCleanUpTimer ()
 

Static Public Member Functions

static Actor Deserialize (SerializableActor a)
 

Static Public Attributes

const byte BinrayPropertiesId = 1
 
static readonly string ActorNrKey = HiveHostActorState.ActorNr.ToString()
 
static readonly string UserIdKey = HiveHostActorState.UserId.ToString()
 
static readonly string BinaryKey = HiveHostActorState.Binary.ToString()
 
static readonly string NicknameKey = HiveHostActorState.Nickname.ToString()
 

Protected Member Functions

 Actor (int actorNr, string userId, IDictionary properties, DateTime? deactivationTime)
 

Properties

int ActorNr [get, set]
 Gets or sets the actor nr. More...
 
IDisposable CleanUpTimer [get, set]
 Reference to timer which will clean Actor after disconnect More...
 
DateTime? DeactivationTime [get, set]
 Time stamp when actor was deactivated More...
 
HivePeer Peer [get, set]
 Gets or sets the peer. More...
 
bool IsInactive [get]
 
bool IsActive [get]
 
PropertyBag< object > Properties [get]
 Gets the actors custom properties. More...
 
string UserId [get]
 
string Nickname [get]
 
object Secure [get]
 
string LastPeerInfo [get]
 
DateTime RemovedFromInactive [get, set]
 
object this[object key] [get, set]
 
- Properties inherited from Photon.Hive.Plugin.IActor
int ActorNr [get]
 Used to identify a player/peer in a game - changes with every new game instances. More...
 
PropertyBag< object > Properties [get]
 The actor's custom properties. More...
 
string UserId [get]
 Global identify a player/peer in a game. Sent in OpAuthenticate when you connect When using the CustomAuth feature it can be set in the response of the Auth request. If the UserId is set in the CustomAuth response the value sent by client is ignored. More...
 
string Nickname [get]
 Non-unique name of the player for display purposes. Equivalent to Playername in most client sdk's. Former Username in the first release of Webhooks. More...
 
bool IsActive [get]
 When disconnect Actors they gow through to phases first they are set as inactive, when the PlayerTTL elapses they are removed from the list of actors. A client can rejoin the game using its old actornr. If the room was created with the RoomOptions.CheckUserOnJoin = true setting. UserId's are only allowd to join once and on rejoin UserId and actornr have to match. The actornr on rejoin can be set to -1 then the UserId is used to match the actor. More...
 
object Secure [get]
 Now called AuthCookie. An encrypted object invisible to client, optionally returned by web service upon successful custom authentication. More...
 

Detailed Description

An actor is the glue between HivePeer and Room. In addition to the peer it has a number and Properties.

Constructor & Destructor Documentation

◆ Actor() [1/2]

Photon.Hive.Actor.Actor ( HivePeer  peer)
inline

Initializes a new instance of the Actor class.

Parameters
peerThe peer for this actor.

◆ Actor() [2/2]

Photon.Hive.Actor.Actor ( int  actorNr,
string  userId,
IDictionary  properties,
DateTime?  deactivationTime 
)
inlineprotected

Member Function Documentation

◆ AddGroup()

void Photon.Hive.Actor.AddGroup ( ActorGroup  group)
inline

◆ Deactivate()

void Photon.Hive.Actor.Deactivate ( )
inline

◆ Deserialize()

static Actor Photon.Hive.Actor.Deserialize ( SerializableActor  a)
inlinestatic

◆ KillInActiveActorCleanUpTimer()

void Photon.Hive.Actor.KillInActiveActorCleanUpTimer ( )
inline

◆ Reactivate()

void Photon.Hive.Actor.Reactivate ( HivePeer  peer)
inline

◆ RemoveGroups()

void Photon.Hive.Actor.RemoveGroups ( byte[]  groupIds)
inline

◆ Serialize()

SerializableActor Photon.Hive.Actor.Serialize ( bool  withDebugInfo)
inline

◆ ToString()

override string Photon.Hive.Actor.ToString ( )
inline

◆ UpdateSecure()

void Photon.Hive.Actor.UpdateSecure ( string  key,
object  value 
)
inline

Member Data Documentation

◆ ActorNrKey

readonly string Photon.Hive.Actor.ActorNrKey = HiveHostActorState.ActorNr.ToString()
static

◆ BinaryKey

readonly string Photon.Hive.Actor.BinaryKey = HiveHostActorState.Binary.ToString()
static

◆ BinrayPropertiesId

const byte Photon.Hive.Actor.BinrayPropertiesId = 1
static

◆ NicknameKey

readonly string Photon.Hive.Actor.NicknameKey = HiveHostActorState.Nickname.ToString()
static

◆ UserIdKey

readonly string Photon.Hive.Actor.UserIdKey = HiveHostActorState.UserId.ToString()
static

Property Documentation

◆ ActorNr

int Photon.Hive.Actor.ActorNr
getset

Gets or sets the actor nr.

◆ CleanUpTimer

IDisposable Photon.Hive.Actor.CleanUpTimer
getset

Reference to timer which will clean Actor after disconnect

◆ DeactivationTime

DateTime? Photon.Hive.Actor.DeactivationTime
getset

Time stamp when actor was deactivated

◆ IsActive

bool Photon.Hive.Actor.IsActive
get

◆ IsInactive

bool Photon.Hive.Actor.IsInactive
get

◆ LastPeerInfo

string Photon.Hive.Actor.LastPeerInfo
get

◆ Nickname

string Photon.Hive.Actor.Nickname
get

◆ Peer

HivePeer Photon.Hive.Actor.Peer
getset

Gets or sets the peer.

◆ Properties

PropertyBag<object> Photon.Hive.Actor.Properties
get

Gets the actors custom properties.

◆ RemovedFromInactive

DateTime Photon.Hive.Actor.RemovedFromInactive
getset

◆ Secure

object Photon.Hive.Actor.Secure
get

◆ this[object key]

object Photon.Hive.Actor.this[object key]
getset

◆ UserId

string Photon.Hive.Actor.UserId
get