my project
are having problems:
2020-09-06 09:44:37,285 [16] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - UnhandledException:'Name:PhotonPlugin, Version:1.0 AppId:440A-6127-B81C-3D99-E133-6DFE, AppVersion:'. Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Photon.SocketServer.Rpc.Protocols.GpBinaryByte.GpBinaryByteWriter.WriteCustomType(IBinaryWriter writer, CustomTypeInfo customTypeInfo, Object value) in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\Rpc\Protocols\GpBinaryByte\GpBinaryByteWriter.cs:line 561
at Photon.SocketServer.Rpc.Protocols.GpBinaryByte.GpBinaryByteWriter.Write(IBinaryWriter writer, Object value, Boolean setType, CustomTypeCache privateCustomTypeCache, Int32 depth) in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\Rpc\Protocols\GpBinaryByte\GpBinaryByteWriter.cs:line 291
at Photon.SocketServer.Rpc.Protocols.GpBinaryByte.GpBinaryByteWriter.WriteEventData(IBinaryWriter binaryWriter, IEventData eventData, CustomTypeCache privateCustomTypeCache) in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\Rpc\Protocols\GpBinaryByte\GpBinaryByteWriter.cs:line 79
at Photon.SocketServer.Rpc.Protocols.GpBinaryByte.GpBinaryByteProtocolV16.SerializeEventData(EventData eventData, CustomTypeCache privateCustomTypeCache) in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\Rpc\Protocols\GpBinaryByte\GpBinaryByteProtocolV16.cs:line 151
at Photon.SocketServer.ApplicationBase.BroadCastEvent[TPeer](IEventData eventData, IEnumerable`1 peers, SendParameters sendParameters) in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\ApplicationBase.cs:line 357
at Photon.Hive.HiveHostGame.BroadcastEventInternal(Byte evCode, Dictionary`2 data, Byte cacheOp, Boolean updateEventCache, Int32 senderActor, IEnumerable`1 actors, SendParameters sendParameters) in d:\dev\photon-socketserver-sdk_cloud\src-server\Hive\PhotonHive\HiveHostGame.cs:line 396
at Photon.Hive.Plugin.PluginBase.BroadcastEvent(Byte code, Dictionary`2 data) in d:\dev\photon-socketserver-sdk_cloud\src-server\HivePlugin\PluginBase.cs:line 594
at MobaOnline.MobaOnline.ScheduledEvent() in F:\Photon\Photon-OnPremise-Server-Plugin-SDK_v4-0-29-11263\src-server\Plugins\MobaOnline\MobaOnline.cs:line 76
at Photon.Hive.HiveHostGame.<>c__DisplayClass36.<GetTimerAction>b__35() in d:\dev\photon-socketserver-sdk_cloud\src-server\Hive\PhotonHive\HiveHostGame.cs:line 426
I have followed the instructions of the doc photon ,
logic sever:
public override bool SetupInstance(IPluginHost host, Dictionary<string, string> config, out string errorMsg)
{
host.TryRegisterType(typeof(PlayerInfos), (byte)'a', MyCustomType.SerializeCustomPluginType, MyCustomType.DeserializeCustomPluginType);
return base.SetupInstance(host, config, out errorMsg);
}
private void ScheduledEvent()
{
PlayerInfos playerInfos = new PlayerInfos();
playerInfos.HP = 111; playerInfos.MP = 100;
Dictionary<byte, object> dic_data = new Dictionary<byte, object>();
dic_data.Add(2, playerInfos);
BroadcastEvent(10, dic_data);
}
client :
private void Awake()
{
Protocol.TryRegisterType(typeof(PlayerController), (byte)'a', MyCustomType.Serialize, MyCustomType.Deserialize);
}
Can anyone help me solve this problem?
are having problems:
2020-09-06 09:44:37,285 [16] ERROR Photon.Hive.HiveGame.HiveHostGame.Plugin - UnhandledException:'Name:PhotonPlugin, Version:1.0 AppId:440A-6127-B81C-3D99-E133-6DFE, AppVersion:'. Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at Photon.SocketServer.Rpc.Protocols.GpBinaryByte.GpBinaryByteWriter.WriteCustomType(IBinaryWriter writer, CustomTypeInfo customTypeInfo, Object value) in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\Rpc\Protocols\GpBinaryByte\GpBinaryByteWriter.cs:line 561
at Photon.SocketServer.Rpc.Protocols.GpBinaryByte.GpBinaryByteWriter.Write(IBinaryWriter writer, Object value, Boolean setType, CustomTypeCache privateCustomTypeCache, Int32 depth) in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\Rpc\Protocols\GpBinaryByte\GpBinaryByteWriter.cs:line 291
at Photon.SocketServer.Rpc.Protocols.GpBinaryByte.GpBinaryByteWriter.WriteEventData(IBinaryWriter binaryWriter, IEventData eventData, CustomTypeCache privateCustomTypeCache) in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\Rpc\Protocols\GpBinaryByte\GpBinaryByteWriter.cs:line 79
at Photon.SocketServer.Rpc.Protocols.GpBinaryByte.GpBinaryByteProtocolV16.SerializeEventData(EventData eventData, CustomTypeCache privateCustomTypeCache) in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\Rpc\Protocols\GpBinaryByte\GpBinaryByteProtocolV16.cs:line 151
at Photon.SocketServer.ApplicationBase.BroadCastEvent[TPeer](IEventData eventData, IEnumerable`1 peers, SendParameters sendParameters) in h:\svncontent\photon-socketserver-sdk_cloud\src\Photon.SocketServer\ApplicationBase.cs:line 357
at Photon.Hive.HiveHostGame.BroadcastEventInternal(Byte evCode, Dictionary`2 data, Byte cacheOp, Boolean updateEventCache, Int32 senderActor, IEnumerable`1 actors, SendParameters sendParameters) in d:\dev\photon-socketserver-sdk_cloud\src-server\Hive\PhotonHive\HiveHostGame.cs:line 396
at Photon.Hive.Plugin.PluginBase.BroadcastEvent(Byte code, Dictionary`2 data) in d:\dev\photon-socketserver-sdk_cloud\src-server\HivePlugin\PluginBase.cs:line 594
at MobaOnline.MobaOnline.ScheduledEvent() in F:\Photon\Photon-OnPremise-Server-Plugin-SDK_v4-0-29-11263\src-server\Plugins\MobaOnline\MobaOnline.cs:line 76
at Photon.Hive.HiveHostGame.<>c__DisplayClass36.<GetTimerAction>b__35() in d:\dev\photon-socketserver-sdk_cloud\src-server\Hive\PhotonHive\HiveHostGame.cs:line 426
I have followed the instructions of the doc photon ,
logic sever:
public override bool SetupInstance(IPluginHost host, Dictionary<string, string> config, out string errorMsg)
{
host.TryRegisterType(typeof(PlayerInfos), (byte)'a', MyCustomType.SerializeCustomPluginType, MyCustomType.DeserializeCustomPluginType);
return base.SetupInstance(host, config, out errorMsg);
}
private void ScheduledEvent()
{
PlayerInfos playerInfos = new PlayerInfos();
playerInfos.HP = 111; playerInfos.MP = 100;
Dictionary<byte, object> dic_data = new Dictionary<byte, object>();
dic_data.Add(2, playerInfos);
BroadcastEvent(10, dic_data);
}
client :
private void Awake()
{
Protocol.TryRegisterType(typeof(PlayerController), (byte)'a', MyCustomType.Serialize, MyCustomType.Deserialize);
}
Can anyone help me solve this problem?