First let me say that I am a long-time C++ and then Objective-C programmer, and I greatly appreciate the way you structure your code. I tried out Photon and also took a long look at the uLink documentation, and did not like the way they were designed or their unreliability.
For the past week I have been studying TNet and trying out the examples, reading all of the documentation, etc. So far I have been unable to connect two instances of my game on my local Mac network and print out the list of players to show more than one player. That is the only code I have added so far, as a separate game object with the TNObject, TNManager, and a very short ClientHookup script added. No changes to any other code yet. Because of an unrelated (audio) issue, I am running only one client on my Mac, and the other clients on either IOS and Android.
For my latest tests I created a new project with release 1.5, included all of the Example code and built it as a Unity file for Mac & PC. It works perfectly on my Mac. I can run this separately and start the local server. Or I can start the server in my Client Hookup script:
using UnityEngine;
using System.Collections;
using TNet;
public class ClientHookup : MonoBehaviour
{
string mAddress = "127.0.0.1:5127";
// string mAddress = "67.161.180.91:5127"; // this is the address that shows in the example server list
string mMessage = "";
void Start ()
{
if (Application.isPlaying)
{
// We don't want mobile devices to dim their screen and go to sleep while the app is running
Screen.sleepTimeout = SleepTimeout.NeverSleep;
}
// TNServerInstance.Start (5127);
TNManager.Connect(mAddress);
mMessage = "Connecting...";
}
void OnNetworkConnect (bool success, string message)
{
if (message != null)
{
mMessage = message;
print (message);
}
TNManager.JoinChannel (17, "CribApple");
// print (TNManager.players);
List <Player> players = new List<Player> ();
for (int i = 0; i < TNManager.players.size; i++)
players.Add (TNManager.players );
print (players);
}
}
I used channel 17 so as not to conflict witht the four examples.
No matter what I do, it only prints out one player.
Regards,
Larry Applegate