Reputation: 19
So, I am making a really basic blueprint networking game which someone can host a server and someone else can join the server, the problem that i'm having is that whenever I try to find a session using FindSessions, it always returns successful even if no sessions were previously hosted, it always execute the On Success pin, but nothing is actually found in the Result array that FindSessions returns. So it's basically telling me that it has found a hosted session when there isn't one and returns me no data about that session that it has "found". it's really weird, this is the blueprintJoin Session Blueprint (sorry about the blueprint, its messed up as i try to fit it in one picture, and JoinLobby in my blueprint is to join the session that it has found with JoinSession and send the player to another map, in this case it runs the JoinLobby event because it has "found" a session but the JoinSession blueprint function will obviously not work because findSession did not return any session results)
Is it my blueprint that's causing it, is it a bug, or is it my internet connection, any help will be appreciated, thanks.
Upvotes: 1
Views: 1535
Reputation: 989
FindSessions executes OnSuccess if the search was successful, regardless if it found something or not. This is not a bug, this is intended behavior.
OnFailed gets executed when a search is not possible (e.g. you are currently host of a session) or failed (e.g. connection error).
If you want to check if there are any sessions you can use the length node on the array.
Upvotes: 1