Disable Network set up for a few seconds after joining a room

Options
Is there a way to disable the RPC/events from firing directly after the user joins a room for a few seconds.

My game scene takes a few seconds to load and spawns some runtime objects into the scene (some of which the RPC's need to see). Because as soon as i join the room all the events fire and there are a load of missing references so the game does not set up correctly.

Currently i have a small hack in the photonhandler, but ideally dont want to leave this in as may end up breaking something else, so is there an official/correct way to do so

Thanks

Comments

  • S_Oliver
    S_Oliver ✭✭✭
    Options
  • Hi

    Thanks for getting back, I have tried using the above advice but once i turned the system off it never appeared to kick back in. So id have my player spawn, but then would not recieve any previous events or any new events from other players

    below is what i have (ignore the bad formatting coded across strangely), if im understanding correctly this should stop the calls being processed and then after finish loading go through the que and process them all right?
    void Awake()
    {
                if (OnNetwork)
                {
                    PhotonNetwork.IsMessageQueueRunning = false;
                 }
    }
    
           public void OnFinishedLoading()
            {
                if (OnNetwork)
                {
                    PhotonNetwork.IsMessageQueueRunning  = true;
                }
             }
    
  • Never Mind, i upgraded to the latest version and now appears to be working, may have been an issue in an older one.
    Thanks for the help