Photon Server API Documentation v5.0RC1

Public Member Functions | Protected Attributes | Properties | List of all members
Photon.Hive.Collections.ActorsManager Class Reference
Inheritance diagram for Photon.Hive.Collections.ActorsManager:

Public Member Functions

 ActorsManager ()
 
bool TryAddPeerToGame (HiveGame game, HivePeer peer, int actorNr, out Actor actor, out bool isNewActor, out Photon.Common.ErrorCode errorcode, out string reason, JoinGameRequest joinRequest)
 Tries to add a HivePeer to this game instance. More...
 
int RemovePeerFromGame (HiveGame game, HivePeer peer, int playerTTL, bool isComingBack)
 
bool RemoveInactiveActor (HiveGame game, Actor actor)
 
void AddToExcludeList (string userId, byte reason)
 
string DumpActors ()
 
bool CheckMayAddSlots (string[] slots, int maxPlayers)
 
bool CheckMayOverrideSlots (string[] newExpectedUsersArray, int maxPlayers)
 
bool IsExpectedUser (string userId)
 
bool TryAddExpectedUsers (HiveGame hiveGame, JoinGameRequest joinRequest)
 
Actor GetActorByUserId (string userId)
 
Actor GetActorByNumber (int actorNr)
 
void DeserializeActors (IList< SerializableActor > list)
 
List< SerializableActorSerializeActors (bool withDebugInfo)
 
Actor ActorsGetActorByNumber (int actorNumber)
 Gets an actor by the actor number. More...
 
Actor ActorsGetActorByPeer (PeerBase peer)
 Gets an actor by a specified peer. More...
 
Actor ActorsGetActorByUserId (string userId)
 Gets an actor by userId. More...
 
IEnumerable< int > ActorsGetActorNumbers ()
 Gets the actor numbers of all actors in this instance as an array. More...
 
IEnumerable< ActorActorsGetActorsByNumbers (int[] actors)
 Returns all actors with the given actor numbers. More...
 
IEnumerable< ActorActorsGetExcludedList (Actor actorToExclude)
 Gets a list of actors in the room exluding a specified actor. This method can be used to get the actor list for an event, where the actor causing the event should not be notified. More...
 
IEnumerable< ActorActorsGetExcludedList (int actorToExclude)
 
IEnumerable< int > InactiveActorsGetActorNumbers ()
 
Actor InactiveActorsGetActorByNumber (int actorNr)
 
Actor InactiveActorsGetActorByUserId (string userId)
 
Actor AllActorsGetActorByNumber (int actorNr)
 
IEnumerator< ActorGetEnumerator ()
 
void DeactivateActors (HiveGame game)
 

Protected Attributes

readonly List< ActorallActors = new List<Actor>()
 

Properties

int Count [get]
 
int ActiveActorsCount [get]
 
int InactiveActorsCount [get]
 
int ActorNumberCounter [get, set]
 
List< ExcludedActorInfo >?? ExcludedActors [get, set]
 
IEnumerable< ActorAllActors [get]
 
IEnumerable< ActorActiveActors [get]
 
IEnumerable< ActorInactiveActors [get]
 
int YetExpectedUsersCount [get]
 
List< string > ExpectedUsers [get, set]
 

Constructor & Destructor Documentation

◆ ActorsManager()

Photon.Hive.Collections.ActorsManager.ActorsManager ( )
inline

Member Function Documentation

◆ ActorsGetActorByNumber()

Actor Photon.Hive.Collections.ActorsManager.ActorsGetActorByNumber ( int  actorNumber)
inline

Gets an actor by the actor number.

Parameters
actorNumberThe actor number.
Returns
Return the actor with the specified actor number if found. If no actor with the specified actor number exits null will be returned.

◆ ActorsGetActorByPeer()

Actor Photon.Hive.Collections.ActorsManager.ActorsGetActorByPeer ( PeerBase  peer)
inline

Gets an actor by a specified peer.

Parameters
peerThe peer.
Returns
Returns the actor for the specified peer or null if no actor for the specified peer was found.

◆ ActorsGetActorByUserId()

Actor Photon.Hive.Collections.ActorsManager.ActorsGetActorByUserId ( string  userId)
inline

Gets an actor by userId.

Parameters
userIdThe userId to query for.
Returns
Returns the actor for the specified userId or null if no actor was found.

◆ ActorsGetActorNumbers()

IEnumerable<int> Photon.Hive.Collections.ActorsManager.ActorsGetActorNumbers ( )
inline

Gets the actor numbers of all actors in this instance as an array.

Returns
Array of the actor numbers.

◆ ActorsGetActorsByNumbers()

IEnumerable<Actor> Photon.Hive.Collections.ActorsManager.ActorsGetActorsByNumbers ( int[]  actors)
inline

Returns all actors with the given actor numbers.

Parameters
actorsThe actor numbers.
Returns
The actors with the given actor numbers.

◆ ActorsGetExcludedList() [1/2]

IEnumerable<Actor> Photon.Hive.Collections.ActorsManager.ActorsGetExcludedList ( Actor  actorToExclude)
inline

Gets a list of actors in the room exluding a specified actor. This method can be used to get the actor list for an event, where the actor causing the event should not be notified.

Parameters
actorToExcludeThe actor to exclude.
Returns
the actors without actorToExclude

◆ ActorsGetExcludedList() [2/2]

IEnumerable<Actor> Photon.Hive.Collections.ActorsManager.ActorsGetExcludedList ( int  actorToExclude)
inline

◆ AddToExcludeList()

void Photon.Hive.Collections.ActorsManager.AddToExcludeList ( string  userId,
byte  reason 
)
inline

◆ AllActorsGetActorByNumber()

Actor Photon.Hive.Collections.ActorsManager.AllActorsGetActorByNumber ( int  actorNr)
inline

◆ CheckMayAddSlots()

bool Photon.Hive.Collections.ActorsManager.CheckMayAddSlots ( string[]  slots,
int  maxPlayers 
)
inline

◆ CheckMayOverrideSlots()

bool Photon.Hive.Collections.ActorsManager.CheckMayOverrideSlots ( string[]  newExpectedUsersArray,
int  maxPlayers 
)
inline

◆ DeactivateActors()

void Photon.Hive.Collections.ActorsManager.DeactivateActors ( HiveGame  game)
inline

◆ DeserializeActors()

void Photon.Hive.Collections.ActorsManager.DeserializeActors ( IList< SerializableActor list)
inline

◆ DumpActors()

string Photon.Hive.Collections.ActorsManager.DumpActors ( )
inline

◆ GetActorByNumber()

Actor Photon.Hive.Collections.ActorsManager.GetActorByNumber ( int  actorNr)
inline

◆ GetActorByUserId()

Actor Photon.Hive.Collections.ActorsManager.GetActorByUserId ( string  userId)
inline

◆ GetEnumerator()

IEnumerator<Actor> Photon.Hive.Collections.ActorsManager.GetEnumerator ( )
inline

◆ InactiveActorsGetActorByNumber()

Actor Photon.Hive.Collections.ActorsManager.InactiveActorsGetActorByNumber ( int  actorNr)
inline

◆ InactiveActorsGetActorByUserId()

Actor Photon.Hive.Collections.ActorsManager.InactiveActorsGetActorByUserId ( string  userId)
inline

◆ InactiveActorsGetActorNumbers()

IEnumerable<int> Photon.Hive.Collections.ActorsManager.InactiveActorsGetActorNumbers ( )
inline

◆ IsExpectedUser()

bool Photon.Hive.Collections.ActorsManager.IsExpectedUser ( string  userId)
inline

◆ RemoveInactiveActor()

bool Photon.Hive.Collections.ActorsManager.RemoveInactiveActor ( HiveGame  game,
Actor  actor 
)
inline

◆ RemovePeerFromGame()

int Photon.Hive.Collections.ActorsManager.RemovePeerFromGame ( HiveGame  game,
HivePeer  peer,
int  playerTTL,
bool  isComingBack 
)
inline

◆ SerializeActors()

List<SerializableActor> Photon.Hive.Collections.ActorsManager.SerializeActors ( bool  withDebugInfo)
inline

◆ TryAddExpectedUsers()

bool Photon.Hive.Collections.ActorsManager.TryAddExpectedUsers ( HiveGame  hiveGame,
JoinGameRequest  joinRequest 
)
inline

◆ TryAddPeerToGame()

bool Photon.Hive.Collections.ActorsManager.TryAddPeerToGame ( HiveGame  game,
HivePeer  peer,
int  actorNr,
out Actor  actor,
out bool  isNewActor,
out Photon.Common.ErrorCode  errorcode,
out string  reason,
JoinGameRequest  joinRequest 
)
inline

Tries to add a HivePeer to this game instance.

Parameters
game
peerThe peer to add.
actorNrThe actor Nr.
actorWhen this method returns this out param contains the Actor associated with the peer .
isNewActorindicates that new actor was created
errorcodeerror code if error happened
reasonreason why player can not be added
joinRequest
Returns
Returns true if no actor exists for the specified peer and a new actor for the peer has been successfully added. The actor parameter is set to the newly created Actor instance. Returns false if an actor for the specified peer already exists. The actor parameter is set to the existing Actor for the specified peer.

Member Data Documentation

◆ allActors

readonly List<Actor> Photon.Hive.Collections.ActorsManager.allActors = new List<Actor>()
protected

Property Documentation

◆ ActiveActors

IEnumerable<Actor> Photon.Hive.Collections.ActorsManager.ActiveActors
get

◆ ActiveActorsCount

int Photon.Hive.Collections.ActorsManager.ActiveActorsCount
get

◆ ActorNumberCounter

int Photon.Hive.Collections.ActorsManager.ActorNumberCounter
getset

◆ AllActors

IEnumerable<Actor> Photon.Hive.Collections.ActorsManager.AllActors
get

◆ Count

int Photon.Hive.Collections.ActorsManager.Count
get

◆ ExcludedActors

List<ExcludedActorInfo>?? Photon.Hive.Collections.ActorsManager.ExcludedActors
getset

◆ ExpectedUsers

List<string> Photon.Hive.Collections.ActorsManager.ExpectedUsers
getset

◆ InactiveActors

IEnumerable<Actor> Photon.Hive.Collections.ActorsManager.InactiveActors
get

◆ InactiveActorsCount

int Photon.Hive.Collections.ActorsManager.InactiveActorsCount
get

◆ YetExpectedUsersCount

int Photon.Hive.Collections.ActorsManager.YetExpectedUsersCount
get