服务器端口。
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
void Start() {
HostData[] hostData = MasterServer.PollHostList();
foreach (HostData element in hostData) {
string tmpIp = "";
int i = 0;
while (i < element.ip.Length) {
tmpIp = element.ip[i] + " ";
i++;
}
Debug.Log(element.gameName + " ip: " + tmpIp + ":" + element.port);
}
}
}