Beispiel #1
0
        static StackObject *SetMatchAttributes_7(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 5);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Networking.Match.NetworkMatch.BasicResponseDelegate callback = (UnityEngine.Networking.Match.NetworkMatch.BasicResponseDelegate) typeof(UnityEngine.Networking.Match.NetworkMatch.BasicResponseDelegate).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int32 requestDomain = ptr_of_this_method->Value;
            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            System.Boolean isListed = ptr_of_this_method->Value == 1;
            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            UnityEngine.Networking.Types.NetworkID networkId = (UnityEngine.Networking.Types.NetworkID) typeof(UnityEngine.Networking.Types.NetworkID).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 5);
            UnityEngine.Networking.Match.NetworkMatch instance_of_this_method;
            instance_of_this_method = (UnityEngine.Networking.Match.NetworkMatch) typeof(UnityEngine.Networking.Match.NetworkMatch).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.SetMatchAttributes(networkId, isListed, requestDomain, callback);

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Beispiel #2
0
 public void JoinGame(string matchName, UnityEngine.Networking.Types.NetworkID matchId)
 {
     netManager.matchName = matchName;
     netManager.matchMaker.JoinMatch(matchId, "", "", "", 0, 0, netManager.OnMatchJoined);
     SwitchSheet();
     SwitchChatButton();
 }
Beispiel #3
0
        static StackObject *JoinMatch_3(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 8);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Networking.Match.NetworkMatch.DataResponseDelegate <UnityEngine.Networking.Match.MatchInfo> callback = (UnityEngine.Networking.Match.NetworkMatch.DataResponseDelegate <UnityEngine.Networking.Match.MatchInfo>) typeof(UnityEngine.Networking.Match.NetworkMatch.DataResponseDelegate <UnityEngine.Networking.Match.MatchInfo>).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            System.Int32 requestDomain = ptr_of_this_method->Value;
            ptr_of_this_method = ILIntepreter.Minus(__esp, 3);
            System.Int32 eloScoreForClient = ptr_of_this_method->Value;
            ptr_of_this_method = ILIntepreter.Minus(__esp, 4);
            System.String privateClientAddress = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 5);
            System.String publicClientAddress = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 6);
            System.String matchPassword = (System.String) typeof(System.String).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 7);
            UnityEngine.Networking.Types.NetworkID netId = (UnityEngine.Networking.Types.NetworkID) typeof(UnityEngine.Networking.Types.NetworkID).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 8);
            UnityEngine.Networking.Match.NetworkMatch instance_of_this_method;
            instance_of_this_method = (UnityEngine.Networking.Match.NetworkMatch) typeof(UnityEngine.Networking.Match.NetworkMatch).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = instance_of_this_method.JoinMatch(netId, matchPassword, publicClientAddress, privateClientAddress, eloScoreForClient, requestDomain, callback);

            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
Beispiel #4
0
    // Nem preciso falar que tudo isso vai ser refeito né!!!!!
    public void DrawServerList(bool success, string extendedInfo, List <UnityEngine.Networking.Match.MatchInfoSnapshot> matches)
    {
        if (success)
        {
            if (matches.Count == 0)
            {
                Debug.Log("Nenhum Servidor Encontrado.");
            }
            else
            {
                // Limpa o quadro atual.
                for (int i = 0; i < serversContent.childCount; i++)
                {
                    Destroy(serversContent.gameObject);
                }

                for (int i = 0; i < matches.Count; i++)
                {
                    GameObject server = (GameObject)Instantiate(serverData);
                    server.transform.SetParent(serversContent, false);
                    server.transform.GetChild(0).GetComponent <Text>().text = matches[i].name;
                    server.transform.GetChild(1).GetComponent <Text>().text = "Players " + matches[i].currentSize.ToString() + "/" + matches[i].maxSize.ToString();
                    server.transform.GetChild(2).GetComponent <Button>().onClick.RemoveAllListeners();
                    UnityEngine.Networking.Types.NetworkID networkID = matches[i].networkId;

                    server.transform.GetChild(2).GetComponent <Button>().onClick.AddListener(() => { JoinMatch(networkID, _lobbyManager); });
                }
            }
        }
        else
        {
            Debug.Log("Erro ao ao buscar servidores: " + extendedInfo);
        }
    }
Beispiel #5
0
    public void OnMatchList(bool success, string extendedInfo, List <MatchInfoSnapshot> matches)
    {
        if (success)
        {
            int childCount = listOfMatches.transform.childCount;
            for (int i = 0; i < childCount; ++i)
            {
                Destroy(listOfMatches.transform.GetChild(i).gameObject);
            }

            for (int i = 0; i < matches.Count; ++i)
            {
                MatchInfoSnapshot match     = matches[i];
                string            matchName = match.name;
                UnityEngine.Networking.Types.NetworkID networkId = match.networkId;

                GameObject    gameObject = Instantiate(matchEntryPrefab, listOfMatches);
                RectTransform rect       = gameObject.GetComponent <RectTransform>();

                rect.position = new Vector2(10, listOfMatches.position.y - (float)i * 50.0f);

                Text text = gameObject.GetComponentInChildren <Text>();
                text.text = "Match: " + matchName;
                Button button = gameObject.GetComponentInChildren <Button>();

                button.onClick.AddListener(delegate { OnJoinMatchClicked(networkId); });
            }
        }
        else
        {
            Debug.Log("OnMatchList failed");
        }
    }
Beispiel #6
0
 private void JoinMatch(UnityEngine.Networking.Types.NetworkID networkID, LobbyManager lobbyManager)
 {
     lobbyManager.matchMaker.JoinMatch(networkID, "", "", "", 0, 0, lobbyManager.OnMatchJoined);
     //lobbyManager.backDelegate = lobbyManager.StopClientClbk;
     //lobbyManager._isMatchmaking = true;
     //lobbyManager.DisplayIsConnecting();
 }
Beispiel #7
0
    /// <summary>
    /// Sends a request to join match, once processed the provided callback will be executed.
    /// </summary>
    /// <param name="netID">The match id provided, each server entry will know its ID</param>
    /// <param name="onMatchJoinedCallback">A callback that will get executed once the match join request has been processed by the server</param>
    public void JoinUnityMatchmakingMatch(UnityEngine.Networking.Types.NetworkID netID, Action <bool, string, MatchInfo> onMatchJoinedCallback)
    {
        //To join a server we neet to pass trough the lobby first
        if (State != ENetworkState.InLobby)
        {
            Debug.Log("Not connected to server, connect first");
            return;
        }

        //Update data and set callback
        State = ENetworkState.JoiningMatch;
        m_OnMatchcJoinedCallback = onMatchJoinedCallback;
        //Send request to join the match
        matchMaker.JoinMatch(netID, string.Empty, string.Empty, string.Empty, 0, 0, OnMatchJoined);
    }
Beispiel #8
0
 public void OnMatchList(bool success, string extendedInfo, List <MatchInfoSnapshot> matches)
 {
     matchCount = matches.Count;
     if (matches.Count > 0)
     {
         netID = matches[0].networkId; // This is the first match networkId
     }
     CheckUp();
     for (int i = 0; i == matches.Count; i++)
     {
         netID       = matches[0].networkId;
         matchNumber = i;
         networkManager.matchMaker.JoinMatch(matches[matches.Count - 1].networkId, "", "", "", 0, 0, OnMatchJoined);
         CheckUp();
     }
 }
Beispiel #9
0
        static StackObject *SetAccessTokenForNetwork_1(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Networking.Types.NetworkAccessToken accessToken = (UnityEngine.Networking.Types.NetworkAccessToken) typeof(UnityEngine.Networking.Types.NetworkAccessToken).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.Networking.Types.NetworkID netId = (UnityEngine.Networking.Types.NetworkID) typeof(UnityEngine.Networking.Types.NetworkID).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            UnityEngine.Networking.Utility.SetAccessTokenForNetwork(netId, accessToken);

            return(__ret);
        }
Beispiel #10
0
 private void JoinMatch(UnityEngine.Networking.Types.NetworkID networkId, MatchRoomInfo roomInfo, Action onSuccess, Action onFailed)
 {
     NetworkManager.singleton.matchMaker.JoinMatch(networkId, roomInfo.password, "", "", 0, 0,
                                                   (success, extendedInfo, match) => {
         if (success)
         {
             MatchInfo hostInfo = match;
             NetworkManager.singleton.StartClient(hostInfo);
             onShowLoadingText.SafeInvoke("ルーム参加に成功しました");
             onSuccess.SafeInvoke();
         }
         else
         {
             onShowLoadingText.SafeInvoke("ルームに参加できませんでした");
             onFailed.SafeInvoke();
         }
     });
 }
Beispiel #11
0
        static StackObject *GetAccessTokenForNetwork_2(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 1);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.Networking.Types.NetworkID netId = (UnityEngine.Networking.Types.NetworkID) typeof(UnityEngine.Networking.Types.NetworkID).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            var result_of_this_method = UnityEngine.Networking.Utility.GetAccessTokenForNetwork(netId);

            object obj_result_of_this_method = result_of_this_method;

            if (obj_result_of_this_method is CrossBindingAdaptorType)
            {
                return(ILIntepreter.PushObject(__ret, __mStack, ((CrossBindingAdaptorType)obj_result_of_this_method).ILInstance));
            }
            return(ILIntepreter.PushObject(__ret, __mStack, result_of_this_method));
        }
 private string _GeetRoomNumberFromNetworkId(UnityEngine.Networking.Types.NetworkID networkID)
 {
     return((System.Convert.ToInt64(networkID.ToString()) % 10000).ToString());
 }
 private void JoinToMatch(UnityEngine.Networking.Types.NetworkID matchId)
 {
     matchMaker.JoinMatch(matchId, "", "", "", 0, 0, OnInternetMatchJoin);
 }
 private OnClickMatchJoin OnMatchJoinClicked(UnityEngine.Networking.Types.NetworkID matchId)
 {
     return(new OnClickMatchJoin(() => JoinToMatch(matchId)));
 }
Beispiel #15
0
 public void OnJoinMatchClicked(UnityEngine.Networking.Types.NetworkID networkId)
 {
     NetworkManager.singleton.StartMatchMaker();
     NetworkManager.singleton.matchMaker.JoinMatch(networkId, "", "", "", 0, 0, OnMatchJoin);
 }
Beispiel #16
0
 public void JoinOnlineGame(UnityEngine.Networking.Types.NetworkID matchID)   //Joins an online game
 {
     CustomNetworkManager.Instance.JoinOnlineGame(matchID);
 }
Beispiel #17
0
 public void JoinOnlineGame(UnityEngine.Networking.Types.NetworkID matchID)   //Joins an online game, based on UI
 {
     Instance.matchMaker.JoinMatch(matchID, "", "", "", 0, 0, Instance.OnMatchJoined);
 }