Esempio n. 1
0
    void StartMatchmaking()
    {
        var options = new MatchmakingOptions();

        options.SetEnqueueQueryKey("quickmatch_query");
        options.SetCreateRoomJoinPolicy(RoomJoinPolicy.Everyone);
        options.SetCreateRoomMaxUsers(MaxClients);
        options.SetEnqueueDataSettings("version", Constants.Version.GetHashCode());

        Matchmaking.Enqueue2("quickmatch", options).OnComplete(MatchmakingEnqueueCallback);
        timeMatchmakingStarted = renderTime;
        state = InMatchmaking;
    }
    void CreateRoom(Message <User> message)
    {
        if (message.IsError)
        {
            Log("error: Could not get signed in user");
            return;
        }

        Log("User id is " + message.Data.ID);
        Log("Oculus id is " + message.Data.OculusID);
        clients[0].state    = Connected;
        clients[0].userId   = message.Data.ID;
        clients[0].oculusId = message.Data.OculusID;

        var options = new MatchmakingOptions();

        options.SetEnqueueQueryKey("quickmatch_query");
        options.SetCreateRoomJoinPolicy(RoomJoinPolicy.Everyone);
        options.SetCreateRoomMaxUsers(MaxClients);
        options.SetEnqueueDataSettings("version", Constants.Version.GetHashCode());

        Matchmaking.CreateAndEnqueueRoom2("quickmatch", options).OnComplete(PrintRoomDetails);
    }
Esempio n. 3
0
    void GetLoggedInUserCallback(Message <User> msg)
    {
        if (!msg.IsError)
        {
            Debug.Log("User id is " + msg.Data.ID);
            Debug.Log("Oculus id is " + msg.Data.OculusID);

            client[0].state    = ClientState.Connected;
            client[0].userId   = msg.Data.ID;
            client[0].oculusId = msg.Data.OculusID;

            MatchmakingOptions matchmakingOptions = new MatchmakingOptions();
            matchmakingOptions.SetEnqueueQueryKey("quickmatch_query");
            matchmakingOptions.SetCreateRoomJoinPolicy(RoomJoinPolicy.Everyone);
            matchmakingOptions.SetCreateRoomMaxUsers(Constants.MaxClients);
            matchmakingOptions.SetEnqueueDataSettings("version", Constants.Version.GetHashCode());

            Matchmaking.CreateAndEnqueueRoom2("VRNetwork_Test_Key", matchmakingOptions).OnComplete(CreateAndEnqueueRoomCallback);
        }
        else
        {
            Debug.Log("error: Could not get signed in user");
        }
    }