#LAN using Fish-Networking-Discovery

38 messages · Page 1 of 1 (latest)

somber schooner
#

Fishnet version: 4.3.8R Pro
Unity version: 2022.3.40f1

Hi there, I just created a fresh unity project and set up a player with a simple movement script. I want to be able to test the game with other computers on my LAN, but after following the instructions in the github page (https://github.com/FirstGearGames/Fish-Networking-Discovery/) it doesn't work.

All it says in the console is that it keeps retrying, but it never actually connects to the server on the other computer in my LAN.

Help would be greatly appreciated! 😄

GitHub

A very simple LAN network discovery component for Fish-Networking - FirstGearGames/Fish-Networking-Discovery

coral sorrel
#

Hi there, do you have some screenshots of how you've set it up currently? And also what do you do after pressing play in the editor?

somber schooner
#

Thanks for answering so quickly. Tell me if you need any more screenshots

On one pc, I press play in the editor, press the server and client buttons (from the network manager gui) and then press start under the server group and start under the advertising group.
On the other pc, I press play in the editor, press the client button (from the network manager gui) and then press start under the searching group.

coral sorrel
somber schooner
#

It didn't work.

pc 1: automatic on, pressed server and client buttons in the top left
pc 2: automatic on, pressed start under the searching group in the top right

coral sorrel
#

Ok, it could be the port or firewall perhaps. I'd try with a port like 7771

somber schooner
#

Changed to port 7771 instead of 3000 on both devices, same thing still happens.
I haven't touched any firewall settings. Is there anything I need to disable there in order to connect?

coral sorrel
#

Well, the app may need to be allowed through your firewall

somber schooner
#

This is what is written in the official fishnet docs about this

coral sorrel
#

For debugging the connection it's best to ignore that for now

somber schooner
#

These are the firewall settings. Both enabled

coral sorrel
#

That looks correct

#

Hmm, I tried it now myself and it also cannot find the server. So I then tested on an old game I made that definitely did work and was using an older version and it also isn't working to find the connection. Although direct connecting to the IP is working 🤔

somber schooner
#

Interesting. I have another person working with me on the project in the same LAN so is there any alternative way we can easily connect to the same server and test the game together?

coral sorrel
#

I'm not sure why it's not working currently, perhaps some configuration thing. Without it you could set it up to connect to a direct ip, it would help if one of you use a static ip for this

somber schooner
#

Do you happen to know how do connect to the same server using software like hamachi?

coral sorrel
#

Yes, but that won't really be any different if you are a LAN network already

somber schooner
#

So is it possible to directly connect to a private IP address from the LAN? If so, how?

coral sorrel
#

Oh yes, absolutely. In the Tugboat component (Or whichever transport you are using) you set the "Client Address" field to the IP address you want the client to connect to. You can also do this through code or when calling StartConnection

somber schooner
#

I tried this by setting Client Address in tugboat to the private ip address of pc 1 on both pcs. The second pc could not connect (ConnectionFailed)

#

Did I do it incorrectly?

coral sorrel
#

That should be correct then. Pc 1 had started its FishNet server, right?

somber schooner
#

Yep

coral sorrel
somber schooner
coral sorrel
#

Ok I just tested and connecting with the direct IP is working on my end

#

This was the configuration:

#

The IP entered is the IP of the device I used as a server

#

I then made a build of the game and ran it on the same computer and on a different computer

#

Both connected succesfully

somber schooner
#

I did the exact same thing, but no build. Does it have to be on a build?

coral sorrel
#

I had the server in the editor and a build connecting

#

It shouldn't matter though, as long as the application is allowed through the firewall

somber schooner
#

Alright so after some testing with builds I reached the conclusion that it only works if the server is in a build and not in the editor (the client connecting to it can be in a build and in the editor). Is this intended behavior? It would be nice to have the server in an editor instead

coral sorrel
#

It might be the firewall blocking the editor specifically but not the build 🤔
That's the only reason I can think of

somber schooner
#

I'm just not sure how to make it work with the firewall still on

somber schooner
#

@coral sorrel Thanks for all the help. I managed to solve it by creating a new rule in the firewall for the unity editor