31
TNet 3 Support / Re: TNet: Lag Emulation, Kicks and Bans
« on: December 31, 2014, 10:34:04 PM »
Alright, thanks for that.
Is there a way to wait until TNet has started the server before running commands to connect to it locally, etc?
What I see is that I do the TNServerInstance.Start(...) call and then connect to it. However, that call seems to return immediately, and doesn't wait until the server is up. Therefore my code that tries to connect to itself gets executed straight after the server starts booting, and gets a "No connection could be made due to the host rejecting the connection".
I see that TNServerInstance has isActive and isListening...
I was doing it wrong. Next question:
When you said to send them a disconnection packet, is it possible to use the packet with something like tno.Send(Packet.Disconnect, <insert player reference here>) ? Of course, if I try using "Send" it throws a error, but I see under TNManager.client there's also BeginSend and friends. The issue with that is the server needs to be the one forcing the disconnect, and that command only sends the message to the server unless I'm mistaken. Alternatively, I make a Kick() function that is an RFC, but I can see the odd smartass trying to be clever and avoid the kick by using a hacked version of the assemblies in the built game executable.
What I see is that I do the TNServerInstance.Start(...) call and then connect to it. However, that call seems to return immediately, and doesn't wait until the server is up. Therefore my code that tries to connect to itself gets executed straight after the server starts booting, and gets a "No connection could be made due to the host rejecting the connection".
I see that TNServerInstance has isActive and isListening...
I was doing it wrong. Next question:
When you said to send them a disconnection packet, is it possible to use the packet with something like tno.Send(Packet.Disconnect, <insert player reference here>) ? Of course, if I try using "Send" it throws a error, but I see under TNManager.client there's also BeginSend and friends. The issue with that is the server needs to be the one forcing the disconnect, and that command only sends the message to the server unless I'm mistaken. Alternatively, I make a Kick() function that is an RFC, but I can see the odd smartass trying to be clever and avoid the kick by using a hacked version of the assemblies in the built game executable.