Hey, I ve got a problem. The Masterserverhostlist is always length 0. Dont know what I did wrong. Hope somebody can help me out. This is my NetworkBase Class methods which are important:
void Update()
{
if(_hostData.Length != 0)
_hostData = MasterServer.PollHostList();
}
/// <summary>
/// Starts the server.
/// </summary>
/// <param name='pPlayer'>
/// P player.
/// </param>
public void StartServer(int pPlayer)
{
bool useNat = !Network.HavePublicAddress();
Network.InitializeServer(pPlayer,NetworkData.GamePort,useNat);
}
/// <summary>
/// Registers the host.
/// </summary>
/// <param name='gameName'>
/// Game name.
/// </param>
public void RegisterHost(string pGame)
{
MasterServer.RegisterHost(NetworkData.GameName,pGame);
Debug.Log("Host registered");
}
/// <summary>
/// Requests the hosts.
/// </summary>
public void RequestHosts()
{
MasterServer.ClearHostList();
MasterServer.RequestHostList(NetworkData.GameName);
Debug.Log ("Send Host request");
}
After calling StartServer and RegisterHost the length of _hostData is still 0. What did I wrong?