Unexpected protocol and Collection was modified errors

Hi,
I updated unity, pun 2 and photon sdk.
(I use both pun2 and photon server in my project)

I am currently using unity 2019.4, Pun2 v2.29(15 march) and photon sdk v4-0-29-11263.

Pun2 works fine as before but photon server does not work as before.
I am getting 2 errors about the photon server.

PhotonNetwork.ConnectToMaster("xxx.xx.xxx.xx", 5055, "appid");
I am trying to connect using the code above and i get this error:
Unexpected protocol, expected value is between 1.2 and 1.7.

PhotonNetwork.NetworkingClient.LoadBalancingPeer.SerializationProtocolType =
ExitGames.Client.Photon.SerializationProtocol.GpBinaryV16;
I solved this error by typing this code but I didn't understand the cause of this error.
Is it normal for me to get this error?

the other error is this:
error.png
I get this error when I create a room.
how can i solve this error?

Best Answer

  • chvetsovchvetsov mod
    Accepted Answer
    Hi, @Hunel
    it looks like you are using sdk 4
    that means that it does not support yet protocol 1.8 and that is why when you set it to 1.6 all works. protocol 1.7 was not released

    in regard to second error I can not say anything because stack is too small. However usually you get such exceptions in case of multi threading issues. so, you access/modify collection from two different threads and get this exception

    best,
    ilya

Answers

  • chvetsovchvetsov mod
    Accepted Answer
    Hi, @Hunel
    it looks like you are using sdk 4
    that means that it does not support yet protocol 1.8 and that is why when you set it to 1.6 all works. protocol 1.7 was not released

    in regard to second error I can not say anything because stack is too small. However usually you get such exceptions in case of multi threading issues. so, you access/modify collection from two different threads and get this exception

    best,
    ilya
Sign In or Register to comment.