Base interface that should be implemented as a wrapper of the game that is hosting the plugin instance. More...
Public Member Functions | |
void | BroadcastEvent (IList< int > recieverActors, int senderActor, byte evCode, Dictionary< byte, object > data, byte cacheOp, SendParameters sendParameters=new SendParameters()) |
Send event to a specific list of actors inside the room or update events cache. More... | |
void | BroadcastEvent (byte target, int senderActor, byte targetGroup, byte evCode, Dictionary< byte, object > data, byte cacheOp, SendParameters sendParameters=new SendParameters()) |
Send event to a predefined target group of actors inside the room or update events cache. More... | |
void | BroadcastErrorInfoEvent (string message, SendParameters sendParameters=new SendParameters()) |
Used to inform clients of errors. If a callInfo is available in the context of the error then the overload with info should be used. More... | |
void | BroadcastErrorInfoEvent (string message, ICallInfo info, SendParameters sendParameters=new SendParameters()) |
Used to inform clients of errors. More... | |
object | CreateOneTimeTimer (Action callback, int dueTimeMs) |
Creates a timer that triggers a callback once dueTimeMs elapses. Callbacks are called in the context the room fiber. More... | |
object | CreateOneTimeTimer (ICallInfo info, Action callback, int dueTimeMs) |
object | CreateTimer (Action callback, int dueTimeMs, int intervalMs) |
Creates a timers that triggers a callback once dueTimeMs elapses and repeats the callback every intervalMs. Callbacks are called in the context the room fiber. More... | |
SerializableGameState | GetSerializableGameState () |
The serializable game state can be used to recreate the room after it gets removed from memory. Also SetGameState. More... | |
void | HttpRequest (HttpRequest request) |
The recommend way to make http requests to external systems. The http call is completly async, but it returns the result in a fiber compatible way. There are two modes for recieving a reponse: More... | |
void | HttpRequest (HttpRequest request, ICallInfo info) |
void | LogDebug (object message) |
Add log entry at debug level. More... | |
void | LogError (object message) |
Add log entry at error level. More... | |
void | LogFatal (object message) |
Add log entry at fatal level. More... | |
void | LogInfo (object message) |
Add log entry at info level. More... | |
void | LogWarning (object message) |
Add log entry at warning level. More... | |
bool | SetGameState (SerializableGameState state) |
Assign a loaded/external game state to the room. More... | |
bool | SetProperties (int actorNr, Hashtable properties, Hashtable expected, bool broadcast) |
Set properties (well known or custom) of the room or an actor. More... | |
void | StopTimer (object timer) |
Stop a timer. More... | |
bool | RemoveActor (int actorNr, string reasonDetail) |
Remove an actor from the room's actors list and add to excluded actors list. More... | |
bool | RemoveActor (int actorNr, byte reason, string reasonDetail) |
Remove an actor from the room's actors list and add to excluded actors list. More... | |
bool | TryRegisterType (Type type, byte typeCode, Func< object, byte[]> serializeFunction, Func< byte[], object > deserializeFunction) |
Registers new types/classes for de/serialization and the fitting methods to call for this type. More... | |
EnvironmentVersion | GetEnvironmentVersion () |
Returns EnvironmentVersion object which contains version of PhotonHivePlugin at build time and currently running More... | |
IPluginLogger | CreateLogger (string name) |
void | Enqueue (Action action) |
Enqueues action into rooms fiber. this guarnties thread safe access to rooms and plugins data More... | |
bool | ExecuteCacheOperation (CacheOp operation, out string errorMsg) |
this methods allows to execute any cache operation. it can not be used to send user events to send user events use BroadcastEvent More... | |
IPluginFiber | GetRoomFiber () |
Get the reference which helps to enqueue actions to rooms fiber this reference does same as methods presenting in IPluginHost, but without need of ICallInfo and checks whether ICallInfo methods called More... | |
Properties | |
Dictionary< string, object > | Environment [get] |
Should contain game and application global properties (AppId, AppVersion, Cloud, Region, etc.) More... | |
IList< IActor > | GameActors [get] |
List of all actors in game - including active and inactive. With each actor having a flag IsInactive IActor. More... | |
IList< IActor > | GameActorsActive [get] |
List of active actors in game. More... | |
IList< IActor > | GameActorsInactive [get] |
List of inactive active actors in game. More... | |
string | GameId [get] |
Unique game identifier. Called Roomname in most client sdk's. More... | |
Hashtable | GameProperties [get] |
Game properties as set through the client per RoomOptions.CustomRoomProperties. More... | |
Dictionary< string, object > | CustomGameProperties [get] |
The game properties that are published to the lobby - as defined by clients per RoomOptions.CustomRoomPropertiesForLobby. More... | |
int | MasterClientId [get] |
The actor number of the client defined as master. If the client disconnects a new master client will be selected by photon. Changes in the master client id are notified per PluginBase.OnChangeMasterClientId. More... | |
bool | IsSuspended [get] |
bool | IsSyspended [get] |
Base interface that should be implemented as a wrapper of the game that is hosting the plugin instance.
void Photon.Hive.Plugin.IPluginHost.BroadcastErrorInfoEvent | ( | string | message, |
ICallInfo | info, | ||
SendParameters | sendParameters = new SendParameters() |
||
) |
Used to inform clients of errors.
message | error description |
info | expected to be a callInfo in the error context, used for logging purposes |
sendParameters | paramters which defines how event will be sent |
void Photon.Hive.Plugin.IPluginHost.BroadcastErrorInfoEvent | ( | string | message, |
SendParameters | sendParameters = new SendParameters() |
||
) |
Used to inform clients of errors. If a callInfo is available in the context of the error then the overload with info should be used.
message | error description |
sendParameters | paramters which defines how event will be sent |
void Photon.Hive.Plugin.IPluginHost.BroadcastEvent | ( | byte | target, |
int | senderActor, | ||
byte | targetGroup, | ||
byte | evCode, | ||
Dictionary< byte, object > | data, | ||
byte | cacheOp, | ||
SendParameters | sendParameters = new SendParameters() |
||
) |
Send event to a predefined target group of actors inside the room or update events cache.
target | The group type. ReciverGroup |
senderActor | The origin of this event.
|
targetGroup | Target interest group. |
evCode | Event code. |
data | Event data. |
cacheOp | Caching option. CacheOperations |
sendParameters | SendParameters |
void Photon.Hive.Plugin.IPluginHost.BroadcastEvent | ( | IList< int > | recieverActors, |
int | senderActor, | ||
byte | evCode, | ||
Dictionary< byte, object > | data, | ||
byte | cacheOp, | ||
SendParameters | sendParameters = new SendParameters() |
||
) |
Send event to a specific list of actors inside the room or update events cache.
recieverActors | Numbers of actors that should receive the event. |
senderActor | The origin of this event.
|
evCode | Event code. |
data | Event data. |
cacheOp | Caching option. CacheOperations |
sendParameters | SendParameters |
IPluginLogger Photon.Hive.Plugin.IPluginHost.CreateLogger | ( | string | name | ) |
object Photon.Hive.Plugin.IPluginHost.CreateOneTimeTimer | ( | Action | callback, |
int | dueTimeMs | ||
) |
Creates a timer that triggers a callback once dueTimeMs elapses. Callbacks are called in the context the room fiber.
callback | Action called when timer is triggered |
dueTimeMs | Time for callback to elapse |
object Photon.Hive.Plugin.IPluginHost.CreateOneTimeTimer | ( | ICallInfo | info, |
Action | callback, | ||
int | dueTimeMs | ||
) |
object Photon.Hive.Plugin.IPluginHost.CreateTimer | ( | Action | callback, |
int | dueTimeMs, | ||
int | intervalMs | ||
) |
Creates a timers that triggers a callback once dueTimeMs elapses and repeats the callback every intervalMs. Callbacks are called in the context the room fiber.
callback | Action called when timer is triggered |
dueTimeMs | Time for callback to elapse |
intervalMs | intervall for callbacks to be called |
void Photon.Hive.Plugin.IPluginHost.Enqueue | ( | Action | action | ) |
Enqueues action into rooms fiber. this guarnties thread safe access to rooms and plugins data
action |
bool Photon.Hive.Plugin.IPluginHost.ExecuteCacheOperation | ( | CacheOp | operation, |
out string | errorMsg | ||
) |
this methods allows to execute any cache operation. it can not be used to send user events to send user events use BroadcastEvent
operation | set of parameters to perform operation |
errorMsg | error message if any |
EnvironmentVersion Photon.Hive.Plugin.IPluginHost.GetEnvironmentVersion | ( | ) |
Returns EnvironmentVersion object which contains version of PhotonHivePlugin at build time and currently running
IPluginFiber Photon.Hive.Plugin.IPluginHost.GetRoomFiber | ( | ) |
Get the reference which helps to enqueue actions to rooms fiber this reference does same as methods presenting in IPluginHost, but without need of ICallInfo and checks whether ICallInfo methods called
SerializableGameState Photon.Hive.Plugin.IPluginHost.GetSerializableGameState | ( | ) |
The serializable game state can be used to recreate the room after it gets removed from memory. Also SetGameState.
void Photon.Hive.Plugin.IPluginHost.HttpRequest | ( | HttpRequest | request | ) |
The recommend way to make http requests to external systems. The http call is completly async, but it returns the result in a fiber compatible way. There are two modes for recieving a reponse:
request |
void Photon.Hive.Plugin.IPluginHost.HttpRequest | ( | HttpRequest | request, |
ICallInfo | info | ||
) |
void Photon.Hive.Plugin.IPluginHost.LogDebug | ( | object | message | ) |
Add log entry at debug level.
message |
void Photon.Hive.Plugin.IPluginHost.LogError | ( | object | message | ) |
Add log entry at error level.
message | message to log |
void Photon.Hive.Plugin.IPluginHost.LogFatal | ( | object | message | ) |
Add log entry at fatal level.
message | message to log |
void Photon.Hive.Plugin.IPluginHost.LogInfo | ( | object | message | ) |
Add log entry at info level.
message | message to log |
void Photon.Hive.Plugin.IPluginHost.LogWarning | ( | object | message | ) |
Add log entry at warning level.
message | message to log |
bool Photon.Hive.Plugin.IPluginHost.RemoveActor | ( | int | actorNr, |
byte | reason, | ||
string | reasonDetail | ||
) |
Remove an actor from the room's actors list and add to excluded actors list.
actorNr | The number, inside the room, of the actor to remove. |
reason | A code for the reason. RemoveActorReason |
reasonDetail | A more detailed message explaining why the actor is removed. |
bool Photon.Hive.Plugin.IPluginHost.RemoveActor | ( | int | actorNr, |
string | reasonDetail | ||
) |
Remove an actor from the room's actors list and add to excluded actors list.
actorNr | The number, inside the room, of the actor to remove. |
reasonDetail | A more detailed message explaining why the actor is removed. |
bool Photon.Hive.Plugin.IPluginHost.SetGameState | ( | SerializableGameState | state | ) |
Assign a loaded/external game state to the room.
state | serialzed state to affect to the room |
bool Photon.Hive.Plugin.IPluginHost.SetProperties | ( | int | actorNr, |
Hashtable | properties, | ||
Hashtable | expected, | ||
bool | broadcast | ||
) |
Set properties (well known or custom) of the room or an actor.
actorNr | Set to 0 if the properties belong to the room, the target actor number otherwise. |
properties | The properties to be updated. Null values to delete. Keys can be existent already or new. |
expected | The properties expected when update occurs. (CAS : "Check And Swap") |
broadcast | Indicates whether to send the PropertiesChanged event to other actors or not. |
void Photon.Hive.Plugin.IPluginHost.StopTimer | ( | object | timer | ) |
Stop a timer.
timer | The timer to stop. |
bool Photon.Hive.Plugin.IPluginHost.TryRegisterType | ( | Type | type, |
byte | typeCode, | ||
Func< object, byte[]> | serializeFunction, | ||
Func< byte[], object > | deserializeFunction | ||
) |
Registers new types/classes for de/serialization and the fitting methods to call for this type.
type | custom (class) type to register. |
typeCode | A byte-code used as shortcut during transfer of this type. |
serializeFunction | Serialization method delegate to create a byte[] from a customType instance. |
deserializeFunction | Deserliazation Method delegate to create customType instance from a byte[]. |
SerializeMethod and DeserializeMethod are complementary: Feed the product of serializeMethod to the constructor, to get a comparable instance of the object. After registering a Type, it can be used in events and operations and will be serialized like built-in types.
|
get |
The game properties that are published to the lobby - as defined by clients per RoomOptions.CustomRoomPropertiesForLobby.
|
get |
Should contain game and application global properties (AppId, AppVersion, Cloud, Region, etc.)
|
get |
List of all actors in game - including active and inactive. With each actor having a flag IsInactive IActor.
|
get |
List of active actors in game.
|
get |
List of inactive active actors in game.
|
get |
Unique game identifier. Called Roomname in most client sdk's.
|
get |
Game properties as set through the client per RoomOptions.CustomRoomProperties.
|
get |
|
get |
|
get |
The actor number of the client defined as master. If the client disconnects a new master client will be selected by photon. Changes in the master client id are notified per PluginBase.OnChangeMasterClientId.