示例#1
0
        /// <summary>
        /// Start Matchmaking
        /// </summary>
        /// <param name="playerId">The id of the player</param>
        /// <param name="playerProps">Custom player properties relevant to the matchmaking function</param>
        /// <param name="groupProps">Custom group properties relevant to the matchmaking function</param>
        public void RequestMatch(string playerId, MatchmakingPlayerProperties playerProps, MatchmakingGroupProperties groupProps)
        {
            request = CreateMatchmakingRequest(playerId, playerProps, groupProps);

            matchmakingController = new MatchmakingController(Endpoint);

            matchmakingController.StartRequestMatch(request, GetAssignment, OnError);
            State = MatchmakingState.Requesting;
            Debug.Log(State);
        }
示例#2
0
        /// <summary>
        /// Start matchmaking
        /// </summary>
        /// <param name="request">The matchmaking request</param>
        /// <param name="successCallback">If a match is found, this callback will provide the connection information</param>
        /// <param name="errorCallback">If matchmaking fails, this callback will provided some failure information</param>
        public void RequestMatch(MatchmakingRequest request, SuccessCallback successCallback,
                                 ErrorCallback errorCallback)
        {
            m_Success          = successCallback;
            m_Error            = errorCallback;
            MatchmakingRequest = request;

            matchmakingController = new MatchmakingController(Endpoint);

            matchmakingController.StartRequestMatch(request, GetAssignment, OnError);
            State = MatchmakingState.Requesting;
            Debug.Log(State);
        }