alvyxaz / barebones-masterserver

Master Server framework for Unity
475 stars 106 forks source link

Quick Setup Example Not Working with Remote Server Connection #206

Closed gotanidea closed 6 years ago

gotanidea commented 6 years ago

The Quick Setup example works well if the MasterAndSpawner.exe, GameServer.exe and Client.exe run locally. But the Client.exe cannot connect if the MasterAndSpawner.exe and GameServer.exe run on a remote server.

I tried these:

  1. Changing the Server IP field value of the Connection To Master objects in the MasterAndSpawner.exe and GameServer.exe from 127.0.0.1 to the remote server's public IP address (e.g. 18.118.113.118). Running the MasterAndSpawner.exe and GameServer.exe with this setup takes a very long time to start. The Client.exe cannot connect, despite I have changed the Server IP field value of its Connection To Master object to the remote server's public IP address (e.g. 18.118.113.118).

  2. Keep the Server IP field value of the Connection To Master objects in the MasterAndSpawner.exe and GameServer.exe as 127.0.0.1. Running the MasterAndSpawner.exe and GameServer.exe with this setup is smooth. But the Client.exe still cannot connect, despite I have changed the Server IP field value of its Connection To Master object to the remote server's public IP address (e.g. 18.118.113.118).

What did I miss on the Quick Setup example?

MostHated commented 6 years ago

Start your master server with this :

./MasterAndSpawner.x86_64 -msfStartMaster -msfStartSpawner -msfMachineIp xxx.xxx.xxx.xxx(ip or url of your server) -msfMasterIp 127.0.0.1

See if it makes a difference.

gotanidea commented 6 years ago

@MostHated : The problem was the firewall rule for the port. The client can connect now, but the connection is very unstable. I will try to run the master server by using the command you suggested. Thank you