Search Unity

Third Party Photon Unity Networking

Discussion in 'Multiplayer' started by tobiass, Aug 23, 2011.

  1. vadiml

    vadiml

    Joined:
    Aug 12, 2014
    Posts:
    32
    In this case you did not have any choices other than US. I believe it's the same as Photon Cloud / Region US.
    So all clients will be connected to the same region and will be able to play in same room.
     
  2. vadiml

    vadiml

    Joined:
    Aug 12, 2014
    Posts:
    32
    Hi,
    This is in our todo list: http://forum.photonengine.com/discussion/comment/25185
     
  3. vadiml

    vadiml

    Joined:
    Aug 12, 2014
    Posts:
    32
    Hi,
    It depends on how teams are implemented. If via players properties, iterate over all players in the room and count each team players filtering by property.
     
  4. vadiml

    vadiml

    Joined:
    Aug 12, 2014
    Posts:
    32
  5. robertsze

    robertsze

    Joined:
    Jul 8, 2013
    Posts:
    83
    Just for you information:

    We handle this issue now locally right inside PhotonHandler with something like this:

    public static bool FallbackSendAckThread()
    {
    if (sendThreadShouldRun && PhotonNetwork.networkingPeer != null)
    {
    // djinnworks start
    if (PhotonNetwork.pauseActive)
    {
    PhotonNetwork.pauseTime += PhotonNetwork.pauseHandlerLoopTime;

    float maxTime = (PhotonNetwork.pausePhotonDisconnectTime - PhotonNetwork.pausePhotonDisconnectTimeServer) * 1000f;
    if (maxTime < 5f * 1000f)
    maxTime = 5f * 1000f;

    if (PhotonNetwork.pauseTime > maxTime)
    {
    Debug.Log("Stop sending ack to server, idle for too long");
    return sendThreadShouldRun;
    }
    }
    // djinnworks end
    PhotonNetwork.networkingPeer.SendAcksOnly();
    }

    return sendThreadShouldRun;
    }

    We set pauseActive and pauseTime right inside OnApplicationPause right inside PhotonHandler. This works perfectly. Tested with more about 1000CCUs and thousand of played games, not "idling" players anymore.

    What we do in addition to this is to switch the masterClient even earlier (after 10 seconds) of timeout with a custom heartbeat. This way logic which is just handled by the master client will not be affected for too long when a player switches his app into the background.

    Combing this both methods we got stable and perfect multiplayer gaming now.
     
  6. vadiml

    vadiml

    Joined:
    Aug 12, 2014
    Posts:
    32
    Yes, we saw this code in forum. Very useful. Thanks.
     
  7. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    Hi,

    I got this error coming pretty frequently:
    Code (CSharp):
    1. Exiting receive thread (inside loop) due to error: An error has occurred in sending the data.
    2. UnityEngine.Debug:LogError(Object)
    3. NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1101)
    4. ExitGames.Client.Photon.<ReceiveLoop>c__Iterator13:MoveNext() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/SocketWebTcp.cs:188)
    what could it be ?
     
  8. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    Please provide more insight about the versions you use (PUN/Unity) and which platforms you use.
    It seems to be related to websockets? In Editor or in browser?
     
  9. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    We updated PUN and PUN+ to v1.62 (13. October 2015).

    Fixed: Clean up of instantiated Game Objects
    (Clean Up Cache on Leave). This bug was only in v1.61.
    Changed: PhotonView.OnDestroy() to not use Application.isLoadingLevel in Unity 5.2 (which makes it obsolete). Loading a level will destroy a GameObject without using PhotonNetwork.Destroy() and that can lead to errors. When loading a level that's ok. The logging got adjusted for this case.
    Added: PhotonNetwork.BackgroundTimeout. It defines after how many seconds PUN will close a connection, when Unity called OnApplicationPause(true). By default, this is not active but on Android (e.g.), it can be useful to close a connection when the app is in background for a while.
     
  10. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    @tobias

    it is very hard to reproduce as it seems random... In fact, when it happens in editor i got only this message, and when it happens in webGL it crashes.
    I am running photon v1.62 with unity 5.2.1f1.

    BTW, I saw something that i didnt so far: when i connect to my main scene i got this empty "websocketConnectionObject" object that makes 58 warnings "The referenced script on this Behaviour is missing!".
    Why is that ? Shouldnt it have a script attached or something ?
     
  11. Marceta

    Marceta

    Joined:
    Aug 5, 2013
    Posts:
    177
    I'm trying to run pun on webgl quiz game. I'm connected to master and user is in lobby. But he can't see other rooms. Also method's such as OnPhotonPlayerConnected or OnJoinedRoom are not being called by Photon. One user is on android, second on webgl and third on desktop(PC).

    Edit: Somehow i got it working.
     
    Last edited: Oct 15, 2015
  12. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    @Paradoks: We will have to try to reproduce but "very hard to reproduce" doesn't sound very promising in that regard. We will try our best.

    Could this be related to an import/update issue in Unity 5.x? PUN v1.62 is new, so you obviously imported it to your project. Sometimes, Unity 5.x now doesn't overwrite existing scripts/assets anymore when you import. This creates duplicates of files (one named with number. e.g. (1)) and such. Does this happen, when you use our demos?

    @Marceta: Glad you got it working. Maybe a version difference between the builds? WebGL is still kinda beta in Unity but working OK usually. If you have something that can be reproduced, let us know.
     
  13. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    @tobias:
    Is it possible that checking "enable exception : explicit thrown exception only" makes the export an "other way" ?
    Something strange happened: The version with enabled exception that was on my computer but not on my server could not "see" the version that was on my server ?!
    + i could not make it bug.

    I am trying to find a way to reproduce the bug with no sucess.

    About the "58 warnings" thing, I allways delete the plugins folder before re-importing a new PUN version as it never overwrites it.
     
  14. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    is it normal to have this "websocketConnectionObject" object made at connection with missing script on it ?
     
  15. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    @Paradoks: Thanks for reporting this. We look into that and will find a solution asap.
    The object gets created and we add a MonoBehaviour, but not a script that extends that. Maybe that's the simple cause.
     
  16. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    Glad to help.
    But the "websocketConnectionObject" thing is not causing my 58 missing behavior warning as i do that before loading the new scene: Destroy(GameObject.Find("websocketConnectionObject"));
    And it changes nothing ... still 58 warning. I keep investigating.
    For the :
    "Exiting receive thread (inside loop) due to error: An error has occurred in sending the data." is still coming randomly.
    I keep you informed too .

    EDIT:
    There is definitely something strange with this "missing monobehavior" warning as it comes between the game scene launching and the first awake script from the game scene.
    But when i load the game scene first, I got no warnings, means it is something between the two scenes.
     
    Last edited: Oct 16, 2015
  17. vadiml

    vadiml

    Joined:
    Aug 12, 2014
    Posts:
    32
    @Paradoks: Can you please try to replace MonoBehaviour in
    MonoBehaviour mb = websocketConnectionObject.AddComponent<MonoBehaviour>(); line of SocketWebTcp.cs file
    with class defined as
    internal class WebsocketConnectionMonoBehaviour : MonoBehaviour
    {
    }
     
  18. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    Guys, do your game run in background ?
    Mine dont. any idea what it could be?
    ps: Run in background is checked of course.

    EDIT:

    - I am running the game with Firefox for player 1 and unity editor for player 2.
    - The player 1 is the host. And launch the game once the player 2 joined.
    - I am under Firefox as the player 1 connects first.
    - When i hear the sound of the player 2 connection i go to unity editor
    - Editor disconnection , with this message:
    Code (CSharp):
    1. Exiting receive thread (inside loop) due to error: An error has occurred in sending the data.
    2. UnityEngine.Debug:LogError(Object)
    3.  
    4. EDIT @[SIZE=4][B][URL='http://forum.unity3d.com/members/vadiml.670236/']vadiml[/URL]
    5. havent seen your message, i try now[/B][/SIZE]
    6. NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1101)
    7. ExitGames.Client.Photon.<ReceiveLoop>c__Iterator13:MoveNext() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/SocketWebTcp.cs:188)
    Seems like the webplayer cant run everything in background. So when it comes to sending data it crashes.

    test it by yourself: http://adversator.sablio.com/

    EDIT @vadiml

    Havent seen your message, i try now
     
    Last edited: Oct 21, 2015
  19. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    @vadiml

    Changes nothing.
    I still have the random deconnections in the editor as a masterClient without clients.
     
  20. vadiml

    vadiml

    Joined:
    Aug 12, 2014
    Posts:
    32
    @Paradoks
    I sent you possible fix for warnings with websocketConnectionObject, not for disconnects.
    Today we fixed some issue on secure websockets server. Please try if it helps in your case.
     
  21. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    Afaik, the server fixes are not live yet for the public cloud.
    We currently test them on internal servers and deploy them in the Photon Cloud soon.
     
  22. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    @vadiml
    The warnings are still present.

    Btw, what about the websocket server fix release date ?
    Btw again, I reported a bug to the unity team about lags when you have the host AND the client in two different tabs of the same browser. dont know if it is on your side or on unity side but try it at home.

    in the IELdemo i changed from "if (PhotonNetwork.isMasterClient){" to that:

    Code (CSharp):
    1. if (PhotonNetwork.isMasterClient){
    2.  
    3.  
    4.             if ( goLeft){
    5.              
    6.                 float movement = -1 * Time.deltaTime * 15;
    7.              
    8.                 foreach (Transform tran in cubes){
    9.                  
    10.                     tran.position += new Vector3(movement, 0, 0);
    11.                  
    12.                     if (tran.position.x < -13){
    13.                      
    14.                         goLeft = false;
    15.                     }
    16.                 }
    17.              
    18.             }else{
    19.              
    20.                 float movement = 1 * Time.deltaTime * 15;
    21.              
    22.                 foreach (Transform tran in cubes){
    23.                  
    24.                     tran.position += new Vector3(movement, 0, 0);
    25.                  
    26.                     if (tran.position.x > 13){
    27.                      
    28.                         goLeft = true;
    29.                     }
    30.                  
    31.                 }
    32.             }
    so it moves alone, then i watch the client side

    or try with http://adversator.sablio.com/ on two tabs too.
     
  23. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    To be more precise:
    When you have MasterClient tab in browser not selected, the update seems to be done only one time every 1 or 2 seconds. Same thing happens to me on both Firefox and Chrome.
    Imagine the host of a game that goes on an other tab ( to chat on FB for example ) and your game experience is ruined.
    Is there a way to force the MasterClient tab to work full time even if not selected by the player ?
     
  24. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    A new version should be in the Asset Store any minute now. It got a few fixes for all games and we finally worked around some packaging issues in the 2D Demo to fix it.

    v1.63 (27. October 2015)

    Changed: The case "no match found" is now logged as Warning, instead of Error. This happens and it was confusing if you used "Break on Error" in the Editor.
    Changed: OnMasterClientSwitched handler documentation to make it more clear if the master is still in list or already removed.
    Fixed: 2D Demo. There was an issue with a missing script and the layers. The demo no longer relies on the Layers for the "isGorunded" check (as Layers are not existing in Asset Store Packages).
    Fixed: A bug that prevented manually instantiated GameObjects (PhotonViews) from being cleaned up when a player leaves. Even if you manually instantiate GameObjects, they get cleaned up, as long as PhotonNetwork.autoCleanUpPlayerObjects is true. The doc is updated.
    Changed: Several scripts in demos to handle PUN's both callbacks: OnJoinedLobby() and OnConnectedToMaster(). Which one gets called, depends on the "Auto-Join Lobby" setting in the PhotonServerSettings (default is off / OnConnectedToMaster()).
    Updated: To latest Photon3Unity3d.dll v4.0.0.11p1.
     
  25. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    Correct. This is a technical limitation by the browser and there is no way around this. Not even if you use JS directly.
    This is obviously done to minimize workload of tabs in the background. Browser seem to define background as either "tabbed and not selected" or "a minimized browser window".
    You only get 1..2 updates per second. It should be enough to keep the connection but nothing more. You might be able to send a message to the others, that the game is in BG now.
     
  26. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    I purchased Photon PUN+ yesterday and really have no experience of multiplayer games yet other than playing them of course. However I have couple of releases that I would like to add multiplayer stuff to. Now that I bought Photon PUN+ and got the AppId does it mean that I can only develop multiplayer for one game? Or can I use the same AppId for different titles?
     
  27. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    You better use a different AppId per title, otherwise you will mix clients that don't understand each other.
    You can create more than one Application in the Photon Cloud Dashboard. The 20 CCU ones are free, so you can use the 100 CCU of PUN+ for one title and still develop others.
     
  28. Nadan

    Nadan

    Joined:
    Jan 20, 2013
    Posts:
    341
    I'm trying to do the Marco Polo tutorial and I'm stuck. The instructions read:

    We need another script. Create a C# script “NetworkCharacter” in the Marco Polo folder. Add it to the “monsterprefab” and make it the observed component of the PhotonView (drag & drop).

    I have the Network Character script attached to my PlayerPrefab. I drag & drop it but it looks like this:

    PlayerPrefab(Transform)

    I noticed that in the Demos/MarcoPolo-Tutorial scene the NetworkLook reads:

    monsterprefab (NetworkCharacter)



    Why my prefab shows (Transform)? How do I make it (NetworkCharacter)?

    Any help?
     
  29. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    @tobiass
    What about introduicing webworkers ?
     
  30. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    Btw, just installed the latetest version.
    Still got this very ennoying error:
    Code (CSharp):
    1.  
    2. Exiting receive thread (inside loop) due to error: An error has occurred in sending the data.
    3. UnityEngine.Debug:LogError(Object)
    4. NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:1101)
    5. ExitGames.Client.Photon.<ReceiveLoop>c__Iterator12:MoveNext() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/SocketWebTcp.cs:188)
    6.  
    when launching the main game + still got the missing reference thing.
     
  31. vadiml

    vadiml

    Joined:
    Aug 12, 2014
    Posts:
    32
    The error above is due to websocket connection failure. We have couple of websocket server issues fixed. The fix is already deployed on turnbased servers and will be on realtime servers tomorrow. Please check it will helps.
    Could you give us more details about "the missing reference thing". Is this some error in log?
     
  32. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Unity 5.1.4 + PUN+1.60

    I was having 2 issues related to TransferOwnership


    The object was setup as Owner = Takeover, with InstantiateSceneObject so it's not destroyed if say the master leaves.
    It's a moving physics object that when a player collides they take over.
    *this method makes for a seamless visual for the local player when they "bump" the object since they will now handle the physics
    *other players may see the "bump" with a gap but mostly acceptable

    When the client takes ownership..
    Issue 1: Object position/rotation/velocity etc hitched cause they were outdated/wrong ie quickly lerped from the wrong position to the right one.
    Fix: in the different views I updated the "network" values in SerializeData
    Example..in PhotonTransformViewPositionControl.SerializeData I added the line m_NetworkPosition = currentPosition;
    *did similar to rotation and physics views
    so sending or receiving..the value is set so when ownership changes it as something much closer to work with.


    Issue 2: It was still receiving updates from the old owner, causing it to also hitch. obviously due to packets "in flight" and the old owner doesn't instantly know to stop updating.
    Fix: I implemented a blocking time, which I setup in the PhotonView script so other scripts could check if they should update things
    example: in PhotonTransformView.Update I added this line - if (m_PhotonView.bBlockIncoming) return;

    Seems like Photon should drop incoming packets to an object where ownership was taken over, cause it is now sending the updates out.

    This is working good for me, which is why I haven't updated PUN (just checked and think i'd have the same issues in 1.63).
    So this isn't a how do I fix it post, more of a maybe some issues in photon that need to be looked into. (although it maybe me using photon wrong)
     
    tobiass likes this.
  33. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    @vadiml

    I am working on a workaround for the unselected tab thing.
    I found something strange: when a photonview change ownership because of a master client deconnection, the "controlled locally" check change from false to true on a "client" becoming "master client", but when the master client change not because of a deconnection but because of a setMasterClient, the "controlled locally" check dont change as it should, it may be a bug.

    ps: The "Exiting receive thread" is still there.
    pps: coulnt you check lags as i said to tobias in this topic, :
    http://forum.unity3d.com/threads/webgl-unet-or-photon-is-it-worth-it.365242/#post-2365054
    and change master client yourself ?
     
  34. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    1- Are you doing maintenance or something ? since yesterday evening i got big connection problems.
    btw the connection problem "Exiting receive thread" is still present @vadiml you said it will be ready for thuesday, is your fix active, if so does it mean that its an other problem ?

    2- Could you inform somewhere that there is a maintenance going on when you have one ? so people dont have to look around for a bug ?

    3- As i said yesterday i am making a workaround to avoid masterclient "other tab selected" freeze, and i think the logic is good but: why is there a difference for ownership transfer of scene views between:
    masterClient leaving game (GOOD) and PhotonNetwork.SetMasterClient()(VERY BAD) ?

    the result between those two should be the same, in both cases the new masterclient should get the "controlled locally" checked.It dont in PhotonNetwork.SetMasterClient case. Worst, it seems like both former MasterClient and new one got kind of control...as new masterClient is seen as masterClient but dont have "controlled locally" checked.
     
  35. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    Nothing right now.
    Please mail us your appid, region and details about the issues to: developer@exitgames.com. Also, you could log the current PhotonNetwork.ServerAddress when this happens. This way, we can check the server's logs explicitly for your case.
    We're closely monitoring issues with WebSocket connections.

    We do that here: https://twitter.com/ExitGames

    I checked this in PUN v1.63 in the Boxes Demo. There is a cube in the scene and I Instantiated two at runtime: one as player owned, one as scene object. Switching the Master Client works for me. I tested "isMine".
    What exactly do you mean with "controlled locally"?
    Did you transfer ownership?
     
  36. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    Then what is the difference for photon view with Owner==Scene between changing the masterClient with SetMasterClient() and MasterClient leaving the game ?
    I tought that when an object was owned by the scene switching the master client with both "master client leaving" or SetMasterClient() would give the same result. It should right ?
     
  37. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    @bocs: Thanks for the input. It sounds like you found some nice tweaks, which we should consider.

    Let me summarize your two fixes to check if I got it.
    1) You make sure that the network position is also updated by the owner of a PhotonView, so when if ownership gets transferred, it also has a track record of network positions.
    Sounds like a good addition.

    2) When ownership changed, PUN should drop any updates from the previous owner.
    That also makes sense.

    We will look into both suggestions. As far as I can see, it should be simple to implement.
     
  38. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    Yes, for scene objects it should not matter if the Master Client leaves or if you switch it with SetMasterClient(). A new Master Client gets control of the PhotonView.
    Maybe I just wasn't able to reproduce the issue.
    Are you checking isMine?
     
  39. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    The isMine test is ok, after the switch, my creeps answers true for isMine, but the result is not the same anyway.
    As unlick when host leaves the creeps gets kind of stuck.
    + the "controlled locally" goes checked when the host leaves and stay unchecked when the host changes.
    The bug must be around this.


    EDIT:
    Please check how it reacts here:
    http://adversator.sablio.com/

    you will see the deconnection bug too: I got two scenes in the game, selection/creation scene where you make teams and stuffs and the actual game scene where you play.
    You can notice when you launch two separated games, one for the Masterclient the other for the client, that the MasterClient reach the game easily but the client has to reconnect each time leading to bugs, problems with PV not being deleted etc... That never happened before. I found a way to reconnect to the game but it is a bug.

    Now the masterClient bug
    first case: you launch two games one for MC second for Client, wait 50-55 seconds, until the creeps reachs the middle then close the master client tab, you can see then that the client has taken the control and has become the new master client.

    second case: same as before but instead of closing tab, just switch MC tab, the MasterClient changes but check the creeps, they react strangely.
     
    Last edited: Nov 4, 2015
  40. bocs

    bocs

    Joined:
    May 9, 2009
    Posts:
    413
    Yes, I think you understood perfectly.
    *just to clarify, i'll assume when you say "network positions" that includes postion,rotation,velocity,angular etc.
    *very simple fixes..all just a single line in each of the control scripts worked for me.
     
  41. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    @Paradoks: Your bug could be a "Editor issue". When you see the PhotonView in Editor and the remote player leaves, the Editor will not update. Select something else and re-select the object with the PhotonView you check.
    The Inspector does not use different values than isMine. It just doesn't refresh when someone leaves.
     
  42. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    We just updated PUN and PUN+ in the Asset Store. The new version has several minor improvements.
    What's new this time:

    v1.64 (5. November 2015)

    Changed: Online docs are now generated with search enabled.
    Changed: Some scripts in UtilityScripts to not use the PhotonNetwork.networkingPeer directly anymore. This improves compatibility when using PUN in UnityScript.
    Added: Description how to use PUN from UnityScript. This is in the readme.txt.
    Added: PhotonNetwork.ServerTimestamp to expose the low level, synced server timestamp. More doc and usage samples are upcoming.
    Updated: SetCustomProperties() in Room and PhotonPlayer classes. There is now an option to "WebForward" the changes. You can setup a WebHook for this in the Cloud Dashboard (or server config). The parameter expectedProperties is still available (optional, too) to check some key-values before updating the properties.
    Changed: SetCustomProperties() in Room and PhotonPlayer now update the locally cached Custom Properties, as if the client was online. Note: The callbacks (OnPhotonCustomRoomPropertiesChanged and OnPhotonPlayerPropertiesChanged, respectively) get called immediately by SetCustomProperties().
    Changed: PhotonTransformView*Control classes now also update their internally cached values when sending. When transferring ownership, this gives them a recent value as "last networked update", so smoothing and extrapolation works better.
    Updated: To Photon3Unity3d.dll v4.0.0.12.
     
  43. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    @tobias
    I got MasterClient in browser and Client in unity , i look the photonViews in unity, the "control local" is unchecked ( it's normal, i am not master client).
    I change masterClient manually ( by changing tab in browser), i check photonView of the same creep -> unchecked, i select other things, come back to same creep -> unchecked, eachtime i tryied to switch it to true, i cant check the check box, it stays false, even when it answers yes to isMine.
    Funniest:
    I get the tab back in browser, then remove the tab, making the former master client to leave the game: In unity i get the "control local" checked.
    There is something with this SetMasterClient thats does not the job right.

    EDIT:
    You got something wrong with your isMine, when i switch clients , i check the isMine, all the creeps and neutrals answers yes :

    Code (CSharp):
    1.  
    2. void OnMasterClientSwitched(){
    3.  
    4.         if (thisPhotonView.isMine == true) {
    5.  
    6.             Debug.Log("thisPhotonView.isMine: "+gameObject.name);
    7.         }
    8. }
    9.  
    But my behavior relies on isMine too, to make it work i had to change it to isMaster.
    So the Client after becoming Master checks for isMine wich is true, but it becomes false immediately after!!!
    I saw it, i tryied to catch visually the "controlled localy" switch, it does after master change: false-true-false within a second.
    So for now: after master switch, i am supposed to be the master, as master, sceneviews are supposed to be isMine, they are not. are they stay mine only for half a second even if i am master.
     
    Last edited: Nov 5, 2015
  44. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    @Paradoks: Sorry, but I didn't manage to check this today. I needed to release a fix for a bug in 1.64.
    I will take a look early next week.

    I wonder: Did you make sure that SetMasterClient really arrives on all remaining clients, if you switch the tab in the browser? If that doesn't arrive (because the background tab doesn't get the time to do that), then the update might arrive late for the others.
    When focus returns, the others might get updates really late and switch back?

    Does this happen also with a standalone build and the Editor?
     
  45. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    Just released a fix for a bug introduced in v1.64:

    v1.64.2 (6. November 2015)
    Fixed: SetCustomProperties
    in PhotonPlayer and Room classes. It applies set properties locally, unless you do a server-side Check and Swap with expected properties. It also does the callbacks as before (CAS delays the callback by one roundtrip, as the server sets it). In OfflineMode, CAS gets ignored but props stored.
    Changed: The Mecanim Demo minimally with a new scene / meshes.
     
  46. StealThePixels

    StealThePixels

    Joined:
    Apr 2, 2015
    Posts:
    68
    Does it support Windows Phone and Windows Store? It's not mentioned in the site

    If i have the Free version, how does the update to PUN+ version work? Do i have just to purchase it and import it overriding the free version, and everything will work then?
     
    Last edited: Nov 6, 2015
  47. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    @tobiass, In fact here is what i do:
    Master client send connection update to all the clients in the room, if clients dont receive the uptade after a while, they send to server a master client request.
    what might happen: server response positively to one of the requests, and give the command to a former client, but as a "almost disconnected" the former master client dont receive the information that he is not masterclient anymore, he keeps a "kind of" connection.
    How is the master client change handled at photon ?
    Is it possible that the server keep getting information from a client wich think that he is still master client even if he is not?
    Do you cut the masterClient connection properly?
    There must a kind of stream, that conflict, how could the isMine comeback after switching ?
     
  48. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    We have to recompile and release the DLLs in a matter that Unity 5 can make use of them for the Windows Store/Phone platforms. These changed a while ago and due to low(er) demand, we didn't update PUN for them yet.
    What's your timing?

    If you use Unity 5, you technically don't need PUN+.
    You don't have to switch at all, even if you buy the PUN+ for the included 100 CCU "Subscription" (I am adding the quotation marks because it's in fact a one time payment).
     
  49. Paradoks

    Paradoks

    Joined:
    Oct 13, 2009
    Posts:
    436
    @tobiass hey, any news about my issue ? I need support.
     
  50. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,070
    @Paradoks: Switching the Master Client, does not mean that the current one has to leave. We don't cut a connection due to a Master Client switch.
    The server also can't reach a client that is basically just keeping the connection and not reacting otherwise. So, yes, it might be possible that a Master Client is in background and doesn't get the update that it's no longer responsible for the extra tasks.
    While the server now helps electing a Master Client, it does not really manage rights for that role. Clients check locally, if they are the current Master Client, before they do actions that only a Master Client should do (example: instantiating networked scene objects at runtime).
    I can imagine how we could add such checks server-side but at the moment, it's client-side.

    Edit: Can we please move this discussion to the Photon Forum in it's own thread? It's too complex and a bit off-topic for this general thread.