How to Encrypt the transmission between Client and Server(Unity3D and PhotonServer)
Options
Django
✭
I sent request by :“public virtual bool OpCustom(byte customOpCode, System.Collections.Generic.Dictionary customOpParameters, bool sendReliable)”
I found a
“public virtual bool OpCustom(byte customOpCode, System.Collections.Generic.Dictionary customOpParameters, bool sendReliable, byte channelId, bool encrypt)”.
There is "byte channelId" and "bool encrypt".
And I didnt found infomation about "What does this channel mean"
then i set channelid to (byte)1.and set encrypt true. then something went wrong:
ArgumentException: Can't use encryption yet. Exchange keys first.
ExitGames.Client.Photon.PhotonPeer.OpCustom (Byte customOpCode, System.Collections.Generic.Dictionary`2 customOpParameters, Boolean sendReliable, Byte channelId, Boolean encrypt)
what is the channel and the Exchange keys?
how to set it?
I found a
“public virtual bool OpCustom(byte customOpCode, System.Collections.Generic.Dictionary customOpParameters, bool sendReliable, byte channelId, bool encrypt)”.
There is "byte channelId" and "bool encrypt".
And I didnt found infomation about "What does this channel mean"
then i set channelid to (byte)1.and set encrypt true. then something went wrong:
ArgumentException: Can't use encryption yet. Exchange keys first.
ExitGames.Client.Photon.PhotonPeer.OpCustom (Byte customOpCode, System.Collections.Generic.Dictionary`2 customOpParameters, Boolean sendReliable, Byte channelId, Boolean encrypt)
what is the channel and the Exchange keys?
how to set it?
0
Best Answer
-
Hi @Django,
Thank you for choosing Photon!
What client SDK do you use? It seems you are not using a standard one downloadable from here.
Sequence Channels definition:You can use different channels to group and prioritize events you are sending. We'll illustrate this functionality in a small example: Let's say you are using channel 1 to send relevant information about the position of players. You enabled reliable UDP in your game, because you need the extra reliability in the type of game you are envisioning. At some point channel 1 gets crowded by many messages because some players got delay and have a bad connection with a noticeable amount of packet loss, so a lot of messages have to be re-send. If you would now enqueue another important event (like the end of round), it might take some time for it to be acknowledged since the clients are still busy receiving all the position updates from channel 1. So if you dispatch an event now with channelId 0 it will take precedence over all the other queued messages. By making smart use of this feature you can raise the perceived responsiveness and ensure a correct flow of your game logic, even under mediocre connection conditions.(source)
Read about "Encryption".5
Answers
-
Hi @Django,
Thank you for choosing Photon!
What client SDK do you use? It seems you are not using a standard one downloadable from here.
Sequence Channels definition:You can use different channels to group and prioritize events you are sending. We'll illustrate this functionality in a small example: Let's say you are using channel 1 to send relevant information about the position of players. You enabled reliable UDP in your game, because you need the extra reliability in the type of game you are envisioning. At some point channel 1 gets crowded by many messages because some players got delay and have a bad connection with a noticeable amount of packet loss, so a lot of messages have to be re-send. If you would now enqueue another important event (like the end of round), it might take some time for it to be acknowledged since the clients are still busy receiving all the position updates from channel 1. So if you dispatch an event now with channelId 0 it will take precedence over all the other queued messages. By making smart use of this feature you can raise the perceived responsiveness and ensure a correct flow of your game logic, even under mediocre connection conditions.(source)
Read about "Encryption".5 -
Yes for now we use 160 bit keys.0