コード例 #1
0
        void requestCreateRoom()
        {
            switch (currentState)
            {
            case states.NOT_INIT:
                printOutputLine("The app has not initialized properly and we don't know your userID.");
                break;

            case states.IDLE:
                printOutputLine("Trying to create a matchmaking room");
                Matchmaking.CreateAndEnqueueRoom(Constants.FILTER_POOL, 8, true, null).OnComplete(createRoomResponse);
                currentState = states.REQUEST_CREATE;
                break;

            case states.REQUEST_FIND:
                printOutputLine("You have already made a request to find a room.  Please wait for that request to complete.");
                break;

            case states.FINDING_ROOM:
                printOutputLine("You have already currently looking for a room.  Please wait for the match to be made.");
                break;

            case states.REQUEST_JOIN:
                printOutputLine("We are currently trying to join a room.  Please wait to see if we can join it.");
                break;

            case states.REQUEST_LEAVE:
                printOutputLine("We are currently trying to leave a room.  Please wait to see if we can leave it.");
                break;

            case states.REQUEST_CREATE:
                printOutputLine("You have already requested a matchmaking room to be created.  Please wait for the room to be made.");
                break;

            case states.IN_EMPTY_ROOM:
                printOutputLine("You have already in a matchmaking room.  Please wait for an opponent to join.");
                break;

            case states.IN_FULL_ROOM:
                printOutputLine("You have already in a match.");
                break;

            default:
                printOutputLine("You have hit an unknown state.");
                break;
            }
        }
コード例 #2
0
        void requestCreateFilterRoom()
        {
            switch (currentState)
            {
            case states.NOT_INIT:
                printOutputLine("The app has not initialized properly and we don't know your userID.\n");
                break;

            case states.IDLE:
                printOutputLine("Trying to create a matchmaking room");

                // We're going to create a room that has the following values set:
                // game_type_name = "CTF"
                // map_name = "Really_Big_Map"
                //

                Matchmaking.CustomQuery roomCustomQuery = new Matchmaking.CustomQuery();

                roomCustomQuery.criteria = null;
                roomCustomQuery.data     = new Dictionary <string, object>();

                roomCustomQuery.data.Add("game_type_name", "CTF");
                roomCustomQuery.data.Add("map_name", "Really_Big_Map");

                Matchmaking.CreateAndEnqueueRoom(Constants.FILTER_POOL, 8, true, roomCustomQuery).OnComplete(createRoomResponse);
                currentState = states.REQUEST_CREATE;
                break;

            case states.REQUEST_FIND:
                printOutputLine("You have already made a request to find a room.  Please wait for that request to complete.\n");
                break;

            case states.FINDING_ROOM:
                printOutputLine("You have already currently looking for a room.  Please wait for the match to be made.\n");
                break;

            case states.REQUEST_JOIN:
                printOutputLine("We are currently trying to join a room.  Please wait to see if we can join it.\n");
                break;

            case states.REQUEST_LEAVE:
                printOutputLine("We are currently trying to leave a room.  Please wait to see if we can leave it.\n");
                break;

            case states.REQUEST_CREATE:
                printOutputLine("You have already requested a matchmaking room to be created.  Please wait for the room to be made.\n");
                break;

            case states.IN_EMPTY_ROOM:
                printOutputLine("You have already in a matchmaking room.  Please wait for an opponent to join.\n");
                break;

            case states.IN_FULL_ROOM:
                printOutputLine("You have already in a match.\n");
                break;

            default:
                printOutputLine("You have hit an unknown state.\n");
                break;
            }
        }