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.


Topics - xarasu

Pages: [1]
1
TNet 3 Support / NaCl support?
« on: June 20, 2014, 02:14:20 PM »
Just curious if you've ever gotten tnet working in NaCl? I know the web player can't do udp or start a server, but wasn't sure for NaCl.

2
TNet 3 Support / 1.9.5 Server mismatch
« on: June 17, 2014, 03:46:57 PM »
I just updated to TNet 1.9.5 and copied the new TNServer.exe over to my host. My app can no longer connect and gives the following warning:

Quote
Version mismatch! Server is running protocol version 10 while you are on version 11
UnityEngine.Debug:LogWarning(Object)
TNTcpLobbyClient:Update() (at Assets/Vendor/TNet/Client/TNTcpLobbyClient.cs:108)

I also tried to build my own TNServer.exe in case it just wasn't up to date and was getting a lot of errors about 'BinaryWriter' not containing a definition for 'writeObject' or 'readObject'.

3
TNet 3 Support / Trouble with discovering local servers on ipad
« on: May 14, 2014, 12:24:16 PM »
I have an app where a user on an ipad can either create or join a server with a given access code (like NY2Z). The clients broadcast out the code to the LAN and the server is supposed to check the code with its own, then respond to the client with its ip address so the client can then connect. But the server doesn't even seem to be getting the initial broadcasted RFC. Am I not connecting in the right order? or could it be an issue with the ipads/router?


  1. public class NetworkingScript: MonoBehaviour {
  2.  
  3.   public TNObject TNO;
  4.  
  5.   public bool IsConnected {get; private set;}
  6.   public bool IsConnecting {get; private set;}
  7.  
  8.   private const int UDP_BROADCAST_PORT = 5128;
  9.   private const int TCP_CONNECTION_PORT = 5127;
  10.  
  11.   private string AccessCode;
  12.  
  13.   // Use this for initialization
  14.   void Start () {
  15.     TNManager.StartUDP(UDP_BROADCAST_PORT);
  16.   }
  17.  
  18.   public void StartServer(string accessCode) {
  19.     this.AccessCode = accessCode;
  20.     IsConnected = false;
  21.     IsConnecting = true;
  22.    
  23.     TNServerInstance.Start(TCP_CONNECTION_PORT);
  24.     TNManager.Connect("127.0.0.1", TCP_CONNECTION_PORT);
  25.   }
  26.   public void JoinServer(string accessCode) {
  27.     this.AccessCode = accessCode;
  28.     IsConnected = false;
  29.     IsConnecting = true;
  30.  
  31.     TNO.BroadcastToLAN(UDP_BROADCAST_PORT, "RequestServerWithAccessCode", accessCode);
  32.   }
  33.  
  34.   [RFC]
  35.   void RequestServerWithAccessCode(string code) {
  36.     if (IsConnecting || !TNManager.isHosting || AccessCode != code)
  37.       return;
  38.  
  39.     var ip = Network.player.ipAddress;
  40.     var serverCode = AccessCode;
  41.     TNO.BroadcastToLAN(UDP_BROADCAST_PORT, "ReturnRequestServerWithAccessCode", ip, serverCode);
  42.   }
  43.  
  44.   [RFC]
  45.   void ReturnRequestServerWithAccessCode(string ip, string code) {
  46.     if (this.AccessCode == code)
  47.       TNManager.Connect(ip, TCP_CONNECTION_PORT);
  48.   }
  49.  
  50.   void OnNetworkConnect(bool success, string message) {
  51.     if (!success)
  52.       Debug.Log("Error connecting to Server: "+message);
  53.     Debug.Log("Connected to server in channel "+TNManager.channelID);
  54.  
  55.     IsConnected = true;
  56.     IsConnecting = false;
  57.   }
  58. }
  59.  

Pages: [1]