if(isinoptions == 8){
var data : HostData[] = MasterServer.PollHostList();
// Go through all the hosts in the host list
for (var element in data)
{
GUILayout.BeginHorizontal();
GUILayout.Space(20);
var name = element.gameName + " " + element.connectedPlayers + " / " + element.playerLimit;
GUILayout.Label(name);
GUILayout.Space(5);
var hostInfo;
hostInfo = "[";
for (var host in element.ip)
hostInfo = hostInfo + host + ":" + element.port + " ";
hostInfo = hostInfo + "]";
GUILayout.Label(hostInfo);
GUILayout.Space(5);
GUILayout.Label(element.comment);
GUILayout.Space(5);
GUILayout.FlexibleSpace();
if (GUILayout.Button("Connect"))
{
connectStatus="Connecting";
// Set NAT functionality based on the host information
Network.useNat=!Network.HavePublicAddress;
if (Network.useNat)
print("Using Nat punchthrough to connect to host");
else
print("Connecting directly to host");
Network.Connect(element.ip, element.port);
}
GUILayout.EndHorizontal();
}
if (data.length>0){
serverFoundStatus=data.length+" Servers Found";
}
if (data.length==0){
serverFoundStatus="No public servers found yet";
}
GUI.Label(Rect(25,220,300,300),connectStatus);
GUI.Label(Rect(25,240,300,300),serverFoundStatus);
if (GUI.Button (Rect (25,200,100,20), "Refresh List")) {
connectStatus="Refreshing Master server list on ip :"+MasterServer.ipAddress;
//MasterServer.ClearHostList();
MasterServer.RequestHostList("StealthReduxCoop");
}
if (GUI.Button (Rect (125,200,50,20), "Back")){
isinoptions=0;
}
}
i have this code right here , what i want to do is explained in the image below , currently it can get out of the screen if a lot of servers are present
