Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - pyscho2day

Pages: [1] 2 3 ... 5
1
That is possible. Unfortunatly I don't have the pro license yet.  Once I build my new pc I will probably upgrade as its only 30$ more.

Side note, @GantZ_Yaka was having issues with one of his machines always returning with 127.0.0.1 and here is what he found.  (he was messaging me directly)

Quote from: GantZ_Yaka
Windows 7,  I found the reason due to which the IP was always taken 127.0.0.1.
Fault location:
IPHostEntry iphostentry = Dns.GetHostByName(strHostName);
Im from russia and in the name of the computer (My computer - Properties) except the letters were also Russian letters.
When iphostentry  is taken not only of the Latin letters, the program itself could not find the local IP using that Hostname.
When I changed the network name in Latin letters, everything was working correctly

2
Aren,

I have been running this fix for a month now and have no seen the 127.0.0.1 show up when opening ports.

Note: Lines with a * are added/modified.
  1.         void Open (int port, bool tcp, OnPortRequest callback)
  2.         {
  3.                 int id = (port << 8) | (tcp ? 1 : 0);
  4.  
  5.                 if (port > 0 && !mPorts.Contains(id) && mStatus != Status.Failure)
  6.                 {
  7.                         mPorts.Add(id);
  8.  
  9. *                       IPAddress tempLocal = Tools.localAddress;
  10. *                       int tempCnt = 0;
  11. *                       while (tempLocal.ToString() == "127.0.0.1" && tempCnt < 20)
  12. *                       {
  13. *                               tempCnt++;
  14. *                               tempLocal = Tools.localAddress;
  15. *                               Thread.Sleep(10);
  16. *                       }
  17.  
  18.  
  19.                         ExtraParams xp = new ExtraParams();
  20.                         xp.callback = callback;
  21.                         xp.port = port;
  22.                         xp.protocol = tcp ? ProtocolType.Tcp : ProtocolType.Udp;
  23.                         xp.action = "AddPortMapping";
  24.                         xp.request = "<NewRemoteHost></NewRemoteHost>\n" +
  25.                                 "<NewExternalPort>" + port + "</NewExternalPort>\n" +
  26.                                 "<NewProtocol>" + (tcp ? "TCP" : "UDP") + "</NewProtocol>\n" +
  27.                                 "<NewInternalPort>" + port + "</NewInternalPort>\n" +
  28. *                               "<NewInternalClient>" + tempLocal + "</NewInternalClient>\n" +
  29.                                 "<NewEnabled>1</NewEnabled>\n" +
  30.                                 "<NewPortMappingDescription>" + name + "</NewPortMappingDescription>\n" +
  31.                                 "<NewLeaseDuration>0</NewLeaseDuration>\n";
  32.  
  33.                         xp.th = new Thread(OpenRequest);
  34.                         lock (mThreads) mThreads.Add(xp.th);
  35.                         xp.th.Start(xp);
  36.                 }
  37.                 else if (callback != null)
  38.                 {
  39.                         callback(this, port, tcp ? ProtocolType.Tcp : ProtocolType.Udp, false);
  40.                 }
  41.         }

edit: Added a couple line to exit the while loop if a suitable ip can not be obtained. Thanks to @GantZ_Yaka for letting me know that he has a laptop that is never able to get the local ip and always returns the 127.0.0.1

3
TNet 3 Support / Re: Multiple Routers UPnP
« on: January 23, 2014, 04:40:49 PM »
NAT is not limited to UDP.

"Transparent NAT works well for TCP connections, but due to the connectionless nature of UDP, NAT works less well for unusual UDP connections" - http://www.ipprimer.com/nat.cfm

If you would like to read the bes practices put forth by the ietf then you can read this pdf.
http://tools.ietf.org/pdf/rfc5382.pdf

Not snapping just letting you know.

4
TNet 3 Support / Re: Multiple Routers UPnP
« on: January 22, 2014, 06:18:21 PM »
Would this be something that nat would fix?   ;)

5
I add a game version # to the server name separated by a | then when checking game servers i parse the server name and check the version #.

6
TNet 3 Support / Re: Load new scene without leaving current channel
« on: December 13, 2013, 10:42:54 AM »
Aren,

In your adventures would it be possible to add a TNManager.LoadLevelAsync option.  Reading this thread made me think of that.  Seeing as right now the whole screen locks up when TNManager.LoadLevel is called (and expected) but it would be nice to have an active load screen vs a passive(static) screen.

7
I do use the detection on an external website, and if it was not reachable that would be fine.  I am more concerned with the ports being opened on 127.0.0.1.   I made a small script copying what you do in the TNTools.cs to obtain the local ip and verify it. I let this run for 4 hours and not once did i get 127.0.0.1 as the local (lan) ip.  I then tried to start a server and the first time it used 127.0.0.1 as the ip to open the ports on.  I am trying to avoid modifying your code as when we get an update it gets wiped out. I thought about inheriting the TNet.UPnP but there are protected members that are not accessible (one being the local ip). I was going to do that so i could check the ip and if it was the 127.0.0.1 the check again to make sure i get the correct local ip.

I had put a fix in version 1.7.x on mine in the past but have updated since then. What I did was get the local ip and put that into a variable and then checked it, if it was 127.0.0.1 i would then get and check again.

I believe this is what I had added. (* in front of now or edited lines)
  1. void Open (int port, bool tcp, OnPortRequest callback)
  2. {
  3.   int id = (port << 8) | (tcp ? 1 : 0);
  4.  
  5.   if (port > 0 && !mPorts.Contains(id) && mStatus != Status.Failure)
  6.   {
  7.     mPorts.Add(id);
  8. *   IPAddress tempLocal = Tools.localAddress;
  9. *   for (int i = 0; i < 10; i++)
  10. *   {
  11. *     if (tempLocal.ToString() != "127.0.0.1")
  12. *     {
  13. *       return;
  14. *     }
  15. *     else
  16. *     {
  17. *       tempLocal = Tools.localAddress;
  18. *     }
  19. *   }
  20.  
  21.     ExtraParams xp = new ExtraParams();
  22.     xp.callback = callback;
  23.     xp.port = port;
  24.     xp.protocol = tcp ? ProtocolType.Tcp : ProtocolType.Udp;
  25.     xp.action = "AddPortMapping";
  26.     xp.request = "<NewRemoteHost></NewRemoteHost>\n" +
  27.       "<NewExternalPort>" + port + "</NewExternalPort>\n" +
  28.       "<NewProtocol>" + (tcp ? "TCP" : "UDP") + "</NewProtocol>\n" +
  29.       "<NewInternalPort>" + port + "</NewInternalPort>\n" +
  30. *     "<NewInternalClient>" + tempLocal + "</NewInternalClient>\n" +
  31.       "<NewEnabled>1</NewEnabled>\n" +
  32.       "<NewPortMappingDescription>" + name + "</NewPortMappingDescription>\n" +
  33.       "<NewLeaseDuration>0</NewLeaseDuration>\n";
  34.  
  35.     xp.th = new Thread(OpenRequest);
  36.     lock (mThreads) mThreads.Add(xp.th);
  37.     xp.th.Start(xp);
  38.   }
  39.   else if (callback != null)
  40.   {
  41.     callback(this, port, tcp ? ProtocolType.Tcp : ProtocolType.Udp, false);
  42.   }
  43. }
  44.  

I am at work right now so I can not verify, but if you would like I can try this when I get home and make sure that 127.0.0.1 is no longer being used.

8
I did some testing to night and every time the upnp ports were opened with the localhost ip the ips that were reported to the lobby server were both the private ip not the public ip.

9
TNet 3 Support / Re: A couple of presale questions
« on: December 11, 2013, 10:51:01 AM »
- It is implied but not fully clear that TNet will work simultaneously as both host and client. But I am assuming a player can host a session while him/herself playing using the same Unity instance - correct?
Yes you can, but let me clarify something first. With TNet host is a little different, you have a server which all traffic is routed through, a host which is the authoritative player, and then your normal client.  With this there are multiple setup options. You can have a dedicated server in the cloud (or where ever) that everyone connects to. You can have a lobby server that just keeps track of individual servers. You can have local servers (Single Player or Lan Play).  With the Dedicated server the first person to join a channel is the host and they do all the authoritative stuff (if you so choose to code it that way). With the lobby server, the players can host a server on their local machine but a list is stored so that they can be discovered and joined by random people (Many of the FPS games are doing this now days). The local is just that, no outside interaction unless you know what you are doing then it is still possible to join from outside your lan.

- One strength of Tnet seems to be that the same scene and code paths are used for both multiplayer and single player sessions. I get the impression that the scenes / rigs should be set up as always in multiplayer and single player essentially being simulated multiplayer with one player. Correct? If so, does that mean that lag following / syncing happens much quicker for the local player both in single player sessions and in multiplayer?
You are correct to an extent, it all depends on how you code your game.

- The described approach of separating physics from rendering is one we are already taking. However, we separate physics from rendering as two fully separate objects (to be able to switch off physics fully when not needing it). Will Tnet scripts handle this separated hierarchy or be easily modified to do so? (I am primarily thinking of the "lag following" script referenced in this forum).
I am not sure on this one Aren might be able to shed some more light on this.


10
TNet 3 Support / Re: Networking Physics Discussion
« on: December 11, 2013, 10:24:12 AM »
Use lerps and slerps when there are discrepancies between host and client else. Plus make sure to update the position every so often.  I use tno.send 1 time a second and tno.sendquickly 4 times a second to sync the position.  My team has people all over the world and any lag seen is very negligible.  one thing to note with the sendquickly is to time stamp the position so just in case a earlier position come in after a newer one you don't bounce backwards.

11
Actually the lobby server just gets 2 entries for the local ip, not the local ip and the outside ip. The issue is that the ports being opened on the router get the 127.0.0.1 ip address assigned to them and not the local ip 10.0.0.### that it should.  When this happens the router does not know where to send the incoming traffic.

12
This is not happening all of the time and it hasn't happened in while.  I have not modified any of your code that would control that what so ever.  Would it be possible to get a check in the logic that if for some reason it get 127.0.0.1 when it tries to open the ports to try again? Or maybe to kick out an exception.

I currently check that the ports open and I don't get an error, but this is just as bad as an error and so far i have not found a way with out modifying your code to find out what ports were opened.

Not in a rush but if you could put this on your radar it would be appreciated.  Also if anyone else has had this issue post here. if no one then maybe I am just the lucky one.

13
TNet 3 Support / Re: Setting TNObject ID
« on: December 09, 2013, 10:51:39 PM »
In the game that I am working on we do just that. We have a pool for all the lasers and missiles.  We don't create any till some one starts to shoot then we build up the pool and just use that.

14
TNet 3 Support / Re: Dedicated server instance is crashing
« on: December 06, 2013, 11:00:43 AM »
I have a lobby server running in the cloud and it has been on for a very long time and have yet to crash it.  This includes killing the client and leaving everything open.  Are you using it as the Game server or a Lobby server?

15
TNet 3 Support / Re: Aren (Michael)
« on: December 05, 2013, 06:12:55 PM »
That's awesome to hear. I am eagerly awaiting it to come out so can compare it to NGUI.  I hope you left on good terms.

Pages: [1] 2 3 ... 5