Download

How to handle when the host leaves in blueprints? Networking listen server.

At first I was hoping there was some way to reconnect host and client but I don’t think that’s possible in a p2p listen server, but I couldn’t find a way. So my other problem I have now is that when the host leave all the clients just reset the game. I want to make a error message box saying you have been disconnected or something similar. Is there a way to do this?

I haven’t done it before but this is all in my notes…

it’s possible to reconnect but it takes some work on your part. Basically, the same way to initially connect to a host but you’re going to keep a list of everyone already connected and make an arbitrary priority list that every client keeps a copy of. When the host disconnects, the client at the top of that list needs to host a new room, and every client below that needs to connect to the new host.

At some point, if clients can’t connect to the new host, they will try to connect to the next player down the list (and the next player down the list will host).

The point that gets me is trying to save-state the game so that everyone loads back into the same instance.

so what you’re saying is make a session with everyone then add that to an array. sort it out by ping. then if someone dc everyone will get the first session in that list?

there’s no explicit node to do so, but this seems like a proper flow of things

make sense. but i still have the problem of the game resetting itself when the host leaves. do you know how to stop this?

that’s something I’m trying to figure out. except I’ve got one other thing to build before i get around to it (it’s a vr offsetter to be able to walk around with Oculus quest and still have an appropriate character capsule)

I’m also Quest owner. I did something like this too. You probably have your own way of doing it but I’m just gonna share what I did.

What I did was put a box collision on the camera and as soon as that box starts colliding with objects with a certain tag I then get the vector of the camera as it hits. Then black out player screen. If the player holds the reset button on controller then the player goes back to that last vector. Or on event stop overlapping.

Does that work well with joystick movement? I’m not hindered by any vr sickness so I’m trying to stack that with something that can go up ramps and fall.

I hate teleportation movement. It work fine for me but i remember there was an issue when you stop overlapping. Because if there multiple objects it’ll unblock the screen. So I made a double check that after overlapping stop that there was nothing else with the tag in the collision box.