x

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"

Is Event PostLogin called automatically during testing?

In the content example "Network Features," it seems like a login event is never explicitly initiated. Is this something that happens behind-the-scenes when starting the game from the editor with multiple clients?

I see the PostLogin event in the GameMode blueprint to then handle the client connections and pawn assignment, but don't see any scripts that make these connection attempts.

Product Version: UE 4.10
Tags:
more ▼

asked Mar 07 '16 at 05:44 PM in Blueprint Scripting

avatar image

BioeJD
18 4 7 9

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Post login is a function that is provided for you which will give you a reference to the new player controller that entered the game. At that point this player already joined the server.

When testing with multiple clients in editor one is opened as listen server, the others automatically joined that server as clients.

Those are ready to go utility functions provided by the engine and are written in C++. If you want more access or control over networking you will have to migrate over to C++ as well... which is for the better anyway. Keep in mind that Blueprint is significantly slower than C++ and when handling networking for multiplayer you want to reduce the delay as much as possible which then again means you should use as little as possible blueprint for networking itself.

more ▼

answered Mar 07 '16 at 06:32 PM

avatar image

Erasio
5.9k 291 86 293

avatar image BioeJD Mar 07 '16 at 06:51 PM

I understand that and will be doing networking in C++. My question more revolved around the editor functioning with multiplayer during testing. You said " At that point this player already joined the server." So my question was, the connection attempt is made automatically when hitting the play button in editor then? I don't see any C++ classes referenced in the project which actually initiate and handle the login. I only see the post login, which is called obviously after this connection has happened.

avatar image BioeJD Mar 07 '16 at 06:59 PM

Basically I'm saying, the PostLogin event should run after a client connects. Is there code specifically in that project initiating the connection for the clients, or is that login code automatically ran in engine when you hit "play"?

avatar image BioeJD Mar 07 '16 at 07:12 PM

Sorry, to be more clear, I assume when you hit play, the client is automatically connected via command line during testing:

\\game.uproject 127.0.0.1 -game

Yes?

avatar image Erasio Mar 07 '16 at 07:35 PM

I'm not entirely sure how exactly it connects. But as for the relevant part when you play some level as I said it opens a listen server and connects.

I never tried if I could connect with a standalone to that server. It might not be hosted on localhost but something engine intern. I really have no idea as it wasn't relevant for me so far.

But it doesn't need any coding for the clients to connect. This is done automatically in the editor for that type of testing. Later for your standalones you will have to do that yourself.

(comments are locked)
10|2000 characters needed characters left
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