Search Unity

JoinRandomRoom randomly stopped working on Unity client

Discussion in 'Multiplayer' started by Avalin, Oct 17, 2018.

  1. Avalin

    Avalin

    Joined:
    Oct 12, 2018
    Posts:
    98
    Hi

    Out of nowhere, my client on Unity cannot find rooms, and when it creates one, it won't be found either by other clients. However, my other standalone clients connects to eachother exactly as hoped, no matter how many new clients I try to connect to eachother. Only my Unity client won't connect to anyone.

    This sounds to me like my Unity client may be logging into a different region or server, but it turned out to not be the case:

    Standalone:

    SupportLogger Info: AppID: xxx*** AppVersion: 1.0_2.3 PeerID: 56329 Server: ns.exitgames.com IP: 37.58.80.142:5055 Region: eu


    Unity:

    SupportLogger Info: AppID: xxx*** AppVersion: 1.0_2.3 PeerID: 56329 Server: ns.exitgames.com IP: 37.58.80.142:5055 Region: eu


    This happened out of nowhere, and makes debugging a real pain. Any idea why this could happen?

    EDIT: I just downloaded my project on another computer, and it works fine there. So this is actually Unity/Computer related, and probably doesn't belong in this forum anyway (sorry)
    I tried to uninstall and reinstall unity to no avail on this computer, and I also restarted my computer without effect. Maybe some setting changed that I'm not aware of?
     
    Last edited: Oct 17, 2018
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    The build and the Editor won't find one another?
    I would point you to the GameVersion but that looks fine (as seen in the output AppVersion).
    Are you setting a UserID in the AuthValues? This should not be the same in all instances as you can't join a room more than once (based on the UserID).
     
  3. Avalin

    Avalin

    Joined:
    Oct 12, 2018
    Posts:
    98
    Thanks for your reply! Exactly, and it seemingly happened out of nowhere!
    How can I check if I set a UserID for the AuthValues? I know I didn't change it through a script is all.
    What baffles me more is how everything works flawlessly on the exact same copy of the project, on my other PC's. It's only my main computer this happens, so that's why I'm also suspecting it doesn't necessarily have to do with Photon directly
     
  4. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    PUN 2 currently logs a message like this "Received your UserID from server. Updating local value to: ". If this is giving you a GUID value, it looks like the server is applying a new, random unique value. Then this does not affect your matchmaking.
     
  5. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    Are you really sure you pasted 2 different logs? Both have the same PeerID: 56329...

    Double check that the players don't end up in different regions via Best Region. Just set one.
     
  6. Avalin

    Avalin

    Joined:
    Oct 12, 2018
    Posts:
    98
    I went into output_data to find that other line, and they did look very very similar to me too, I noticed different room names in their "create room" log (I set it to create a room with a random int) but their region was both saying eu. To make matters more interesting, the problem ended up happening on my other machine too today. I noticed one thing I did in both scenarios when it happened: I fiddled with PhotonServerSettings (but didn't change values as I recall, I may have pressed "Refresh RPC's") and looked at the setting-dropdown. Exactly today my main machine, randomly, went back to normal (and funnily enough, seemingly right after my backup-machine did too. So that one only had troubles for a few hours), This also seemingly "randomly fixed itself" a while after I had just deleted PhotonServerSettings, and it came back up and I gave it the app-info. I must have messed something up in it, but I'm not exactly sure what. (It didn't help to delete the ServerSettings the first time it happened, and as mentioned I redownloaded, reinstalled, went back to previous commits and whatnot in order to attempt fixing it without luck, but yeah. Now it works fine.)

    Next time it happens (if it happens again) I'll set the region to only EU and see if that helps anything. :) Thank you for your time!
     
  7. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,067
    Make sure that all clients attempt to join a random game before creating a new one. Create will always create a new one.
    The machine you're running the client on, should not affect the matchmaking logic. Only the region and other values I named.
    You could run the SupportLogger component in your game and should it happen again, save and post both logs.