Stop searching for a room

So I was setting up my matchmaking services but i ran into a little snag.

What I want:
When the searching for match message pops up after clicking join game(or quick play) i want it to show the progress of finding a match (maybe custom messages) but if it takes too long to find a match i want to be able to click a button and it'll stop looking

is there a photon callback that I'm not seeing that would handle this?

thanks in advanced!

Comments

  • Hi @Alakeram,

    I guess there is no need to show the progress of the search, because the client will receive a certain answer more or less directly after he has started looking for an available room. Additionally I think there is no 'too long' in terms of finding a match, so maybe it is enough to just show a message, that the client is looking for a game after he has pressed a certain button.

    If finding a random room fails, the void OnPhotonRandomJoinFailed(object[] codeAndMsg) callback gets called, where codeAndMsg[0] is short ErrorCode and codeAndMsg[1] is string debug message. This callback is usually used, to create a new room.
  • Sorry! i never got notified that i received a response, sorry for the late response!

    I fully understand that photon will kick it out of searching for room as soon as it doesn't find a room, I wanted it to keep searching even after it kicking you of the search method, so i was thinking something along the lines of using a co-routine to keep looking for a server (or invoke repeat) until the player cancels the search via a button which would stop the co-routine(or invoke repeat) but i would like to have some text that shows up telling the player whats going on, which i guess i could just use the co-routine or invoke repeat to update the text each attempt to notify the player whats going on

    also a bit unrelated but how would i have a graphic (like a load symbol) move in sync with the loading process or searching progress?

    Thanks again :)
  • Why do you want to keep searching for a game if there is non available? It would be much easier to use the above mentioned callback (OnPhotonRandomJoinFailed) and create and join a new room at this point. Also using this callback, you can update a text component which shows what is going on. However this text might disappear very fast, if creating and joining a new room is possible.
  • Because my game is dead by daylight style where one person hosts a killer type thing and survivors join it, so if you pick survivor your not wanting to be a killer and vice versa, you know what I mean?
  • [Deleted User]
    edited September 2018
    Okay, understood. You can do this with the Custom Room Properties and make them available in the lobby. So whenever someone decides to play as a killer, he presses a certain button and starts searching for a room, where a killer is needed. If there is a room available, he can join that room. If there isn't a room available, he can create a new room. For this room, he sets the Custom Room Properties and make them available in the lobby. Those properties contain two things: the first is, that the room already has a killer, so you are not looking for another one, the second is, that the still needs a certain number of survivors. Speaking of survivors: if a client wants to play as survivor, he presses a certain button and starts searching for a room, where at least one further survivor is needed. If there is no room available, he can create a new one and mark it as searching for a killer and searching for further survivors.
  • thats actually way better, so then a room is created no matter what and then other people can join upon it with how they choose to play, thats amazing! thank you! (sorry for the long delay in a response as i don't get notified by forum responses :( )