Photon Plugins API Documentation
Public Member Functions | Static Public Attributes | Protected Member Functions | Properties | List of all members
Photon.Hive.Plugin.PluginBase Class Reference

Base plugin class that should be extended to make custom ones. More...

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

Public Member Functions

 PluginBase ()
 Constructor. More...
 
virtual void BeforeCloseGame (IBeforeCloseGameCallInfo info)
 Calls info.Continue(). Override to change. More...
 
virtual void BeforeJoin (IBeforeJoinGameCallInfo info)
 Calls info.Continue(). Override to change. More...
 
virtual void BeforeSetProperties (IBeforeSetPropertiesCallInfo info)
 Calls info.Continue(). Override to change. More...
 
virtual void OnCloseGame (ICloseGameCallInfo info)
 Calls info.Continue(). Override to change. More...
 
virtual void OnCreateGame (ICreateGameCallInfo info)
 Calls info.Continue(). Override to change. More...
 
virtual void OnJoin (IJoinGameCallInfo info)
 Calls info.Continue(). Override to change. More...
 
virtual void OnLeave (ILeaveGameCallInfo info)
 Calls info.Continue(). Override to change. Handles MasterClient switch if needs be. (if the leaving actor is MasterClient) More...
 
virtual void OnRaiseEvent (IRaiseEventCallInfo info)
 Calls info.Continue(). Override to change. More...
 
virtual void OnSetProperties (ISetPropertiesCallInfo info)
 Calls info.Continue(). Override to change. More...
 
virtual void OnSetPropertiesFailed (ISetPropertiesFailedCallInfo info)
 Calls info.Continue(). Override to change. More...
 
virtual bool OnUnknownType (Type type, ref object value)
 Does nothing. Override to change. More...
 
virtual bool SetupInstance (IPluginHost host, Dictionary< string, string > config, out string errorMsg)
 Initialize plugin instance. More...
 

Static Public Attributes

static Version PluginsVersion = new Version(1, 2)
 
static Version BuildVersion = new Version()
 

Protected Member Functions

virtual void OnChangeMasterClientId (int oldId, int newId)
 MasterClient change callback. More...
 
virtual void ReportError (short errorCode, Exception exception, object state)
 Does nothing. Override to change. More...
 
void BroadcastEvent (byte code, Dictionary< byte, object > data)
 Broadcast event to all actors joined to the room. More...
 

Properties

IPluginHost PluginHost [get, protected set]
 Reference to the game hosting the plugin. More...
 
string AppVersion [get]
 Version of the application to which this plugin belongs to. More...
 
string AppId [get]
 ID of the application to which this plugin belongs to. More...
 
string Region [get]
 Cloud region to which the application is connected to. More...
 
string Cloud [get]
 Type of cloud the application is connected to. Public or Enterprise. More...
 
string EnvironmentVerion [get]
 Full string environment information. More...
 
virtual 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...
 
virtual string Version [get]
 Version of the plugin. This will be returned to the client in the CreateGame operation response. More...
 
virtual bool IsPersistent [get]
 Indicates whether or not serialized room state should be persisted between sessions. More...
 
bool UseStrictMode [get, protected set]
 Indicates whether the plugin uses strict mode or not. If a plugin is in "strict mode" then all callbacks should be processed one of the available methods. If plugin version >= 1.0 then this should be true. If plugin version <= 0.9 then this should be false. More...
 
- Properties inherited from Photon.Hive.Plugin.IGamePlugin
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 plugin class that should be extended to make custom ones.

Constructor & Destructor Documentation

Photon.Hive.Plugin.PluginBase.PluginBase ( )
inline

Constructor.

Member Function Documentation

virtual void Photon.Hive.Plugin.PluginBase.BeforeCloseGame ( IBeforeCloseGameCallInfo  info)
inlinevirtual

Calls info.Continue(). Override to change.

Parameters
infoData passed in the callback call.

Implements Photon.Hive.Plugin.IGamePlugin.

virtual void Photon.Hive.Plugin.PluginBase.BeforeJoin ( IBeforeJoinGameCallInfo  info)
inlinevirtual

Calls info.Continue(). Override to change.

Parameters
infoData passed in the callback call.

Implements Photon.Hive.Plugin.IGamePlugin.

virtual void Photon.Hive.Plugin.PluginBase.BeforeSetProperties ( IBeforeSetPropertiesCallInfo  info)
inlinevirtual

Calls info.Continue(). Override to change.

Parameters
infoData passed in the callback call.

Implements Photon.Hive.Plugin.IGamePlugin.

void Photon.Hive.Plugin.PluginBase.BroadcastEvent ( byte  code,
Dictionary< byte, object >  data 
)
inlineprotected

Broadcast event to all actors joined to the room.

Parameters
codeEvent code.
dataEvent data.
virtual void Photon.Hive.Plugin.PluginBase.OnChangeMasterClientId ( int  oldId,
int  newId 
)
inlineprotectedvirtual

MasterClient change callback.

Parameters
oldIdActor number of the old MasterClient.
newIdActor number of the new MasterClient.
virtual void Photon.Hive.Plugin.PluginBase.OnCloseGame ( ICloseGameCallInfo  info)
inlinevirtual

Calls info.Continue(). Override to change.

Parameters
infoData passed in the callback call.

Implements Photon.Hive.Plugin.IGamePlugin.

virtual void Photon.Hive.Plugin.PluginBase.OnCreateGame ( ICreateGameCallInfo  info)
inlinevirtual

Calls info.Continue(). Override to change.

Parameters
infoData passed in the callback call.

Implements Photon.Hive.Plugin.IGamePlugin.

virtual void Photon.Hive.Plugin.PluginBase.OnJoin ( IJoinGameCallInfo  info)
inlinevirtual

Calls info.Continue(). Override to change.

Parameters
infoData passed in the callback call.

Implements Photon.Hive.Plugin.IGamePlugin.

virtual void Photon.Hive.Plugin.PluginBase.OnLeave ( ILeaveGameCallInfo  info)
inlinevirtual

Calls info.Continue(). Override to change. Handles MasterClient switch if needs be. (if the leaving actor is MasterClient)

Parameters
infoData passed in the callback call.

Implements Photon.Hive.Plugin.IGamePlugin.

virtual void Photon.Hive.Plugin.PluginBase.OnRaiseEvent ( IRaiseEventCallInfo  info)
inlinevirtual

Calls info.Continue(). Override to change.

Parameters
infoData passed in the callback call.

Implements Photon.Hive.Plugin.IGamePlugin.

virtual void Photon.Hive.Plugin.PluginBase.OnSetProperties ( ISetPropertiesCallInfo  info)
inlinevirtual

Calls info.Continue(). Override to change.

Parameters
infoData passed in the callback call.

Implements Photon.Hive.Plugin.IGamePlugin.

virtual void Photon.Hive.Plugin.PluginBase.OnSetPropertiesFailed ( ISetPropertiesFailedCallInfo  info)
inlinevirtual

Calls info.Continue(). Override to change.

Parameters
infoData passed in the callback call.
virtual bool Photon.Hive.Plugin.PluginBase.OnUnknownType ( Type  type,
ref object  value 
)
inlinevirtual

Does nothing. Override to change.

Parameters
typeThe Type of the object.
valueThe object with unknown type.
Returns
False.

Implements Photon.Hive.Plugin.IGamePlugin.

virtual void Photon.Hive.Plugin.PluginBase.ReportError ( short  errorCode,
Exception  exception,
object  state 
)
inlineprotectedvirtual

Does nothing. Override to change.

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

Implements Photon.Hive.Plugin.IGamePlugin.

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

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.

Implements Photon.Hive.Plugin.IGamePlugin.

Member Data Documentation

Version Photon.Hive.Plugin.PluginBase.BuildVersion = new Version()
static
Version Photon.Hive.Plugin.PluginBase.PluginsVersion = new Version(1, 2)
static

Property Documentation

string Photon.Hive.Plugin.PluginBase.AppId
get

ID of the application to which this plugin belongs to.

string Photon.Hive.Plugin.PluginBase.AppVersion
get

Version of the application to which this plugin belongs to.

string Photon.Hive.Plugin.PluginBase.Cloud
get

Type of cloud the application is connected to. Public or Enterprise.

string Photon.Hive.Plugin.PluginBase.EnvironmentVerion
get

Full string environment information.

virtual bool Photon.Hive.Plugin.PluginBase.IsPersistent
get

Indicates whether or not serialized room state should be persisted between sessions.

This is mainly related to webhooks plugin in particular.

virtual string Photon.Hive.Plugin.PluginBase.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.

IPluginHost Photon.Hive.Plugin.PluginBase.PluginHost
getprotected set

Reference to the game hosting the plugin.

string Photon.Hive.Plugin.PluginBase.Region
get

Cloud region to which the application is connected to.

bool Photon.Hive.Plugin.PluginBase.UseStrictMode
getprotected set

Indicates whether the plugin uses strict mode or not. If a plugin is in "strict mode" then all callbacks should be processed one of the available methods. If plugin version >= 1.0 then this should be true. If plugin version <= 0.9 then this should be false.

virtual string Photon.Hive.Plugin.PluginBase.Version
get

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