Search Unity

Third Party Photon Unity Networking

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

  1. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    For async gameplay, you can use "Photon Turnbased" server side and the Photon Unity SDK client side.
    The client SDK comes with a Memory Demo. This just stores a turn but you should be able to store your (small) media data in just the same way.
    You can develop and try this out with the free plan.
    PUN does not work with async gameplay yet.
     
    jprocha101 likes this.
  2. vdeloso

    vdeloso

    Joined:
    Mar 4, 2015
    Posts:
    10
    Is there any chance that PUN will be updated to compile on the Linux dev build of the Unity editor?
     
  3. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
  4. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    emm a quick thing. The players in different servers lets say Jp and Us do see each other?
     
  5. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    No. The regions are independent from each other.
     
  6. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    I see, I was suspecting this. Is its possible to avoid this?
    Or is it possible to allow client what what server to use in runtime?
    The CCU are per account or per server?
     
  7. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    The graphs when multiple regions are activated look really broken. Should I send you an screenshot or is a known issue?
     
  8. jerotas

    jerotas

    Joined:
    Sep 4, 2011
    Posts:
    5,572
    We're still attempting to convert our pooling plugin to use Photon. It appears to be quite difficult. Here's a couple related questions that would really help out to know the answers to:

    1) Is there some sort of built in Photon method that does "find game object by View Id" or do we have to build that? Bolt has this, by the way.
    2) If we call an RPC on all clients to activatate / deactivate game objects (that's how spawning and despawning works), no return value is allowed, so what if we want to further manipulate the game objects after they're spawned? Bolt also made this very easy with a 3-method interface we could specify that got used instead of network Instantiate / Destroy calls if you chose that option.
    3) If RPC is not the way to go, how do you suggest handling pooling? Instantiate and Destroy calls are terrible for performance, and I see zero plugins on the Asset Store with network support. We would like to be the first.
     
  9. vdeloso

    vdeloso

    Joined:
    Mar 4, 2015
    Posts:
    10
    @tobiass Sorry for the late reply. No, it doesn't appear to compile as I get errors.
    Code (CSharp):
    1. Assets/Photon Unity Networking/Plugins/PhotonNetwork/LoadbalancingPeer.cs(29,103): error CS0117: `ExitGames.Client.Photon.ConnectionProtocol' does not contain a definition for `WebSocketSecure'
    Does the same for ConnectionProtocol.WebSocket. Tcp appears to go through, and then NetworkingPeer blows up for the same two ConnectionProtocol types... but I probably shouldn't be editing the library's code anyways.

    Once again, this is on the Linux dev build of Unity, v5.1.0f3. I'm running it off of Ubuntu 14.04
     
  10. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    I think my colleagues work on it. Not sure though.
    You could post a screenshot in our forum. There's no proper topic for this, so it's probably best to use this:
    http://forum.photonengine.com/categories/any-topic-chat
     
  11. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    Use PhotonView.Find(viewId).

    You could call an RPC to send some value in return. RPCs are quite commonly used to manipulate PhotonViews/GameObjects. Instantiate also has a override that allows you to set some initial data with the Instantiation. However, that can't be changed later on, so it might not be what you need.
    I probably don't understand your case enough. This sounds like no good answer for me.

    Internally, RPCs simply use Photon Events to send a defined message to the other clients. You can skip RPCs and come up with your own, similar Events to manage GameObjects. If Instantiate and Destroy are not working for you, you can even do your own. PUN is just one way to implement this, based on Photon.

    I would like to separate this topic as thread by mail. When you had a look at RaiseEvent and have more questions, send them to developer@exitgames.com.
     
  12. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    Can you mail me the full compile error list? To: developer@exitgames.com
    The protocol type used there is defined in a dll. This can hardly get lost. So the question is: What is causing this error?
    Try to import the latest PUN Free in your editor in a new, empty project, to make sure it's not something else.
    I can take a look next week, I hope. Got a long weekend though. Thanks for any patience you can muster :)
     
  13. killer_bigpoint

    killer_bigpoint

    Joined:
    Jul 11, 2015
    Posts:
    20
    @tobiass hey man i have a question, when you call application.cancelquit(); is there a way to keep the connection because it seems it loses it when im doing so. Thanks
     
  14. robertsze

    robertsze

    Joined:
    Jul 8, 2013
    Posts:
    83
    Hi guys,

    We recently launched a early access build for Stickman Battlefields for Android with Photon integrated. Everything works really nice and stable, but we have one major problem we can't solve.

    On Android, when the user puts the app into background (home button, power button, etc...) Photon doesn't recognize this. The connection to the server is still open and the user will be in the room forever. We could disconnect the user ourself whenever we receive a OnApplicationPause. But this will also disconnect the user when for example the Google Play Services In App Purchase Dialog opens, the leaderboard opens or an Ad plays. So this is not an option. We tried to kick the player when the player is idle, but this doesn't work either. (I guess a kick just sends a message to the idle player, but as the update loop doesn't run the players device can't react to it).

    So, is there any solution to this?
     
  15. dimitroff

    dimitroff

    Joined:
    Apr 3, 2013
    Posts:
    131
    We have the same problem. Here is how we solve it, have in mind that we don't have more than 4 players in a room.

    1) Every player will send a heartbeat RPC call which every other players will receive, but the master client will decide if a player has expired or not, than if expired, send a RPC call to "force/fake disconnect" the player to all other clients. Basically we are simulating a Fake OnLeave Event, here is a short code example:

    Code (csharp):
    1.  
    2. ExitGames.Client.Photon.EventDataeventData=new ExitGames.Client.Photon.EventData();
    3. eventData.Parameters=newDictionary<byte,object>();
    4. eventData.Parameters[ ExitGames.Client.Photon.ParameterCode.ActorNr]=playerID;
    5. eventData.Code= ExitGames.Client.Photon.EventCode.Leave;
    6. PhotonNetwork.networkingPeer.OnEvent(eventData);
    7.  

    2) The other case is when the Master Client has expired, all players will check for expired master client, using the heartbeat, and if the master client is expired will try to elect a new master client (the player with the lowest ID).

    3) For the going into the background moment, just check how much time the user has spend in the backround, if it is more than X sec, Disconnection from Photon. This is when the app goes into foreground.
     
  16. robertsze

    robertsze

    Joined:
    Jul 8, 2013
    Posts:
    83
    Thanks dimitroff. We thought about a similar solution already. The downside is that we would have to cleanup all player objects manually in such a case, which is of course possible, but error prone and requires additional testing effort each time we make an update. But i fear that this is the only possible solution eventually....
     
  17. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    PUN doesn't recognize most of the cases you describe. By itself, it does not listen to events of the system and does not know if an ad plays or if the game goes on.
    I assume your game can detect all those cases, right? Can it detect when the app really goes to the background (probably for a longer time?!). If so, disconnect only in that case.
    If you can't detect this, we have only three options: a) keep the connection as long as we can, b) for a defined time or c) quit immeditately.
    I think I can implement b) / c). But as said: PUN does not know when exactly it should keep the connection or when it's supposed to end it.

    Would that be OK?
    When I have a good grasp of what's needed, I am sure we find a fitting solution.
     
  18. vdeloso

    vdeloso

    Joined:
    Mar 4, 2015
    Posts:
    10
    Sorry for the false alarm. Latest PUN from the asset store appears to build correctly. Asset Store doesn't seem to work properly with proxies... Tried it last night at home and didn't have the same issue.
     
  19. superluigi

    superluigi

    Joined:
    Feb 6, 2013
    Posts:
    38
    What is the purpose of the group parameter in PhotonNetwork.Instantiate? Can you give e a real world example of when or how you could use it?
     
  20. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    @Tokume: Thanks for the heads up. Good to read it could be resolved.

    @superluigi: That topic is a bit more complex and as we don't have proper samples for it yet, I would have to put some work into an answer. I don't have that at the moment, so sorry for my brief answer:
    The basic idea is that Interest Groups allow you to get updates only when events are sent to the groups a client is interested in. Instantiate does not work well with this, as you can't miss an Instantiate, when you later join the group and get updates for objects you don't know.
    So, afaik, the group in Instantiate just assigns a Interest Group to the GO but does not put the Instantiate itself under control by the groups. The GO will pop up on all clients, no matter which groups.
    Have a look at this: http://www.m2h.nl/network-traffic-culling
     
  21. killer_bigpoint

    killer_bigpoint

    Joined:
    Jul 11, 2015
    Posts:
    20
    @tobiass i just started making a server list inside javascript and for some reason it returns null. If i run this inside a C# script it does indeed return something and i am making a build and creating a room inside that

    this is the code i use in javascript

    var game : RoomInfo[];

    if(PhotonNetwork.insideLobby == true)
    {
    game = PhotonNetwork.GetRoomList();
    }

    #EDIT: i managed to get it working. i dont need help anyway
     
    Last edited: Sep 13, 2015
    tobiass likes this.
  22. indie6

    indie6

    Joined:
    Dec 15, 2012
    Posts:
    101
    @tobiass Is it possible to make a turn based game using Photon PUN+ and not Photon Turnbased? I just want to avoid the server setup thing in PhotonTurn Based..(Azure Part)

    ** EDIT **

    I am a little confused about the server side requirement... I just tried the memory match demo and it worked w/o any server setup. Is the Server side required to store player stats( ranking , kills etc) or its used for some other purpose?

    If I want to make a multiplayer game like Samurai Gunn restricted to only 2 players..

    Which networking solution should I use?
    I want the room to be of max 2 users and the game starts when its filled..
     
    Last edited: Sep 13, 2015
  23. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    @killer_bigpoint: Thanks for the update. Good you found it.
    @indie6: It is perfectly fine to make a turnbased game with PUN, as long as the sessions are being short. No server side setup is required for this.

    You need Photon Turnbased to store and load games. Your players can leave and rejoin rooms and they could play asynchronously, if your game allows that.
    Photon Turnbased only stores individual rooms, so you would need to use some service for player stats, rankings, etc.. PlayFab works great with PUN, has a lot of those features and can be extended.
     
  24. pwinterhalder

    pwinterhalder

    Joined:
    Aug 24, 2015
    Posts:
    1
    brainCloud is another option. Provides player stats, leaderboards, achievements, push notifications, IAP, etc - and works great with Photon. Even allows you to write your own server-side features.

    There's a fun demo (with full source) that shows brainCloud working with Photon here.

    Cheers!

    [Discloser - I work for brainCloud.]
     
  25. indie6

    indie6

    Joined:
    Dec 15, 2012
    Posts:
    101
  26. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    We just released PUN v1.61.
    This time, it has several tweaks for connection quality and smaller fixes.

    The biggest new feature this time is the option to implement and use a Object Pool.
    Implement IPunPrefabPool and assign it to PhotonNetwork.PrefabPool. Note: GameObjects will not run Awake() and Start() but PUN will call OnPhotonInstantiate() as if the GameObject would be new.
    Check the description of IPunPrefabPool and it's methods. You might have to adjust your scripts on prefabs, to make best use of this.
    Note: It's still a bad idea to network instantiate bullets.
     
  27. superluigi

    superluigi

    Joined:
    Feb 6, 2013
    Posts:
    38
    Where do I declare
    PhotonNetwork.sendRate =30;
    PhotonNetwork.sendRateOnSerialize =15;?
    I do it in Start(), is this ok?
     
  28. superluigi

    superluigi

    Joined:
    Feb 6, 2013
    Posts:
    38
    I have an interesting question. How do I control my characters actions (movement, rotation, etc) via the server like everyone else. The way I do it now is my script controls my actions and then I send that info to the server so that everyone else can receive my new position, rotation, etc:
    if(stream.isWriting)
    {
    stream.SendNext(transform.position);
    stream.SendNext(transform.rotation);
    }
    However, I would like for my character to move exactly the same in my screen as everyone else. I really do not mind the small input lag that would cause because my game is more reliant on position than reflexes.

    The only way I can think of achieving this is to send the vector 3 to the server when I move and then receive that info back from the server to move my character there. Any other ideas?
     
  29. sumpfkraut

    sumpfkraut

    Joined:
    Jan 18, 2013
    Posts:
    242
    I get this error after upgrade from .6 to .61 (only 1x if i join a new empty room)
    and it seem only in the editor. but it runs anyway everything as before.
    what could i do to remove this error?
     
  30. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    This looks like your code is trying to join some room which is not existing. My guess is this is not a problem in PUN. I would have noticed if I got this in all cases.
    In doubt, try to reproduce this in one of the demos and let me know.
     
  31. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,066
    For Photon, the server usually doesn't run game logic. So you can't send your input to the server and just move your character according to the calculated positions.
    Even if you send your input to everyone (including yourself) via the server, there might be lag in any one connection and your clients will de-sync.
    To avoid such things, you could use a lockstep mechanism, which is a whole different beast by itself. It's hard to get done correct (so there is never ever any de-syncing, no matter how long a game runs).

    I would rather accept potential de-syncing and make sure things are correct for key events in the game.
     
  32. sumpfkraut

    sumpfkraut

    Joined:
    Jan 18, 2013
    Posts:
    242
    yes, i try to join a room, and if the room not exist, i'll create one with this name.
     
  33. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    @tobiass

    Hey there, I really need some help ASAP!! I have to showcase my game Heroes of Rune at two upcoming events, but they are charging me for Internet Access. I need to setup a Local PhotonServer to avoid the cost and just setup a demo with 2-3 client laptops connecting to a local PhotonServer. Anyhow I followed the steps for how to start the server and updated my PhotonServerSettings to the Local PhotonServer IP, but I keep getting connection errors.

    Please see the screenshot and error logs below for details... You will notice that the Test Client Works fine and connects on 127.0.0.1:4530, I also tried switching my PhotonServerSettings to this localhost IP and Port and disabled my Firewall but no luck. Please advise...

    NOTE: I'm using the latest Photon Sever SDK, but the Game's Photon Version is v1.24 (18. October 2013) could this be the problem? Although I don't see why because the game connects perfectly fine to PhotonCloud which I would assume is running the latest Photon Server version as downloaded from your website. So what am I missing to get this working?

    *I can't really afford to update the PUN version in my project at this time, as I get way too many errors and just don't have the time or heck even the knowledge to fix them all as i'm currently without a developer to assist me with this. So it would be appreciated if you can help me get this working. Thank You!

    photonserver.jpg

    Code (CSharp):
    1. Authentication failed: 'Unknown operation code 230' Code: -1
    2. UnityEngine.Debug:LogError(Object)
    3. PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:174)
    4. NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:802)
    5. NetworkingPeer:OnOperationResponse(OperationResponse) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:862)
    6. ExitGames.Client.Photon.PeerBase:DeserializeMessageAndCallback(Byte[])
    7. ExitGames.Client.Photon.EnetPeer:DispatchIncomingCommands()
    8. ExitGames.Client.Photon.PhotonPeer:DispatchIncomingCommands()
    9. PhotonHandler:Update() (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:80)
    Code (CSharp):
    1. Cannot send op: 227 Not connected. PeerState: Disconnected
    2. UnityEngine.Debug:LogError(Object)
    3. PhotonHandler:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonHandler.cs:174)
    4. NetworkingPeer:DebugReturn(DebugLevel, String) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:802)
    5. ExitGames.Client.Photon.EnetPeer:EnqueueOperation(Dictionary`2, Byte, Boolean, Byte, Boolean, EgMessageType)
    6. ExitGames.Client.Photon.PeerBase:EnqueueOperation(Dictionary`2, Byte, Boolean, Byte, Boolean)
    7. ExitGames.Client.Photon.PhotonPeer:OpCustom(Byte, Dictionary`2, Boolean, Byte)
    8. ExitGames.Client.Photon.PhotonPeer:OpCustom(Byte, Dictionary`2, Boolean)
    9. LoadbalancingPeer:OpCreateRoom(String, Boolean, Boolean, Byte, Boolean, Hashtable, Hashtable, String[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/LoadbalancingPeer.cs:103)
    10. NetworkingPeer:OpCreateGame(String, Boolean, Boolean, Byte, Boolean, Hashtable, String[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/NetworkingPeer.cs:707)
    11. PhotonNetwork:CreateRoom(String, Boolean, Boolean, Int32, Hashtable, String[]) (at Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonNetwork.cs:1172)
    12. SCR_MultiplayerLogin:CreateNewRoom(Boolean) (at Assets/CodeGame/SCR_MultiplayerLogin.cs:825)
    13. SCR_MultiplayerLogin:QuickJoinRoom(Boolean) (at Assets/CodeGame/SCR_MultiplayerLogin.cs:778)
    14. SCR_MultiplayerLogin:OnQuickplayClicked() (at Assets/CodeGame/SCR_MultiplayerLogin.cs:724)
    15. EventDelegate:Execute() (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:459)
    16. EventDelegate:Execute(List`1) (at Assets/NGUI/Scripts/Internal/EventDelegate.cs:602)
    17. UIButton:OnClick() (at Assets/NGUI/Scripts/Interaction/UIButton.cs:248)
    18. UnityEngine.GameObject:SendMessage(String, Object, SendMessageOptions)
    19. UICamera:Notify(GameObject, String, Object) (at Assets/NGUI/Scripts/UI/UICamera.cs:914)
    20. UICamera:ProcessTouch(Boolean, Boolean) (at Assets/NGUI/Scripts/UI/UICamera.cs:1590)
    21. UICamera:ProcessMouse() (at Assets/NGUI/Scripts/UI/UICamera.cs:1218)
    22. UICamera:ProcessTouches() (at Assets/NGUI/Scripts/UI/UICamera.cs:1288)
    23. UICamera:Update() (at Assets/NGUI/Scripts/UI/UICamera.cs:1052)
     
  34. LeonidRU

    LeonidRU

    Joined:
    Apr 1, 2013
    Posts:
    11
    How to fix warnings in Unity 5.2.0f3 (64-bit)? Photon PUN + 1.61.
    Code (CSharp):
    1. Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs(314,66): warning CS0618: `UnityEngine.Application.isLoadingLevel' is obsolete: `This property is deprecated, please use LoadLevelAsync to detect if a specific scene is currently loading.'
    2.  
    3. Assets/Photon Unity Networking/Plugins/PhotonNetwork/PhotonView.cs(319,178): warning CS0618: `UnityEngine.Application.isLoadingLevel' is obsolete: `This property is deprecated, please use LoadLevelAsync to detect if a specific scene is currently loading.'
    4.  
     
  35. robertsze

    robertsze

    Joined:
    Jul 8, 2013
    Posts:
    83
    We still have major troubles with this case. In the meantime we added heartbeat checks, send RPC from each client to each other, switch master clients as appropriate (if a master client appears to be in background), simulate local disconnects for idle players and try to kick inactive players. But there is still the case when the app is put in background that the PUN server never disconnects this player. If the player leaves the device in background mode for hours or even days, the slot in the network room is still in use for this player. Wouldn't it be possible that the server just removes such clients after not receiving something like a heartbeat RPC for a configurable amount of time? (the server should remove the not responding client from the room and of course notify all other clients about this).

    Would this be possible?
     
  36. superluigi

    superluigi

    Joined:
    Feb 6, 2013
    Posts:
    38
    I encountered an issue. I have a lobby scene and a lobby script that works in conjunction with it where players join rooms, create rooms, choose player name, etc. When a room is created there are custom room properties that are assigned to the newly created room. Then when you start a match you load a new scene. This is where the issue happens. When I try to get info on the custom room properties it says they don't exist. I guess I figured we were still in the same PhotonNetwork.room, but I guess that might not be the case. When you load a scene do you join a new PhotonNetwork.room?
     
  37. robertsze

    robertsze

    Joined:
    Jul 8, 2013
    Posts:
    83
    We did more test with around 700 CCUs and 100 rooms running. This is still a major issue. We can't disconnect the players automatically in OnApplicationPause() because this will also disconnect players when for example a "low battery" message pops up, the user watches a video or purchases an in-app. What we do now is to let every other client detect idle players (players not responding to a heartbeat message for 60 seconds) and simulate a disconnect of this client on all other clients. As said, this works very well, but there is one major problem. The not responding client doesn't get disconnected from the photon server, meaning the player still occupies a slot in the room. In the worst case, a room is than filled with only idle players and no one can join anymore.

    We can think of two possible solutions for this issue, but both require help from you photon guys.

    1. Kick players. The current CloseConnection() doesn't work as this method relies on the idle player to actually kick himself. (CloseConnection just sends a message to the client which then kicks itself. Works fine as long as this player is still responding). If there would be a command which we can send to the server which actually kicks the player and informs all other players about the disconnect it would be fine.

    2. Heartbeat control by photon itself. For example, every client has to send a specific heartbeat message to photon server. If the server doesn't receive such a message in a specified amount of time, than photon kicks the player like in the first case.

    Hope we can get a solution for this issue quickly... thanks guys!
     
  38. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    I'm a bit messed with regions and hosting.
    If I use
    Hosting Best Region
    and
    Enabled REgions US
    All players worldwide will be place in the same room if I use randommatch?

    If not what is the config to consider worldwide players in randommatch?
    __________________
    ok select Photon cloud in hosting and US in region.
     
    Last edited: Sep 26, 2015
  39. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    Hey Exit Games, whats going on? A week has past, and I see 0 responses to anyone's request for support... especially mine since last Sunday. :confused:

    I've been patient, but this is a bit ridiculous... If you want to stay in business and keep competitive with Unity's Networking Solution I don't think slacking on response to support questions is going to help your cause. Really hope you guys improve upon this.

    By the way I am a paying customer... is there somewhere else I should go to receive better support than this? I've been patient on creating duplicate threads or sending an email on the same issue because you asked me to post my support question to only one place. In doing exactly that I received nothing in return.... You may want to seriously review how you're handling support.
     
  40. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
    Go to exitgames forum.
     
  41. TooManySugar

    TooManySugar

    Joined:
    Aug 2, 2015
    Posts:
    864
  42. PatrickKa

    PatrickKa

    Joined:
    Apr 30, 2014
    Posts:
    245
    Any updates on this topic? I think you really should implement option b) / c) because I see more and more games that got problems like this in common. My game also got that problem and it is really frustrating to join a game with only inactive players in it. People are too lazy to exit the game and just keep it in the background. This also wastes bandwidth and other resources without a real reason. Of course people could create crazy RPC's and all that stuff but why should they? I think you could handle that within the Network Engine itself very easily and it will help a lot of people that are targeting mobile device.

    By the way I found a bug regarding PhotonNetwork.Disconnect. You broke autoCleanUpPlayerObjects. See here for more details:
    http://forum.photonengine.com/discussion/6665/photonnetwork-disconnect-broken#latest

    Would be great if you could fix PhotonNetwork.Disconnect and add the user defined timeout to handle minimized games (inactive players).

    Thank you!
     
  43. jonkuze

    jonkuze

    Joined:
    Aug 19, 2012
    Posts:
    1,709
    problem is i created two support thread before on here and there forum and they told me not to do that because it created more work for them somehow. So it's best to keep to one support thread according to them. But I can see now they are totally ignoring this Unity Support thread at this point. If that's the case, a nice email or notification would be great so we can stop wasting our time posting requests for support here instead use their email or forum. Although I don't the response time would be any different at this point. My best guess they are scrambling trying to figure out how to stay in business with Unity Networking solution getting better.

    Regardless of what they are doing on the backend, it would be nice to get an update rather than let us sit there wondering what the heck is going on.

    Communication is Key... no Communication = Lost of Customers and eventually Business... So if I was told one thing to stick to one forum and they supposedly check the forums daily... then I'm following their support instructions, if they prefer me to email or go to their forums instead where is the communication? None what so ever....
     
  44. LovattoStudio

    LovattoStudio

    Joined:
    Feb 11, 2015
    Posts:
    15
    Hello.

    I want to report that in the latest version (1.61.1), PhotonNetwork.autoCleanUpPlayerObjects not work, any object instance disappears when the player leaves the room, I test it with the previous version and then work, but not with the lasted.
     
  45. naveen1054

    naveen1054

    Joined:
    Sep 28, 2015
    Posts:
    2
    Hey guys I am working on a multiplayer game where players are to be divided into two teams....as i m successful in maintaining teams but for further functionalities I want to calculate no. of players in each teams respectively......So please guide me how to find no. of players in a team.
    reply ASAP.......!!!!
     
  46. BeetlePlay

    BeetlePlay

    Joined:
    Jan 31, 2013
    Posts:
    18
    WebGL disconnects from Photon server with error:

    Code (CSharp):
    1. Exiting receive thread (inside loop) due to error: Abnormal disconnection.
    Game works great on all possible platforms (Editor, exe, web player, ios, android, wp8) but on WebGL we always get disconnected. Sometimes when new player connected, sometimes after a few minutes of play.

    Disconnects is only if Master Client is WebGL in browser (Firefox and Chrome).
    If Master in editor - all is ok.

    Unity 5.2.1f1, Photon 1.61

    Nothing strange in Full log for Photon and/or Development build.

    Full error log from browser:

    Code (CSharp):
    1. Exiting receive thread (inside loop) due to error: Abnormal disconnection.
    2.  
    3. _JS_Log_Dump()WebGL.js:8655
    4. __Z40DebugStringToFilePostprocessedStacktracePKcS0_S0_iS0_iiiiPFvRK11CppLogEntryE()WebGL.js:887760
    5. __Z17DebugStringToFilePKciS0_iiiiPFvRK11CppLogEntryE()WebGL.js:887607
    6. __Z25Debug_CUSTOM_Internal_LogiP15ScriptingStringP15ScriptingObject()WebGL.js:932752
    7. _Debug_Internal_Log_m5266()WebGL.js:3135209
    8. _Debug_LogError_m3852()WebGL.js:3135257
    9. _NetworkingPeer_DebugReturn_m1365()WebGL.js:2302098
    10. __ZN23InterfaceActionInvoker2IhP8String_tE6InvokeEjP8TypeInfoPvhS1_()WebGL.js:3362186
    11. _U3CReceiveLoopU3Ec__Iterator2_MoveNext_m1797()WebGL.js:2334890
    12. __Z26RuntimeInvoker_Boolean_t35PK10MethodInfoPvPS2_()WebGL.js:3316221
    13. dynCall_iiii()WebGL.js:3444695
    14. invoke_iiii()WebGL.js:17130
    15. __ZN6il2cpp2vm7Runtime6InvokeEPK10MethodInfoPvPS5_PP12Il2CppObject()WebGL.js:83972
    16. _il2cpp_runtime_invoke()WebGL.js:33237
    17. __Z20il2cpp_invoke_method21ScriptingMethodIl2CppP15ScriptingObjectP18ScriptingArgumentsPP18ScriptingExceptionb()WebGL.js:720985
    18. __ZN19ScriptingInvocation6InvokeEPP18ScriptingExceptionb()WebGL.js:825426
    19. __ZN19ScriptingInvocation6InvokeIbEET_PP18ScriptingExceptionb()WebGL.js:825356
    20. __ZN9Coroutine3RunEv()WebGL.js:816212
    21. __ZN9Coroutine17ContinueCoroutineEP6ObjectPv()WebGL.js:816160
    22. __ZN18DelayedCallManager6UpdateEi()WebGL.js:700048
    23. __Z10PlayerLoopbbP10IHookEvent()WebGL.js:803218
    24. __ZL8MainLoopv()WebGL.js:1734870
    25. dynCall_v()WebGL.js:3444506
    26. Runtime.dynCall()WebGL.js:312
    27. Browser_mainLoop_runner/<()WebGL.js:9538
    28. Browser.mainLoop.runIter()WebGL.js:11099
    29. Browser_mainLoop_runner()
     
  47. vadiml

    vadiml

    Joined:
    Aug 12, 2014
    Posts:
    32
    Hi. Sorry for long delay.
    Running 2 years old plugin version definitely could be a problem. Current PUN is 1.61.
    It's common good practice to update to the latest when running into the issues.
     
  48. vadiml

    vadiml

    Joined:
    Aug 12, 2014
    Posts:
    32
  49. vadiml

    vadiml

    Joined:
    Aug 12, 2014
    Posts:
    32
    This is the issue more and more customers complain about last days. We should discuss this internally and probably update server side. More thoughts on this: http://forum.photonengine.com/discussion/comment/25206#Comment_25206
     
  50. vadiml

    vadiml

    Joined:
    Aug 12, 2014
    Posts:
    32
    So do they exist before loading scene? Are you in totally new room or rejoined the same? PUN never joins or creates rooms implicitly. Check logs. If client left room and joined it again for some reason, logs should contain info about this. Also check client states before and after operations you execute.