Photon Plugins API Documentation v5.0RC1

Public Member Functions | Properties | List of all members
Photon.Hive.Plugin.IGamePlugin Interface Reference

Base interface that should be implemented by any plugin class. More...

Inheritance diagram for Photon.Hive.Plugin.IGamePlugin:
Photon.Hive.Plugin.ErrorPlugin Photon.Hive.Plugin.PluginBase

Public Member Functions

void BeforeCloseGame (IBeforeCloseGameCallInfo info)
 Plugin callback called when a game instance is about to be removed from Photon servers memory. More...
 
void BeforeJoin (IBeforeJoinGameCallInfo info)
 Plugin callback called when a peer is about to join a room. This is triggered by Op Join when a game instance is in Photon servers memory. More...
 
void BeforeSetProperties (IBeforeSetPropertiesCallInfo info)
 Plugin callback triggered by Op SetProperties. More...
 
void OnCloseGame (ICloseGameCallInfo info)
 Plugin callback called when info.Continue() is called inside IGamePlugin.BeforeCloseGame. More...
 
void OnCreateGame (ICreateGameCallInfo info)
 Plugin callback called when a game instance is about to be created on server. It can be triggered by Op CreateGame or Op JoinGame if JoinMode.CreateIfNotExists, JoinOrRejoin or RejoinOnly. More...
 
void OnJoin (IJoinGameCallInfo info)
 Plugin callback called when info.Continue() is called inside IGamePlugin.BeforeJoin. More...
 
void OnLeave (ILeaveGameCallInfo info)
 Plugin callback when a peer is disconnected from the room. The corresponding actor is either removed or marked as inactive. This can be triggered by an explicit or unexpected Disconnect or a call to Op Leave or RemoveActor. More...
 
void OnRaiseEvent (IRaiseEventCallInfo info)
 Plugin callback when Op RaiseEvent is called. More...
 
void OnSetProperties (ISetPropertiesCallInfo info)
 Plugin callback called when info.Continue() is called inside IGamePlugin.BeforeSetProperties. More...
 
bool OnUnknownType (Type type, ref object value)
 Callback triggered when trying to deseriliaze unknwon type. More...
 
bool SetupInstance (IPluginHost host, Dictionary< string, string > config, out string errorMsg)
 Initialize plugin instance. More...
 
void ReportError (short errorCode, Exception e, object state=null)
 Callback to report an internal plugin error. More...
 

Properties

string Name [get]
 Name of the plugin. Default is not allowed. This should be the name used when requesting the plugin from the client in CreateGame operation. This will be returned to the client in the CreateGame operation response. More...
 
string Version [get]
 Version of the plugin. This will be returned to the client in the CreateGame operation response. More...
 
bool IsPersistent [get]
 Flag used with webhooks plugin to indicate whether or not rooms should be persisted between connections. If true, SerializedGameState should be sent to web service before removing the room from memory. Also it could be loaded in OnCreateGame or BeforeJoin. More...
 

Detailed Description

Base interface that should be implemented by any plugin class.

Member Function Documentation

◆ BeforeCloseGame()

void Photon.Hive.Plugin.IGamePlugin.BeforeCloseGame ( IBeforeCloseGameCallInfo  info)

Plugin callback called when a game instance is about to be removed from Photon servers memory.

Parameters
infoData passed in the callback call.

Implemented in Photon.Hive.Plugin.PluginBase, and Photon.Hive.Plugin.ErrorPlugin.

◆ BeforeJoin()

void Photon.Hive.Plugin.IGamePlugin.BeforeJoin ( IBeforeJoinGameCallInfo  info)

Plugin callback called when a peer is about to join a room. This is triggered by Op Join when a game instance is in Photon servers memory.

Parameters
infoData passed in the callback call.

Implemented in Photon.Hive.Plugin.PluginBase, and Photon.Hive.Plugin.ErrorPlugin.

◆ BeforeSetProperties()

void Photon.Hive.Plugin.IGamePlugin.BeforeSetProperties ( IBeforeSetPropertiesCallInfo  info)

Plugin callback triggered by Op SetProperties.

Parameters
infoData passed in the callback call.

Implemented in Photon.Hive.Plugin.PluginBase, and Photon.Hive.Plugin.ErrorPlugin.

◆ OnCloseGame()

void Photon.Hive.Plugin.IGamePlugin.OnCloseGame ( ICloseGameCallInfo  info)

Plugin callback called when info.Continue() is called inside IGamePlugin.BeforeCloseGame.

Parameters
infoData passed in the callback call.

Implemented in Photon.Hive.Plugin.PluginBase, and Photon.Hive.Plugin.ErrorPlugin.

◆ OnCreateGame()

void Photon.Hive.Plugin.IGamePlugin.OnCreateGame ( ICreateGameCallInfo  info)

Plugin callback called when a game instance is about to be created on server. It can be triggered by Op CreateGame or Op JoinGame if JoinMode.CreateIfNotExists, JoinOrRejoin or RejoinOnly.

Parameters
infoData passed in the callback call.

Implemented in Photon.Hive.Plugin.PluginBase, and Photon.Hive.Plugin.ErrorPlugin.

◆ OnJoin()

void Photon.Hive.Plugin.IGamePlugin.OnJoin ( IJoinGameCallInfo  info)

Plugin callback called when info.Continue() is called inside IGamePlugin.BeforeJoin.

Parameters
infoData passed in the callback call.

Implemented in Photon.Hive.Plugin.PluginBase, and Photon.Hive.Plugin.ErrorPlugin.

◆ OnLeave()

void Photon.Hive.Plugin.IGamePlugin.OnLeave ( ILeaveGameCallInfo  info)

Plugin callback when a peer is disconnected from the room. The corresponding actor is either removed or marked as inactive. This can be triggered by an explicit or unexpected Disconnect or a call to Op Leave or RemoveActor.

Parameters
infoData passed in the callback call.

Implemented in Photon.Hive.Plugin.PluginBase, and Photon.Hive.Plugin.ErrorPlugin.

◆ OnRaiseEvent()

void Photon.Hive.Plugin.IGamePlugin.OnRaiseEvent ( IRaiseEventCallInfo  info)

Plugin callback when Op RaiseEvent is called.

Parameters
infoData passed in the callback call.

Implemented in Photon.Hive.Plugin.PluginBase, and Photon.Hive.Plugin.ErrorPlugin.

◆ OnSetProperties()

void Photon.Hive.Plugin.IGamePlugin.OnSetProperties ( ISetPropertiesCallInfo  info)

Plugin callback called when info.Continue() is called inside IGamePlugin.BeforeSetProperties.

Parameters
infoData passed in the callback call.

Implemented in Photon.Hive.Plugin.PluginBase, and Photon.Hive.Plugin.ErrorPlugin.

◆ OnUnknownType()

bool Photon.Hive.Plugin.IGamePlugin.OnUnknownType ( Type  type,
ref object  value 
)

Callback triggered when trying to deseriliaze unknwon type.

Parameters
typeThe Type of the object.
valueThe object with unknown type.
Returns
If the unkown type could be handled successfully.

Implemented in Photon.Hive.Plugin.PluginBase, and Photon.Hive.Plugin.ErrorPlugin.

◆ ReportError()

void Photon.Hive.Plugin.IGamePlugin.ReportError ( short  errorCode,
Exception  e,
object  state = null 
)

Callback to report an internal plugin error.

Parameters
errorCodeCode of the error. Photon.Hive.Plugin.ErrorCodes
eException thrown.
stateOptional object to be added in the report. It could help in debugging the error.

Implemented in Photon.Hive.Plugin.PluginBase, and Photon.Hive.Plugin.ErrorPlugin.

◆ SetupInstance()

bool Photon.Hive.Plugin.IGamePlugin.SetupInstance ( IPluginHost  host,
Dictionary< string, string >  config,
out string  errorMsg 
)

Initialize plugin instance.

Parameters
hostThe game hosting the plugin.
configThe plugin assembly key/value configuration entries.
errorMsgError message in case something wrong happens when setting up the plugin instance.
Returns
If the plugin instance setup is successful.

Implemented in Photon.Hive.Plugin.PluginBase, and Photon.Hive.Plugin.ErrorPlugin.

Property Documentation

◆ IsPersistent

bool Photon.Hive.Plugin.IGamePlugin.IsPersistent
get

Flag used with webhooks plugin to indicate whether or not rooms should be persisted between connections. If true, SerializedGameState should be sent to web service before removing the room from memory. Also it could be loaded in OnCreateGame or BeforeJoin.

◆ Name

string Photon.Hive.Plugin.IGamePlugin.Name
get

Name of the plugin. Default is not allowed. This should be the name used when requesting the plugin from the client in CreateGame operation. This will be returned to the client in the CreateGame operation response.

◆ Version

string Photon.Hive.Plugin.IGamePlugin.Version
get

Version of the plugin. This will be returned to the client in the CreateGame operation response.