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 - Kuliu

Pages: [1] 2
1
TNet 3 Support / Re: Dedicated Host: Proper Method?
« on: March 10, 2017, 12:19:15 PM »
First player to join the channel is that channel's host, so if your dedicated player joins first, they will remain as such. Are you building a headless client for your game?

Yeah this is what I was planning on doing. I was just asking if there is an other options then this.  ;D

2
TNet 3 Support / Dedicated Host: Proper Method?
« on: March 09, 2017, 09:56:35 AM »
Whats the proper method to having a dedicated host in the game that isn't the player? I'm currently thinking wrapping a lot of the code in an "IsDedicated" variable so I build the game once and have a server and a client. This seems pretty convoluted and I wanted to know if their is any other methods that would work.

3
TNet 3 Support / Re: Editor Freeze TNServerInstance.Start
« on: February 25, 2017, 03:04:34 AM »
Something didn't seem right, My entire OS was feeling sluggishly recently so I decided to format my HDD and reinstall Windows. After this all of my issues seem to have fixed. So my last post mostly is invalid as well as my issues. There might be an underlying issue with slow HDD read times and a server being started but I wouldn't worry about it too much.

Sorry for wasting your time D:

4
TNet 3 Support / Re: Editor Freeze TNServerInstance.Start
« on: February 24, 2017, 10:17:13 PM »
So I've narrowed the issue down. As far as I can tell the issue happens when I don't define "fileName" in TNServerInstance.Start();

This code freezes my editor:
  1. int udpPort = Random.Range(10000, 40000);
  2. TNServerInstance.Start( port, udpPort, true);
  3.  

This code works perfectly:
  1. int udpPort = Random.Range(10000, 40000);
  2. TNServerInstance.Start( port, udpPort, "arena.dat" true);
  3.  

This may be some crazy issue with my system but to narrow it down even more I reinstalled Unity because I was getting frustrated, the issue still continues. Looks like its an issue on your side D:

5
TNet 3 Support / Re: Editor Freeze TNServerInstance.Start
« on: February 23, 2017, 04:48:53 AM »
So after adding some logging inside of TNet it seems like the server is actually running. The "ThreadFunction" in TNGameServer.cs is running and is multi-threaded. But after about ~30 iterations of the for(;;) inside of "ThreadFunction" Unity locks up.

6
TNet 3 Support / Re: Editor Freeze TNServerInstance.Start
« on: February 23, 2017, 01:00:51 AM »
I've experienced Editor freezes a few times, I think some of the reasons were:
1. Scene contains an object with a TNObject with no ID set. These are meant to be instantiated at runtime.
2. Malformed packets. I've only experienced this when writing custom packets. I don't remember what the exact problem was or how I fixed it.
3. Entering playmode with a scene that expects TNManager to already be present and connected. This was a problem with my own code.

This was all in TNet 2, no idea if these issues apply to TNet 3, but it's something to look at at least.

I could also see a potential problem with RFCs being executed before the server instance fully initializes? Too lazy to check the code, but also something for you to look at.

1. The scene that contains the TNObjects don't even get loaded yet because it locks up before I try and connect to it. Therefore the scene is never loaded
2. I have no custom packets.
3. In TNet 3 I don't think it uses TNManager anymore. (I could be wrong)

And its not possible for RFCs to be called before the server initializes because no clients ever connect to it so I dont know who it'd be sending them too  ;D

7
TNet 3 Support / Editor Freeze TNServerInstance.Start
« on: February 22, 2017, 11:35:15 PM »
Everytime I use TNServerInstance.Start it freezes the Unity editor. It was working fine then it started happening randomly. Now it literally wont let me run a server in the editor. It works fine in builds. Any idea?

8
TNet 3 Support / TNObject change ID when placed in scene.
« on: December 02, 2015, 12:16:11 PM »
I have alot of TNObjects set to 0 so i can spawn them in manually with TNManager.Create but when editing these updates it will try and generate a new ID. This gets very annoying when you're constantly changing things (on the player for example). Is there a way I can make it default to 0?

9
TNet 3 Support / Re: Hosting server not using correct IP Address.
« on: November 26, 2015, 12:56:20 PM »
That's strange... I also can't think of why the '<' would be there. I wonder why I added it! I'll change it to just use ResolveAddress, thanks cmifwdll!
Can you go to http://icanhazip.com and tell us the output? Additionally, can you detail your LAN setup? What model is your router? Are you behind a switch / hub, or an additional router? What OS are you building on?

The relevant code:
externalAddress getter: line 253 of TNTools.cs
function GetExternalAddress: line 321 of TNTools.cs (also, check to make sure you aren't setting ipCheckerUrl. Let it use the defaults.)

Might also be a problem with the webclient and parsing:
function ResolveExternalIP: line 344
function ResolveAddress: line 391 (parses what the above function received)

I have a feeling most - if not all - of your issues are caused by something in your LAN setup. Set up some breakpoints on those lines and check if the variables are matching up. Note the first one that doesn't seem right.

edit: oh, I have the same issue :P it's because your external IP is ipv6, I assume. The parsing doesn't account for ipv6 addresses (though TNet should support ipv6). I'll write up a fix after dinner and edit this again. In the meantime, you could try forcing an ipv4 address. On windows: Open Network & Sharing Center -> Change adapter settings -> right click your physical NIC and select Properties -> uncheck the Internet Protocol Version 6 box and click OK -> right click your physical NIC again and select Disable, then Enable.

edit2: In TNTools.cs, in the static bool ResolveExternalIP (string url) function, replace the following:
  1. string[] split1 = text.Split(':');
  2.  
  3. if (split1.Length >= 2)
  4. {
  5.     string[] split2 = split1[1].Trim().Split('<');
  6.     mExternalAddress = ResolveAddress(split2[0]);
  7. }
  8. else mExternalAddress = ResolveAddress(text);
  9.  
With:
  1. mExternalAddress = ResolveAddress(text);
  2.  

I'm not sure what adverse effects this could have with the parsing. I can't think of any IP related string with "<" in it. I checked the webpages and it's just plaintext, too. So no html tags. Hopefully Aren will see this and include it in the next TNet update.


Thanks for all of the help both of you.

10
TNet 3 Support / Re: Hosting server not using correct IP Address.
« on: November 24, 2015, 11:56:53 AM »
http://icanhazip.com/ is returning "2601:346:400:e3f0:94fe:9bdf:c8:209a"

My router is a Technicolor TC8305C. It was giving by Comcast. No im not on a switch / hub nor an additional router. Im building on Windows 7.



I did the edit on the server but it now says


edit:
I seems that icanhazip returns my ipv6 but the other two resolvers actually return the correct one, I changed GetExternalAddress () (line 329)
  1. if (ResolveExternalIP(ipCheckerUrl)) return mExternalAddress;
  2. if (ResolveExternalIP("http://icanhazip.com")) return mExternalAddress;
  3. if (ResolveExternalIP("http://bot.whatismyipaddress.com")) return mExternalAddress;
  4. if (ResolveExternalIP("http://ipinfo.io/ip")) return mExternalAddress;
  5.  
to this order
  1. if (ResolveExternalIP(ipCheckerUrl)) return mExternalAddress;
  2. if (ResolveExternalIP("http://bot.whatismyipaddress.com")) return mExternalAddress;
  3. if (ResolveExternalIP("http://icanhazip.com")) return mExternalAddress;
  4. if (ResolveExternalIP("http://ipinfo.io/ip")) return mExternalAddress;
  5.  

It seems the bot.whatismyipaddress returns my actual usable IP Address. This is a temporary fix i suppose. im not sure what effects this could have on other server hosters though.

11
We're doing all of the above. When we only define a single -tcp launch parameter the server will work perfectly fine. But if we define -tcp and -udp launch parameters the server will act like its working fine but we'll get these "ghost" players. they dont have names (defined by the steam api), they are invisible for players connected correctly, but they can interact with the environment and every single client can see these interactions (ie: dropping items, using explosives, etc...). It seems like the RFC's dont go through but TNManager.Create does.

12
TNet 3 Support / Re: Hosting server not using correct IP Address.
« on: November 24, 2015, 11:14:28 AM »
Thanks for the reply ill try these.

13
TNet 3 Support / Re: Saved RFC Isn't Working.
« on: November 23, 2015, 06:32:19 PM »
You're calling CancelInvoke("CheckConnection"); right after you enter your if statement. Wont that cancel it and not continue to the code below?

14
When ever I make a server with -tcp and -udp the server will start correctly and half of my players will be in the game correctly. But on the other hand half of my players are invisible and dont receive most of the RFC's, however they are connected to the server (shown in console). Also these invisible people can drop our items in the world and everyone connected to the server (broken or not) can see the dropped items.

If I start the server with ONLY -tcp all players can connect correctly. Is this an issue with TNet or am I doing something wrong on my end?

15
TNet 3 Support / Hosting server not using correct IP Address.
« on: November 22, 2015, 12:31:20 PM »
For some reason hosting a TNet server will start up correctly but when trying to connect to the server the IP address it is using is incorrect.
As you can see from this screen shot its saying "External IP: 0.0.1.19" This isnt my IP address. My IP address is 66.177.xx.xxx. If I give the same exe to my friend to host.
It will show the correct static IP address. The only weird thing about this is that when someone direct connects to my static IP addresss "66.177.xx.xxx:5127" they can connect correctly.
PS: yes ive port forwarded. no its not my firewall.



Pages: [1] 2