How to use Photon Plugins?
Options
I use Photon 4 Plugins to extend the Game/Room behavior.
Here is how i use it:
1. I save the room data in Plugin, i think one plugin one room, is that right?
2. I override OnRaiseEvent() to deal all custom logic, and use data that was saved in the plugin.
Do i need to consider multi-threaded or Asynchronous task problem?
Here is how i use it:
1. I save the room data in Plugin, i think one plugin one room, is that right?
2. I override OnRaiseEvent() to deal all custom logic, and use data that was saved in the plugin.
Do i need to consider multi-threaded or Asynchronous task problem?
public override void OnRaiseEvent(Photon.Hive.Plugin.IRaiseEventCallInfo info) { if (info.Request.EvCode == ClientReuestTask) { //Do many task. //What will happen if i sleep here? Other room logic will stop? info.Cancel(); } else { base.OnRaiseEvent(info); } }
0
Comments
-
Hi @yinchunlong.
I am moving this thread to the Photon server subforum as this is a server side question and not specific to the native clients.0 -
Hi @yinchunlong,
1. yes one plugin instance per room.
2. totally fine.
You can read about threading in plugins here.0