SendOperationResponse trouble
Options
Hello.
this is my code:
[code2=csharp]using System;
using Photon.SocketServer.Rpc;
namespace Tactics.GameEntityModel
{
public class Credits
{
public Credits()
{
}
[DataMember(Code = (byte)SerCode.CreditsGold)]
public Int64 Gold { get; set; }
[DataMember(Code = (byte)SerCode.CreditsMoney)]
public Int64 Money { get; set; }
[DataMember(Code = (byte)SerCode.CreditsExperience)]
public Int64 Experience {get;set;}
}
}[/code2]
[code2=csharp]public class MyPhotonPeer : PeerBase
{
...
Dictionary<byte, object> d = new Dictionary<byte, object>();
d.Add(0, new GameEntityModel.Credits ());
OperationResponse resp = new OperationResponse(operationRequest.OperationCode, d);
SendOperationResponse(resp, new SendParameters());
}[/code2]
but SendOperationResponse can't word fine because it can't serialize "Credits"
What i can do?
this is my code:
[code2=csharp]using System;
using Photon.SocketServer.Rpc;
namespace Tactics.GameEntityModel
{
public class Credits
{
public Credits()
{
}
[DataMember(Code = (byte)SerCode.CreditsGold)]
public Int64 Gold { get; set; }
[DataMember(Code = (byte)SerCode.CreditsMoney)]
public Int64 Money { get; set; }
[DataMember(Code = (byte)SerCode.CreditsExperience)]
public Int64 Experience {get;set;}
}
}[/code2]
[code2=csharp]public class MyPhotonPeer : PeerBase
{
...
Dictionary<byte, object> d = new Dictionary<byte, object>();
d.Add(0, new GameEntityModel.Credits ());
OperationResponse resp = new OperationResponse(operationRequest.OperationCode, d);
SendOperationResponse(resp, new SendParameters());
}[/code2]
but SendOperationResponse can't word fine because it can't serialize "Credits"
What i can do?
0
Comments
-
Don't try to send Credits?
It's a class the protocol de/serialize code doesn't know. Convert the important info from that class into serializable datatypes and send that.
See "Operation Content - Serializable Types":
http://doc.exitgames.com/en/photon-serv ... ryProtocol0