void JoinMatch(NetworkID networkID, LobbyManager lobbyManager, MatchDesc match) { lobbyManager.DisplayIsConnecting (); lobbyManager.matchMaker.JoinMatch (networkID, "", lobbyManager.OnMatchJoined); lobbyManager.currentMatchValue = Int32.Parse(match.name.Split(' ')[match.name.Split(' ').Length-1]); lobbyManager.backDelegate = lobbyManager.QuitLobbyToMenu; lobbyManager.isMatchmaking = true; }
public void setText(UnityEngine.Networking.Match.MatchDesc pDesc) { transform.GetChild (0).GetComponent<Text> ().text = "Name: " + pDesc.name + " Size: " + pDesc.currentSize + '/' + pDesc.maxSize; desc = pDesc; }
//End void Start() //-------------------------------------------------------------------------------------------------------------------- //Name: matchResponse //Description: Called once server has returned a list of available matches then displays them in the lobbies viewport //Parameters: UnityEngine.Networking.Match.ListmatchResponse matches //Returns: NA //-------------------------------------------------------------------------------------------------------------------- public void matchResponse(UnityEngine.Networking.Match.ListMatchResponse matches) { descriptions = matches.matches.ToArray (); //Remove any children currently present for (int i = 0; i < viewPort.transform.childCount; i++) Destroy (viewPort.transform.GetChild (i).gameObject); //Populate new list with the match options. for (int i = 0; i < descriptions.Length; i++) { GameObject content = GameObject.Instantiate (matchContent); content.transform.SetParent (viewPort.transform); RectTransform rect = content.GetComponent<RectTransform> (); rect.offsetMin = new Vector2 (0, -67 - 67 * i); rect.offsetMax = new Vector2 (1, -67 * i); content.transform.localScale = new Vector3 (1, 1, 1); content.GetComponent<MatchContent> ().setText (descriptions [i]); content.GetComponent<Button> ().onClick.AddListener (delegate { SelectedMatch = content.GetComponent<MatchContent> ().getDesctription (); }); } //End for(int i = 0; i < descriptions.Length; i ++) }
public void JoinGame(MatchDesc matchDescription = null) { if(isMatchmakingEnabled && matchDescription != null) //matchmaker { matchMaker.JoinMatch(matchDescription.networkId, "", OnMatchJoined); } else { //lan start client StartClient(); } }
public void JoinMatch(MatchDesc match) { JoinMatchRequest request = new JoinMatchRequest(); request.appId = EloConfig.PROGRAM_APP_ID; request.projectId = EloConfig.CLOUD_PROJECT_ID; request.networkId = match.networkId; request.domain = 0; request.password = ""; NetworkManager.singleton.matchMaker.JoinMatch(request, OnMatchJoined); }
public void Populate(MatchDesc match, NetworkManager networkManager, Color c) { serverInfoText.text = match.name; slotInfo.text = match.currentSize.ToString() + "/" + match.maxSize.ToString(); ; NetworkID networkID = match.networkId; joinButton.onClick.RemoveAllListeners(); joinButton.onClick.AddListener(() => { JoinMatch(networkID, networkManager); }); }
protected override void BeforeShow() { if(NetworkManager.singleton.matches == null) return; foreach(MatchDesc m in NetworkManager.singleton.matches){ GameRow gameRow = Instantiate<GameRow>(gameRowPrefab); gameRow.Set (m); gameRow.transform.SetParent(GameListContainer); gameRow.button.onClick.AddListener(() => selectedMatch = m); } }
public void Populate(MatchDesc match, LobbyManager lobbyManager, Color c) { serverInfoText.text = match.name; slotInfo.text = match.currentSize.ToString() + "/" + match.maxSize.ToString(); NetworkID networkID = match.networkId; joinButton.onClick.RemoveAllListeners(); joinButton.onClick.AddListener(() => { JoinMatch(networkID, lobbyManager); }); GetComponent<Image>().color = c; }
internal MatchInfoSnapshot(MatchDesc matchDesc) { this.networkId = (NetworkID)matchDesc.networkId; this.hostNodeId = matchDesc.hostNodeId; this.name = matchDesc.name; this.averageEloScore = matchDesc.averageEloScore; this.maxSize = matchDesc.maxSize; this.currentSize = matchDesc.currentSize; this.isPrivate = matchDesc.isPrivate; this.matchAttributes = matchDesc.matchAttributes; this.directConnectInfos = new List <MatchInfoSnapshot.MatchInfoDirectConnectSnapshot>(); foreach (MatchDirectConnectInfo current in matchDesc.directConnectInfos) { this.directConnectInfos.Add(new MatchInfoSnapshot.MatchInfoDirectConnectSnapshot(current)); } }
internal MatchInfoSnapshot(MatchDesc matchDesc) { networkId = matchDesc.networkId; hostNodeId = matchDesc.hostNodeId; name = matchDesc.name; averageEloScore = matchDesc.averageEloScore; maxSize = matchDesc.maxSize; currentSize = matchDesc.currentSize; isPrivate = matchDesc.isPrivate; matchAttributes = matchDesc.matchAttributes; directConnectInfos = new List <MatchInfoDirectConnectSnapshot>(); foreach (MatchDirectConnectInfo directConnectInfo in matchDesc.directConnectInfos) { directConnectInfos.Add(new MatchInfoDirectConnectSnapshot(directConnectInfo)); } }
//====== Server Command public void Amount(MatchDesc match) { MaxPlayers = match.maxSize; }
private int GetVersion(MatchDesc desc) { return int.Parse(gamename.Match(desc.name).Groups[2].Value); }
private GameListing ConvertListing(MatchDesc desc) { var listing = new GameListing(); ParseName(desc.name, out listing.name, out listing.version, out listing.count); listing.count = desc.currentSize; listing.match = desc; return listing; }
public void Set(MatchDesc match) { gameNameText.text = match.name; playerCountText.text = match.currentSize.ToString() + "/" + match.maxSize.ToString(); }
public RoomButton(MatchDesc aRoom, Button abutton) { m_room = aRoom; m_button = abutton; }
public void JoinRoom(MatchDesc aRoomInfo) { GameObject.Find("Version Text").transform.SetParent(null); GameObject.Find("FullScreen").transform.SetParent(null); int minLevel = 0; int maxLevel = 50; int playerLevel = GameObject.Find("BrainCloudStats").GetComponent<BrainCloudStats>().GetStats()[0].m_statValue; if (playerLevel < minLevel || playerLevel > maxLevel) { GameObject.Find("DialogDisplay").GetComponent<DialogDisplay>().DisplayDialog("You're not in that room's\nlevel range!"); GameObject.Find("Version Text").transform.SetParent(GameObject.Find("Canvas").transform); GameObject.Find("FullScreen").transform.SetParent(GameObject.Find("Canvas").transform); } else { m_state = eMatchmakingState.GAME_STATE_JOIN_ROOM; try { BombersNetworkManager.singleton.matchMaker.JoinMatch(aRoomInfo.networkId, "", OnMatchJoined); } catch (ArgumentException e) { m_state = eMatchmakingState.GAME_STATE_SHOW_ROOMS; GameObject.Find("Version Text").transform.SetParent(GameObject.Find("Canvas").transform); GameObject.Find("FullScreen").transform.SetParent(GameObject.Find("Canvas").transform); GameObject.Find("DialogDisplay").GetComponent<DialogDisplay>().DisplayDialog("You just left that room!"); Debug.Log("caught ArgumentException " + e); } catch (Exception e) { m_state = eMatchmakingState.GAME_STATE_SHOW_ROOMS; GameObject.Find("Version Text").transform.SetParent(GameObject.Find("Canvas").transform); GameObject.Find("FullScreen").transform.SetParent(GameObject.Find("Canvas").transform); GameObject.Find("DialogDisplay").GetComponent<DialogDisplay>().DisplayDialog("Error joining room! Try restarting."); Debug.Log("caught Exception " + e); } } }
public void OnClickBackOnJoinGameOverlay() { Debug.Log ("OnClickBackOnJoinGameOverlay()"); selectedMatchDesc = null; onlineFindJoinGameOverlay.SetActive (false); }
public MatchInfoObject(MatchDesc snapshot)
public void JoinMatch(MatchDesc match) { networkManager.matchName = match.name; networkManager.matchSize = (uint)match.currentSize; networkManager.matchMaker.JoinMatch(match.networkId, "", networkManager.OnMatchJoined); }
public void buttonClicked(MatchDesc desc) { networkMatch.JoinMatch(desc.networkId, "", OnMatchJoined); }
public void JoinMatch(MatchDesc match) { //Debug.Log ("Join " + roomName); networkMatch.JoinMatch (match.networkId, "", OnMatchJoined); }
public void SetMatch(MatchDesc info) { _myMatchDesc = info; _myText.text = _myMatchDesc.name; GetComponent<Button>().onClick.AddListener(() => JoinMatch()); }
public void OnClickSelectGame(MatchDesc selectedMatch) { Debug.Log ("OnClickSelectGame()"); selectedMatchDesc = selectedMatch; onlineFindJoinGameOverlay.SetActive (true); onlineFindJoinGameNameText.text = selectedMatchDesc.name; }
public void onRefreshClicked() { toggleWaitScreen (true, "Loading Matches"); SelectedMatch = null; }
public void Connect(MatchDesc room) { m_match.JoinMatch(room.networkId, "", OnMatchJoined); }