Author Topic: Server  (Read 2776 times)

voncarp

  • Jr. Member
  • **
  • Thank You
  • -Given: 13
  • -Receive: 2
  • Posts: 91
    • View Profile
Server
« on: July 27, 2014, 04:34:10 PM »
I've had success getting Tnet and Starlink example scenes to work on an Amazon EC2 instance.  I am struggling to get it work setting up on my on Mac.

I'll run the exe from the terminal:

Quote
For example:
  TNServer -name "My Server" -tcp 5127 -udp 5128 -udpLobby 5129

Local IPs: 0

UPnP discovery failed. TNet won't be able to open ports automatically.
Gateway:  None found

Game server started on port 5127 using protocol version 10
ERROR: Unable to listen to UDP port 5128
Press 'q' followed by ENTER when you want to quit.

I've allowed the ports from my router and firewall.  I am not exactly versed in what this means.  I cant get the example scenes to work as each attempt results in "Connection Refused."  I am thinking the issue is in my setup.

Would you be able to point me in the direction in how I can resolve this?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Server
« Reply #1 on: July 27, 2014, 11:31:09 PM »
Local IPs: 0? That's interesting. Looks like the app is not getting any kind of communication privileges. Can't say I've seen that, but try launching the app with full privs ("sudo mono TNServer.exe")

voncarp

  • Jr. Member
  • **
  • Thank You
  • -Given: 13
  • -Receive: 2
  • Posts: 91
    • View Profile
Re: Server
« Reply #2 on: July 28, 2014, 05:08:34 AM »
That didn't seem to work.

Quote
Vaughns-MacBook-Pro:~ voncarp$ sudo mono /Users/voncarp/Tnet/Assets/TNet/TNetServer/TNServer.exe
No arguments specified, assuming default values.
In the future you can specify your own ports like so:

   -name "Your Server"         <-- Name your server
   -tcp [port]                 <-- TCP port for clients to connect to
   -udp [port]                 <-- UDP port used for communication
   -udpLobby [address] [port]  <-- Start or connect to a UDP lobby
   -tcpLobby [address] [port]  <-- Start or connect to a TCP lobby
   -ip [ip]                    <-- Choose a specific network interface

For example:
  TNServer -name "My Server" -tcp 5127 -udp 5128 -udpLobby 5129

Local IPs: 0

UPnP discovery failed. TNet won't be able to open ports automatically.

Gateway:  None found

Game server started on port 5127 using protocol version 10
ERROR: Unable to listen to UDP port 5128
Press 'q' followed by ENTER when you want to quit.

Would you have any other suggestions?  What are likely causes for no IPs?  Maybe router related?  I allowed port forwarding on 5127-5129 on my Belkin router.

Firewall is off on the Mac.  I do have Norton firewall on but allowed connections to TNServer.exe and ports 5127-5129.  Perhaps, Norton is messing with something else?  Or maybe the router?

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: Server
« Reply #3 on: July 29, 2014, 03:50:59 AM »
Nope, this isn't router-related. Your local IP can't be determined, which is highly unusual. Have a look inside TNTools.localAddresses property. There are two #if sections inside -- first one for "not web player", second one "not iphone". Where does it fail for you? Thing is, even when it fails, it should still fall back to
  1. if (mAddresses.size == 0) mAddresses.Add(IPAddress.Loopback);
...meaning there should always be at least one address. How come that doesn't happen in your case? Do you get the same result in Unity? You can use this simple script to test, by attaching it to any game object:
  1. using UnityEngine;
  2. using TNet;
  3. using System.Threading;
  4.  
  5. public class ShowIP : MonoBehaviour
  6. {
  7.         string text = "";
  8.         Thread mThread;
  9.  
  10.         void Start ()
  11.         {
  12.                 text = "LAN: " + Tools.localAddress;
  13.                 mThread = new Thread(ResolveWAN);
  14.                 mThread.Start();
  15.         }
  16.  
  17.         void OnDestroy () { if (mThread != null) mThread.Abort(); }
  18.         void ResolveWAN () { text += "\nWAN: " + Tools.externalAddress; mThread = null; }
  19.         void OnGUI () { GUILayout.Label(text); }
  20. }

voncarp

  • Jr. Member
  • **
  • Thank You
  • -Given: 13
  • -Receive: 2
  • Posts: 91
    • View Profile
Re: Server
« Reply #4 on: July 30, 2014, 04:48:53 AM »
I'm sorry.  The directory I used was an older version of Tnet.  The newer version works fine.  The perils of working alone.

Thanks for the persistent support.  Thats why I've purchased all your assets.  Except for fog of war  :o

Again, my apologies.