isMessageQueueRunning problem

Options
Hi, and thanks in advance.

I have this code to load my scenes in mainmenu.
IEnumerator LoadScene(){
	AssetBundle Levels;			  
	string URL = "http://www.example.com/unity/assets/"+escena["escena"];

	PhotonNetwork.isMessageQueueRunning = false;
	download = WWW.LoadFromCacheOrDownload (URL,1);		
		
		
		
	while (!download.isDone)
        {			
		yield return new WaitForSeconds(0.5f);
	}
	if (download.error == null)
	{
		Levels = download.assetBundle;
		Levels.LoadAll();
	}
	else
		Debug.Log(download.error);
		
	StartCoroutine(MoveToGameScene());
}
	
IEnumerator MoveToGameScene()
{
	Debug.Log("entrar");
		
	while (PhotonNetwork.room == null)
            yield return 0;
        
	Application.LoadLevel((string)escena["escena"]);
}

When the scene are cached the game works ok, but when is the first time i have the OnFailedToConnectToPhoton warning and then OnDisconnectedFromPhoton after the loading finish , so the player dont instantiate and I can't come inside. I'm using the last version of photon plugin 1.4 and also the RC5 server.

If I comment the line "PhotonNetwork.isMessageQueueRunning = false;" connects ok, but if there are some other players when i connect in the scene, them instantiates before i can entry, and then i can't see the other players, but them yes to me.

Regards.

Comments

  • Hi again,

    Basically the problem is this, When the message queue is disable and the clients are waiting to loading the scene the connection from server disconnects.

    I suppose that the waiting is a bit longer, so there are something where configure and increment the timeout or something? Thanks
  • Hi,

    I found the problem,
    if(value)
    
    , should be
    if(!value)
    

    in the PhotonNetwork.cs , public static bool isMessageQueueRunning , line 375

    So the code finally i think should be like this.
                m_isMessageQueueRunning = value;
                if (!value)
                {
                    PhotonHandler.StartThread(); // Background loading thread: keeps connection alive
                }
    

    Regards ;)
  • Tobias
    Options
    Ouch! :o
    Great find. Thanks for pointing us to it. This actually is still in the current PUN v1.4. Wow.
    Will submit a fix to the store soon.
  • gnoblin
    Options
    Sorry for offtopic:
    When releasing updates, do you guys speicfy anywhere which files have been changed since the previous version?
    It would be easier to upgrade PUN version this way.

    thanks,
    Slav
  • Tobias
    Options
    No, we don't list which files we changed. I think a diff software would help more than a list in this case. Even more so, if you ever skip one version.
    The current rate of updates and being open source means more work at the moment. I'm not sure how other projects handle this in a better way...
  • dreamora
    Options
    diff software is a bit tricky with photon ... between RC3 and RC6 you changed so much it became useless as every single line was 'changed' basically as stuff got resorted in files etc
  • Tobias
    Options
    I see. Sorry for that. We try to enforce a certain, readable code style server-side and this leads to refactoring when we notice we're off from that style.
    I will stress this topic for the next updates but can't promise anything yet.
  • dreamora
    Options
    Okey :)
    Yeah refactorings are unavoidable as code matures, even my simplest code would suffer from similar problems normally when looking at it over the timespan of man weeks++

    And I will see if I can make WinMerge or something else smarter when it comes to handling of moved blocks and alike, I'm sure there are ways that I just haven't enabled yet.