Cannot send op: 254 Not connected.

Options
hello i added voicechat to my game but now i keep getting these errors:
Cannot send op: 254 Not connected. PeerState: Connecting
UnityEngine.Debug:LogError(Object)
NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1620)
ExitGames.Client.Photon.EnetPeer:EnqueueOperation(Dictionary`2, Byte, SendOptions, EgMessageType)
ExitGames.Client.Photon.PhotonPeer:SendOperation(Byte, Dictionary`2, SendOptions)
LoadBalancingPeer:OpLeaveRoom(Boolean) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/LoadbalancingPeer.cs:370)
PhotonNetwork:LeaveRoom(Boolean) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:2163)
RoomMultiplayerMenu:LeaveRoom() (at Assets/_Scripts/important scripts/RoomMultiplayerMenu.cs:901)
RoomMultiplayerMenu:Update() (at Assets/_Scripts/important scripts/RoomMultiplayerMenu.cs:222)
Failed to Instantiate prefab: zombie. Client should be in a room. Current connectionStateDetailed: ConnectingToMasterserver
UnityEngine.Debug:LogError(Object)
PhotonNetwork:Instantiate(String, Vector3, Quaternion, Byte, Object[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:2473)
PhotonNetwork:Instantiate(String, Vector3, Quaternion, Byte) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:2456)
RoomMultiplayerMenu:SpawnPlayer(String) (at Assets/_Scripts/important scripts/RoomMultiplayerMenu.cs:487)
<Restart>d__79:MoveNext() (at Assets/_Scripts/important scripts/RoomMultiplayerMenu.cs:368)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
when i make a room for a split second i can see my hands but then i get deleted and after 5 seconds i get kicked out of my own room, i never disconnected

Comments

  • Federico123
    Options
    This is really important because than otherwise i cannot make my game anymore
  • S_Oliver
    S_Oliver ✭✭✭
    edited April 2020
    Options
    I assume you didnt read the Error you posted here and just opend a new thread?


    The first says that you are still in Connection process.
    Cannot send op: 254 Not connected. PeerState: Connecting
    

    The secound says your are not in a Room,so you cant call PhotonNetwork.Instantiate.
    Failed to Instantiate prefab: zombie. Client should be in a room. Current connectionStateDetailed: ConnectingToMasterserver
    


  • Federico123
    Options
    S_Oliver wrote: »
    I assume you didnt read the Error you posted here and just opend a new thread?


    The first says that you are still in Connection process.
    Cannot send op: 254 Not connected. PeerState: Connecting
    

    The secound says your are not in a Room,so you cant call PhotonNetwork.Instantiate.
    Failed to Instantiate prefab: zombie. Client should be in a room. Current connectionStateDetailed: ConnectingToMasterserver
    


    I did made a room and it wont never connect, i start my game, i make a room and then that happens
  • Federico123
    edited April 2020
    Options
    heres my settings, the bug happened when i upgraded pun voice
    https://imgur.com/a/mFqZLWx
  • Federico123
    Options
    S_Oliver wrote: »
    I assume you didnt read the Error you posted here and just opend a new thread?
    Yes i did read the error but i dont understand how to fix
  • S_Oliver
    S_Oliver ✭✭✭
    edited April 2020
    Options
    Dude, do us a favor and start debug your stuff before posting stuff here.
    Or provide good information so we can evaluate on that.
    But it is impossible for anyone to help you.

    And the Errors say you are not connected and not in a Room. So please check out your code.
    And if you think this problem is from implementing pun voice.Try it without, so you can be sure it is because of this.

    If the errors still not vanished, ask with some more information. Like what did you tried to solve, how did you debugged your stuff, show us only the relevant code, ask a concrete question.

    Also read the error ! They giving you the lines where the error is thrown.
    RoomMultiplayerMenu:LeaveRoom() (at Assets/_Scripts/important scripts/RoomMultiplayerMenu.cs:901)
    RoomMultiplayerMenu:Update() (at Assets/_Scripts/important scripts/RoomMultiplayerMenu.cs:222)
    
    I assume your super important script RoomMultiplayerMenu got some bugs.
  • Federico123
    Options
    S_Oliver wrote: »
    RoomMultiplayerMenu:LeaveRoom() (at Assets/_Scripts/important scripts/RoomMultiplayerMenu.cs:901)
    RoomMultiplayerMenu:Update() (at Assets/_Scripts/important scripts/RoomMultiplayerMenu.cs:222)
    
    I assume your super important script RoomMultiplayerMenu got some bugs.
    i didnt put a waiting time.
    but if i add it than it will be impossible cause remember the old post?
    yeah the infecting issues, you are always a zombie which doesnt need to happen.
    if (teamaScore == 0)
            {
                StartCoroutine(Restart());
                LeaveRoom();
            }
    
  • Federico123
    edited April 2020
    Options
    S_Oliver wrote: »
    Dude, do us a favor and start debug your stuff before posting stuff here.

    how i will do that since i cannot make the rooms or join the rooms???
  • JohnTube
    JohnTube ✭✭✭✭✭
    edited April 2020
    Options
    Hi @Federico123,

    This is not related to VoiceChat.
    It looks like you are calling LeaveRoom multiple times or calling it in the wrong time (too late).

    The two error logs show that when LeaveRoom is called, the LoadBalancingClient is connecting to Master Server. Connecting to Master Server happens initially or after you leave a room or after you reconnect.

    By the way, migrate to PUN 2 please.
  • Federico123
    edited April 2020
    Options
    JohnTube wrote: »
    Hi @Federico123,

    This is not related to VoiceChat.
    It looks like you are calling LeaveRoom multiple times or calling it in the wrong time (too late).

    The two error logs show that when LeaveRoom is called, the LoadBalancingClient is connecting to Master Server. Connecting to Master Server happens initially or after you leave a room or after you reconnect.

    By the way, migrate to PUN 2 please.

    Ok, I'm updating to pun 2.