How do i use GetNamedSession?

Hello,

I have created a session in my game, and i can connect client players.

When i try to access the current session on the server by calling GetNameSession(GameSessionName), its state is correctly set to InProgress, but the bHosting variable is always false.

Anything i should do before using that function ?

I even tried to look for sessions from the server but it doesn’t seem to see its own session.

So how can i access the current session from the server with the session properties correctly set ?

Thanks

Cedric

After a few tests, i should rephrase my question.

The GetNameSession seems to work fine, i can get every info i need (owning user, state, etc).

So most probably, since bHosting is always false, it probably means i don’t understand what it means.

I thought that hosting a session is like being the server (being registered and hosting = server, while being registered and not hosting = client).

But from the little i could google, the client can also host a session, so i’m confused about what it means to host a session.

If anyone care to explain, thanks :slight_smile:

Cedric

1 Like

I am also researching this. Specifically I am looking for information to migrate the host.

For now this is what I know.
-There are two types of host (dedicated server and listening server).

The dedicated server runs on a “server” machine and is not a client.

The listening server run in the “client” machine (player machine) and this client can create a session and act as a server.

So, the listening server is free and dedicated server is paid.

Listening server is worse and dedicated server is better.

In listening server it’s a good idea to migrate the server from one client to another when the current server leaves the game…so other players won’t have a horrible experience in the game (it will be bad but not horrible).

I am looking for information to do this…

The theory is simple but the practice is a headache.

Another player must create a new session all other players must connect to this new session. Then the game must be restored in the same state in which the connection was lost.

I would love to see some sample code to do this.

I hope the little I know has helped you in some way.