Please help me figure out this problem with connecting!!!
I have ran a server on my dedicated server (all ports open) and still cannot connect…
Please help me figure out this problem with connecting!!!
I have ran a server on my dedicated server (all ports open) and still cannot connect…
That is totally doable, your clients just have to connect to your servers IP address. You need to give that value to your clients, either hard coded, or via some web-service.
Okay well I need some help…
I have this going on to host my game:
singleton.StartHost();
and this to join it:
singleton.networkAddress = IPServer; (IPServer is my address)
singleton.networkPort = Port; (Port is my port that is port-forwarded)
singleton.StartClient();
However it cannot connect to my ip address. (everything is port-forwarded correctly)
Where am I going wrong?
EDIT: If I connect instead of using my ip address, and use “localhost” it works. What can be the problem? ![]()
Possibly I shouldnt use StartHost() method? Should I use NetworkServer.Listen(Port) ??? or what am I doing wrong :L
Are you using 2 different machines as the server and client? Can you use some local IP values inside your network to test for connections? ie. 2 machines on the same LAN. Then move to trying to connect via your external IP (the IP your router/modem has, where you have it forwarded to your server machine). The code you have above should work, assuming everything else is setup correctly.
I am using just my one computer to run 2 instances of the game. One instance hosts (server + client).
The other one I try to connect to using the external ip address, and it wont connect ![]()
I will see if I can use my local ip address when I get home.
But you are saying it should work? Something else is the problem?
Yeah, but i also have to admit that i don’t do testing that way, i have 2 different computers to test with, because no player would ever have a server and client as 2 different processes running like that. But i understand having to test that way, and i vaguely remember that only using LocalHost or the loop-back address worked when running 2 instances on the same computer… But really, i don’t know - what you have there looks right, and if it works using the loopback/localhost setup, then it is working. You really need a second machine to test with.
Oooohh kk… Something is SERIOUSLY wrong…
I made a brand new project with net manager and host it.
i put the game on my dedicated server (all ports are open so everything can connect, with no problems)
now when I use the basic network manager HUD, I type in my dedicated server’s ip address and try to connect.
NOTHING! It still won’t connect!!! What the hell is going on… I am using unity’s stock network manager and network manager hud.
Is this bugged right now?
i am using Unity 5.5.0f3 (64-bit)
it is like unet is ONLY allowing LAN connections.
I had a similar problem with port forwarding to my development machine not working. If I built an executable port forwarding to that did work. It has since ‘resolved’ itself and I have no idea why.
To see if it is the same problem… build an exe and try hosting from that rather than from inside of the Unity development environment.
This was my post about what sounds like a similar problem? I even entered a bug report but had to cancel it since they couldn’t recreate it - and it went away on my machine.
Just did this on now version 4.5.1 of unity. Still the same thing.
Any other advice or help you can give me?!
This should be working…
btw, my issue is happening with an exe and with the editor. Either way.
“localhost” works. (my local computer)
“127.0.0.1” works (my local computer)
“10.0.0.167” works. (my local ip)
“…” NOT WORK (my actualy ip) I have all ports open (my dedicated server)
Watch the video:
I assume you have checked your firewall log to make sure it isn’t blocking anything it shouldn’t be?
I know this sounds silly, but have you tried restarting both your computer and your router? My issue with this cleared on its own a day after I experienced it without any further interventions… so all I can think is one of the two rebooted in that time. My issue was connecting on a port forwarded laptop on wifi, not sure how different your situation is. I had no problems with 5.4 and the issue almost drove me to moving back a version.
Watching your video, it looks like exactly the headache I was dealing with a couple days ago. It cleared after going to my families house and using their wifi (I also tried to port forward there and it didn’t work)… but when I got home it worked.
NO CLUE why. A restart of all components is never a bad idea… possibly that port on your router is jacked up.
How would this explain trying to connect on my dedicated server in France though?
I will try to reboot everything… but im not sure this will solve it.
Honestly I have no idea. All I can do is tell you the few things I know happened between having that same problem and it resolving itself for me.
Unfortunately, a reboot of my computer and router/modem did NOT work
…
Any other ideas why the hell this is happening!??
I’ll post back if anything occurs to me, but again I didn’t solve it when it happened to me… it resolved on its own so I can’t even recreate the problem any longer.
One last suggestion though. 5.5 has had issues that have required me to reimport all assets every time I switch platforms (My server is PC and my clients are mobile). It is possible that the ‘reimport all’ purged some corrupted file data.
reimport all did not fix it either :"(
I got nothing else for you. Sending in a bug report may be worthwhile. They got back with me on it in a couple days when I reported my issue.
Can you test and see if the args -batchmode -nographics
to see if it automatically hosts the server. Because it won’t even on my localhost.