public void OpenNewLobby() { // Setup the networker LobbyInfo thisLobby = new LobbyInfo(); thisLobby.connectedClients = 1; thisLobby.maxClients = 1000; thisLobby.port = 8081; thisLobby.name = "MMO Duel Simulation"; LobbyConnector.HostLobby(thisLobby); }
private void OnGUI() { if (isConnecting) { if (GUILayout.Button("Cancel Connection")) { this.isConnected = false; this.isConnecting = false; LobbyConnector.CancelConnection(); } } else if (isConnected) { if (GUILayout.Button("Disconnect")) { LobbyConnector.Disconnect(); } } else { if (GUILayout.Button("Start Host")) { this.isConnecting = true; LobbyInfo thisLobby = new LobbyInfo(); thisLobby.ip = "localhost"; thisLobby.port = 8080; thisLobby.isServer = false; LobbyConnector.HostLobby(thisLobby); } if (GUILayout.Button("Start Dedicated Server")) { this.isConnecting = true; LobbyInfo thisLobby = new LobbyInfo(); thisLobby.ip = "localhost"; thisLobby.port = 8080; thisLobby.isServer = true; LobbyConnector.HostLobby(thisLobby); } if (GUILayout.Button("Connect To Host")) { this.isConnecting = true; LobbyConnector.ConnectToLobby(textFieldString); } textFieldString = GUI.TextField(new Rect(0, 100, 100, 20), textFieldString); } }