hello
we are implemented BroadcastEvent in photon loadbalance.
we have created custom plugin and implemented PluginBase class. our game communications is working fine with my custom Event Codes and OnRaiseEvent Event.
and also i have created a function for sending event code and Data to app using this.PluginHost.BroadcastEvent.
Here is code
public void MyBroudCast (object Data, int[] reciverActor, int senderActor, byte sendEventCode)
{
Thread.Sleep(1000);
this.PluginHost.BroadcastEvent(
recieverActors: reciverActor,
senderActor: 0,
data: new Dictionary() { { 245, new JavaScriptSerializer().Serialize(Data) } },
evCode: sendEventCode,
cacheOp: 0,
sendParameters: new SendParameters() { Unreliable = false });
}
Everything is working fine but Still i'm facing some issue on BroadcastEvent
1) Why i have to use Thread.Sleep(1000); Every time on Broadcast Event. if i'm not using it my BroadCast is not working
2) Game code is not getting Events and Data in synchronization way sometime is working and sometime not
Please provide me the solution.
Thanks
Omprakash Amarwal
we are implemented BroadcastEvent in photon loadbalance.
we have created custom plugin and implemented PluginBase class. our game communications is working fine with my custom Event Codes and OnRaiseEvent Event.
and also i have created a function for sending event code and Data to app using this.PluginHost.BroadcastEvent.
Here is code
public void MyBroudCast (object Data, int[] reciverActor, int senderActor, byte sendEventCode)
{
Thread.Sleep(1000);
this.PluginHost.BroadcastEvent(
recieverActors: reciverActor,
senderActor: 0,
data: new Dictionary() { { 245, new JavaScriptSerializer().Serialize(Data) } },
evCode: sendEventCode,
cacheOp: 0,
sendParameters: new SendParameters() { Unreliable = false });
}
Everything is working fine but Still i'm facing some issue on BroadcastEvent
1) Why i have to use Thread.Sleep(1000); Every time on Broadcast Event. if i'm not using it my BroadCast is not working
2) Game code is not getting Events and Data in synchronization way sometime is working and sometime not
Please provide me the solution.
Thanks
Omprakash Amarwal