Photon Server API Documentation v5.0RC1

Public Member Functions | Protected Member Functions | Properties | List of all members
Photon.LoadBalancing.GameServer.GameCache Class Reference
Inheritance diagram for Photon.LoadBalancing.GameServer.GameCache:
Photon.Hive.Caching.RoomCacheBase

Public Member Functions

 GameCache (GameApplication application)
 
- Public Member Functions inherited from Photon.Hive.Caching.RoomCacheBase
bool TryGetRoomWithoutReference (string roomId, out Room room)
 Tries to get room reference for a room with the specified id, without holding a reference to that room. More...
 
RoomReference GetRoomReference (string roomName, PeerBase ownerPeer, params object[] args)
 Gets a room reference for a room with a specified id. If the room with the specified id does not exist, a new room will be created. More...
 
List< string > GetRoomNames ()
 Returns the names of all rooms that are currently cached in this RoomCacheBase. More...
 
int GetCount ()
 Returns amount games in cache More...
 
virtual string GetDebugString (string roomName)
 Gathers debug information about the specified room (actors, peers, references etc.). More...
 
bool TryCreateRoom (string roomName, PeerBase ownerPeer, out RoomReference roomReference, params object[] args)
 Tries to create a new room. More...
 
bool TryGetRoomReference (string roomId, PeerBase ownerPeer, out RoomReference roomReference)
 Tries to get room reference for a room with the specified id. More...
 
void ReleaseRoomReference (RoomReference roomReference)
 Releases a room reference. The related room instance will be removed from the cache if no more references to the room exists. More...
 
bool TryRemoveRoomInstance (Room room)
 Tries to remove a room instance from the room cache. The room will only be removed if there are no references to the room instance left. More...
 

Protected Member Functions

override Room CreateRoom (string roomId, params object[] args)
 Must be implemented by inheritors to create new room instances. This method is called when a room reference is requested for a room that does not exist in the cache. More...
 
- Protected Member Functions inherited from Photon.Hive.Caching.RoomCacheBase
virtual void OnRoomRemoved (Room room)
 Invoked if the last reference for a room is released and the room was removed from the cache. Can be overloaded by inheritors to provide a custom cleanup logic after a room has been disposed. More...
 

Properties

GameApplication Application [get, protected set]
 
PluginManager PluginManager [get]
 

Additional Inherited Members

- Protected Attributes inherited from Photon.Hive.Caching.RoomCacheBase
readonly Dictionary< string, RoomInstanceRoomInstances = new Dictionary<string, RoomInstance>()
 A Dictionary used to store room instances. More...
 
readonly object SyncRoot = new object()
 used to synchronize access to the cache. More...
 

Constructor & Destructor Documentation

◆ GameCache()

Photon.LoadBalancing.GameServer.GameCache.GameCache ( GameApplication  application)
inline

Member Function Documentation

◆ CreateRoom()

override Room Photon.LoadBalancing.GameServer.GameCache.CreateRoom ( string  roomId,
params object[]  args 
)
inlineprotectedvirtual

Must be implemented by inheritors to create new room instances. This method is called when a room reference is requested for a room that does not exist in the cache.

Parameters
roomIdThe room id.
argsOptionally arguments used for room creation.
Returns
a new room

Implements Photon.Hive.Caching.RoomCacheBase.

Property Documentation

◆ Application

GameApplication Photon.LoadBalancing.GameServer.GameCache.Application
getprotected set

◆ PluginManager

PluginManager Photon.LoadBalancing.GameServer.GameCache.PluginManager
get