Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Networking: How to properly leave a session as a client?


what's the "right" way to leave a previously joined session? I've always thought that a simple "open level" node would disconnect the client completely from the actual session but if I use this method I have the problem that I can not join a new session anymore until I restart the complete executable of my game. If I use the "open level" node in conjunction with "destroy session" (on the client side!) it works... this seems very weird to me. So what's the right way to do this?

Thanks and best regards, Daniel

Product Version: UE 4.10
more ▼

asked Feb 01 '16 at 08:54 AM in Blueprint Scripting

avatar image

71 7 15 23

avatar image durabo Feb 01 '16 at 11:48 AM

Hi, you need to call Destroy Session using some in game menu with a Quit/Leave Game button or similar. We tied the OnClick event of the Leave Game Button to call a custom event called DestroySessCaller in GameInstance wich call "Destroy Session" function, this function is from engine Online Subsystem.

Edit: Notice that the Leave Game should open a "MainMenu" level and after it does you call Destroy Session

You can take a look at Multiplayer Shooter game example that epic provides for free, we based on that.


alt text alt text

1.jpg (47.6 kB)
2.jpg (74.3 kB)
avatar image polygon Feb 01 '16 at 12:17 PM

Thanks for confirmation! I always thought that only the session owner/host needed to call the destroy session event.

Best regards, Daniel

avatar image durabo Feb 01 '16 at 12:35 PM

No problem, on a side note, you can take a look to this for more detail: https://docs.unrealengine.com/latest/INT/Resources/Showcases/BlueprintMultiplayer/index.html

In any case my thoughts are that as you use Leave Game logic for both (Server/Hosting Player and Client Player) then the Open MainMenu map and the Destroy Session works for both cases using same logic. Server player will load mainmenu map while also destroying his session (wich will kick the clients) and for the client open a new map forces to leave the sessioned map and maybe the destroy session just fails but who cares if it allows client to join other or the same session again... is not his session he just join to it...

That is far to be technichal but is the way I think of it.. hehe

If it is answered please mark as answered.


(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

This node is also used for leaving sessions. Clients also need to call this node when they leave a game.

more ▼

answered Jan 16 '17 at 05:35 AM

avatar image

175 1 5 7

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question