UMG Multiplayer Host and Join

I have 2 buttons. New Game launches the console command open level?listen and i have Join Game where you can add the ip and it launches then open 123.123.123
I opend port 7777 but nobody can join.
Has anybody a solution or can anybody give me a hint?

68f0110ba15aa8fe90a61fb9cb5da93ba8da4826.jpeg

+1…

+1 guys, very important thing!

What the hell is 123.123.123 for an ip?
Your IP is 4 parts long and you need to give the guys who want to join
your internet ip. You can get it if you google “what is my ip” and check the
first site.

If still no one can enter, than i guess you need to forward the port in your router
settings and maybe allow the game to have connection through your Firewall.

Have you tried building the game and launching 2 copies of the game on one computer?
Do this first and try joining the IP 127.0.0.1
This is the localhost ( your own computer ). If this works, than the port is the problem.

eXi its just a random number i typed. Obviously i gave him my IP and he typed it in. :stuck_out_tongue:
We opend the Port 7777 and 7778 still doesnt work.

Can anybody help?

Are you running any software firewalls? I.E. Windows Firewall?

Yes, but i opend port 7777 udp in windows firewall, also.
Should it work with the console commands on the picture? Or did i forgot about something?
b2b56b2ac9e86d52ac55b60ef25f5a38035f437f.jpeg

Under Windows CMD -> netstat -a -> he shows me this:

6b978631e11b3af991afea9f1f8d633cfa1a32b8.jpeg

So he is doing something with the port when i start a new game, but there is no “listen” behind it.

Did you successfully connected before? Like using dev build and command line argument.
If so, do a print string before execute console command to make sure you actually gets the ip address right.

Note: shipped build from stock UE4 pacakge completely removes command line argument for either host or join, and you lose console as well.
My next test is almost exactly like what you did by testing shipped binary with UMG(although it’s still experimental).

No, i havent connected before. Or maybe i connect - i dont know. I can just open the map with “join game” if i hosted before with “new game” but the characters are not in the same game. Since the replication works perfectly if i do 2 Clients in Editor i dont understand it rly. And also weird is: he doesnt care what i write as ip. If i type “asdasd” he opens the map also, BUT just if i hosted a game before.
I did print string as you said and he gets the ip adress right.
What can i do more? Please help.

Unfortunately, adding UMG seems to break my connection even in Lan, while I’m trying to solve the problem, if anyone know how to solve this please reply.
Also, have UMG seems to prevent me to do a PIE test, my editor crashes every time if I PIE with more than 1 window.

Here is the relevant log where when client connect to my listen server, my server crash.
I’ve searched and trying to narrow down what cause this issue.(like putting isValid for all the getController node.)



[2014.09.21-00.30.25:761] 72]LogNet: Login request: /Game/testDefaultPawn userId: Invalid
[2014.09.21-00.30.25:761] 72]LogNet: Client netspeed is 10000
[2014.09.21-00.30.25:809] 75]LogNet: Join request: /Game/testDefaultPawn?SplitscreenCount=1
[2014.09.21-00.30.25:809] 75]LogPlayerController:Warning: Calling IsLocalController() while Player is NULL is undefined!
[2014.09.21-00.30.25:809] 75]LogWindows:Error: appError called: Cast of NULL to LocalPlayer failed
[2014.09.21-00.30.25:809] 75]LogWindows:Error: Windows GetLastError: The handle is invalid. (6)
[2014.09.21-00.30.25:874] 75]LogWindows: Could not start CrashReportClient.exe
[2014.09.21-00.30.25:874] 75]LogMemory: Platform Memory Stats for WindowsNoEditor
[2014.09.21-00.30.25:874] 75]LogMemory: Process Physical Memory: 167.60 MB used, 171.28 MB peak
[2014.09.21-00.30.25:874] 75]LogMemory: Process Virtual Memory: 162.48 MB used, 175.22 MB peak
[2014.09.21-00.30.25:874] 75]LogMemory: Physical Memory: 3208.40 MB used, 16326.95 MB total
[2014.09.21-00.30.25:874] 75]LogMemory: Virtual Memory: 467.46 MB used, 8388608.00 MB total
[2014.09.21-00.30.31:404] 75]LogWindows: === Critical error: ===


[2014.09.21-00.30.31:404] 75]LogWindows: Cast of NULL to LocalPlayer failed


@MajekPL, every time you start a game it will load default map and default mode you put in the editor, doesn’t matter if your friend connected or not.
In my failed tests(where server crash), client will time out and still load the map and maybe somehow enter standalone mode?
PIE does the connection for you right away, and in that case your editor and 2 client are the same process in memory. So better test it properly with packaged version.

SUCCESS!!!
It was the PlayerController->BeginPlay to createWidget that cause my server to crash.

Instead, now I use this method to create UMG menu when I use my input action to call menu.
Hopefully this will help people in the future. :smiley:

@MajekPL, you need to use development build to test console commands to make sure you can connect first and then try the UMG method.
I use almost exactly what you have, just with interface and I build the string after PlayerController received level name or IP address.
Here is my host and connect to events from within my PlayerController BP. (Note, there are of course a space char in string "open " I use to run console command.)
Also, I use a interface message and use WidgetSwitcher to switch between different level of menu.

Can u upload example project of this ? :rolleyes:

Ye, would be nice if you could upload the host part. I still doesnt understand why it doesnt work out for me since we got basicly the same…
For what do you need the interfaces?
And what do you mean with " I build the string after PlayerController received level name or IP address."?
Thanks. :slight_smile:

How do i do the development build?

interface reduce the need to use CastTo nodes, you have less dependency between blueprints.

all the events you saw above with blue map and two arrow are interface calls. which i call directly from widget blueprint and pass info(ie. ip and level name) over to player controller.

for dev build, it’s in your files package menu item, choose development settings while package a standalone version of your game.

Ok, now i got a dev build. Now i copy the .exe and enter a command for host in the first and a command for join in the second? Where do i have to do it and is it the same as in “execute console command”?

Thanks Penguin for the hint. It works as dev build i can host a listen game and join the game with shortcut commands. So basicly it should work shouldnt it?

yeah, then you start working to get the UMG to run your command from player controller.