Hey guys,
sorry about my recent wave of networking questions, but it’s proving to be a bit more complicated than I anticipated. Anyway, today my problem lies in polling the MasterServer. It works fine in an awake void, but if I try to use it anywhere else, it doesn’t return with any values. Following is the code I want to use it in.
void JoinChat ()
{
Debug.Log (MasterServer.PollHostList().Length);
hostData = MasterServer.PollHostList();
int i = 0;
while (i < hostData.Length)
{
Debug.Log("Game name: " + hostData*.gameName);*
_ avaliableChats.CreateItem(serverButton, hostData*.gameName);_
i++;
_}_
_ MasterServer.ClearHostList(); _
_ }*_
I can’t figure out why it only works in Awake, and if any of you have suggestions of ways to fix this, please let me know!
Edit: If I’m not clear, when I put MasterServer.ClearHostList() and MasterServer.RequestHostList() into the JoinChat void, it returns 0.