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

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 isCommingBack)
 
bool RemoveInactiveActor (HiveGame game, Actor actor)
 
void AddToExcludeList (string userId, byte reason)
 
string DumpActors ()
 
bool CheckMayAddSlots (string[] slots, int maxPlayers)
 
bool IsExpectedUser (string userId)
 
bool TryAddExpectedUsers (HiveGame hiveGame, JoinGameRequest joinRequest)
 
int TryAddExpectedUser (HiveGame hiveGame, string userId)
 
void RemoveExpectedUser (string userId)
 
Actor GetActorByUserId (string userId)
 
Actor GetActorByNumber (int actorNr)
 
void DeserializeActors (IList< SerializableActor > list)
 
List< SerializableActor > SerializeActors (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)
 
IEnumerator< ActorGetEnumerator ()
 
void DeactivateActors (HiveGame game)
 

Protected Attributes

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

Properties

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

Constructor & Destructor Documentation

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

Member Function Documentation

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.
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.
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.
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.
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.
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
IEnumerable<Actor> Photon.Hive.Collections.ActorsManager.ActorsGetExcludedList ( int  actorToExclude)
inline
void Photon.Hive.Collections.ActorsManager.AddToExcludeList ( string  userId,
byte  reason 
)
inline
bool Photon.Hive.Collections.ActorsManager.CheckMayAddSlots ( string[]  slots,
int  maxPlayers 
)
inline
void Photon.Hive.Collections.ActorsManager.DeactivateActors ( HiveGame  game)
inline
void Photon.Hive.Collections.ActorsManager.DeserializeActors ( IList< SerializableActor >  list)
inline
string Photon.Hive.Collections.ActorsManager.DumpActors ( )
inline
Actor Photon.Hive.Collections.ActorsManager.GetActorByNumber ( int  actorNr)
inline
Actor Photon.Hive.Collections.ActorsManager.GetActorByUserId ( string  userId)
inline
IEnumerator<Actor> Photon.Hive.Collections.ActorsManager.GetEnumerator ( )
inline
Actor Photon.Hive.Collections.ActorsManager.InactiveActorsGetActorByNumber ( int  actorNr)
inline
Actor Photon.Hive.Collections.ActorsManager.InactiveActorsGetActorByUserId ( string  userId)
inline
IEnumerable<int> Photon.Hive.Collections.ActorsManager.InactiveActorsGetActorNumbers ( )
inline
bool Photon.Hive.Collections.ActorsManager.IsExpectedUser ( string  userId)
inline
void Photon.Hive.Collections.ActorsManager.RemoveExpectedUser ( string  userId)
inline
bool Photon.Hive.Collections.ActorsManager.RemoveInactiveActor ( HiveGame  game,
Actor  actor 
)
inline
int Photon.Hive.Collections.ActorsManager.RemovePeerFromGame ( HiveGame  game,
HivePeer  peer,
int  playerTTL,
bool  isCommingBack 
)
inline
List<SerializableActor> Photon.Hive.Collections.ActorsManager.SerializeActors ( bool  withDebugInfo)
inline
int Photon.Hive.Collections.ActorsManager.TryAddExpectedUser ( HiveGame  hiveGame,
string  userId 
)
inline
bool Photon.Hive.Collections.ActorsManager.TryAddExpectedUsers ( HiveGame  hiveGame,
JoinGameRequest  joinRequest 
)
inline
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
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

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

Property Documentation

int Photon.Hive.Collections.ActorsManager.ActorNumberCounter
getset
IEnumerable<Actor> Photon.Hive.Collections.ActorsManager.Actors
get
int Photon.Hive.Collections.ActorsManager.ActorsCount
get
IEnumerable<Actor> Photon.Hive.Collections.ActorsManager.AllActors
get
int Photon.Hive.Collections.ActorsManager.Count
get
List<ExcludedActorInfo> Photon.Hive.Collections.ActorsManager.ExcludedActors
getset
List<string> Photon.Hive.Collections.ActorsManager.ExpectedUsers
getset
IEnumerable<Actor> Photon.Hive.Collections.ActorsManager.InactiveActors
get
int Photon.Hive.Collections.ActorsManager.InactiveActorsCount
get
int Photon.Hive.Collections.ActorsManager.YetExpectedUsersCount
get