Can anyone tell me… Does unitys built in master server still work?! Im trying to set up a game on the master server, And I just keep getting:
Failed to connect to master server at 72.52.207.14:23456
Im not sure if its my PC or what… so help me out. Heres my script to get data from the masterserver.
Its pretty basic (Hope I did it all right)
var displayServerList=false;
var displayBeginning=true;
var displayCreateServer=false;
var GameName:String;
var joiningGame=false;
var creatingGame=false;
var connectTo:String;
var connectPort:int;
function Awake() {
MasterServer.RequestHostList("BombermanBattle");
DontDestroyOnLoad(this);
}
function OnLevelWasLoaded(){
if(joiningGame){
Network.Connect(connectTo,connectPort);
}
else if(creatingGame){
Network.InitializeServer(16,connectPort);
MasterServer.RegisterHost("BombermanBattle",GameName);
}
joiningGame=false;
creatingGame=false;
}
function OnGUI(){
if(displayBeginning){
if(GUI.Button(Rect(20,120,100,40),"Host Server")){
displayCreateServer=true;
displayServerList=false;
displayOptions=false;
}
if(GUI.Button(Rect(20,180,100,40),"Server List")){
displayCreateServer=false;
displayServerList=true;
displayOptions=false;
}
if(GUI.Button(Rect(20,240,100,40),"Options")){
displayCreateServer=false;
displayServerList=false;
displayOptions=true;
}
}
if(displayServerList){
GUI.Window(0, Rect(150,20,Screen.width-170,Screen.height-40),ServerListWindow, "Server List");
}
else if(displayCreateServer){
GUI.Window(1, Rect(150,20,Screen.width-170,Screen.height-40),ServerCreateWindow, "Create Server");
}
}
function ServerListWindow (windowID : int) {
MasterServer.ClearHostList();
if(MasterServer.PollHostList().length != 0) {
var y=10;
var hostData: HostData[] = MasterServer.PollHostList();
for (var i:int=0; i<hostData.length; i++){
if(GUI.Button(Rect(5,y,200,20),hostData[i].gameName)){
if(hostData[i].connectedPlayers<hostData[i].playerLimit){
joiningGame=true;
connectTo=""+hostData[i].ip;
connectPort=hostData[i].port;
CloseTitle();
Application.LoadLevel(1);
}
}
GUI.Label(Rect(225,y,50,20),hostData[i].connectedPlayers+"/"+hostData[i].playerLimit);
y+=30;
}
}
else{
GUI.Label(Rect(20,20,200,20),"Currently no availible servers!");
}
}
function ServerCreateWindow(windowID:int){
GUI.Label(Rect(Screen.width/2-150,20,100,30),"Game Name:");
GameName=GUI.TextField(Rect(Screen.width/2-200,40,200,20),GameName);
GUI.Label(Rect(5,100,50,30),"Port:");
connectPort=int.Parse(GUI.TextField(Rect(50,100,60,20),""+connectPort));
if(GUI.Button(Rect(Screen.width/2-200,300,200,50),"Create Game")){
if(GameName.length>3){
creatingGame=true;
CloseTitle();
Application.LoadLevel(1);
}
}
}
function CloseTitle(){
displayServerList=false;
displayBeginning=false;
displayCreateServer=false;
}
Help? ^.^ thanks.