Wrong parameter type 1 (InitEncryptionRequest.ClientKey): should be Byte[] but received String.
Options
Hi Supporter,
I have a questing, when i config client run with webGL, I got problem
My code client i use:
I have a questing, when i config client run with webGL, I got problem
Wrong parameter type 1 (InitEncryptionRequest.ClientKey): should be Byte[] but received String.
My code client i use:
public void SendDemo(){
websocket = new WebSocket(uri);
MessageBase _m = new MessageBase ();
_f = u.ToDictionary ();
OperationRequest request = new OperationRequest ();
request.OperationCode = (byte)0;
request.Parameters = _f;
websocket.Send (SerializeInternalOperationRequest(request));
}
public byte[] SerializeInternalOperationRequest(OperationRequest operationRequest)
{
Dictionary<string, object> h1 = new Dictionary<string, object> ();
h1.Add("irq", operationRequest.OperationCode);
if (operationRequest.Parameters != null)
{
List<object> list = new List<object>(operationRequest.Parameters.Count * 2);
foreach (KeyValuePair<byte, object> pair in operationRequest.Parameters)
{
list.Add(pair.Key);
list.Add(pair.Value);
}
h1.Add("vals", list);
}
return GetMessage(h1);
}
private static byte[] GetMessage(IDictionary h)
{
JsonSerializer serializer = new JsonSerializer();
serializer.NullValueHandling = NullValueHandling.Ignore;
StringBuilder sb = new StringBuilder();
using (StringWriter writer = new StringWriter(sb))
{
using (var jsonTextWriter = new JsonTextWriter(writer))
{
serializer.Serialize (jsonTextWriter, h);
}
writer.Flush();
}
string s = string.Format("~m~{0}~m~~j~{1}", sb.Length + 3, sb);
return Encoding.UTF8.GetBytes(s);
}
0
Comments
-
Hi,
What are you trying to do?
You need one of Photon SDKs (most likely javascript or dotnet) to access Photon functionality instead of using WebSocket.0 -
Hi Vadim,
Thanks for support, I trying build client unity use code dotnet to WebGL, but when I connect from WebGL to server I got Error "Wrong parameter type 1 (InitEncryptionRequest.ClientKey): should be Byte[] but received String"
I want the sample webGL using dotnet socket from unity, Please help me?
0 -
Why don't yo use Photon Unity dotnet SDK?0
-
Do you use Photon currently? If yes, which SDK or plugin exactly?
As I said Photon Unity dotnet SDK and PUN have WebGL support.0 -
Hi Supporter,
I used Photon SDK V4.0 and not use PUN for unity. Do you suggest I use PUN ++ for unity?0 -
Did you try to set connection protocol to WebSocket or WebSocketSecure in LoadBalancingClient constructor?0