Пример #1
0
    public static Dictionary <string, dynamic> _T_GetDummyPlayerSessionDataJsonDic(YipliUtils.PlayerActions inputAction)
    {
        Debug.Log("In _T_GetDummyPlayerSessionDataJsonDic()");

        Dictionary <string, dynamic> dummyPlayerGameSessionData;

        string[] validPlayerIds = { "-M2iG0P2_UNsE2VRcU5P",
                                    "-M2w4KLzwrYAJazfUiVk",
                                    "-M3HbYi8E7R-8A5aQwIe",
                                    "-M76fDnU3flm2kJtZLej",
                                    "-M7DmXj_rRc7OaMYUOiT",
                                    "-M7MEaBdQsdURULQ8mBl",
                                    "-M7MW0ooyJJmyHJdXjcx",
                                    "-M7W_5gJ089KDR8qw66A",
                                    "-M9qjcsLm6PIlA4ZnPsc",
                                    "-M9w0uOCu4KQNQXtWndZ",
                                    "-MCqsjHKKbeXdst-zmIM",
                                    "-MFH8Rc5Bao_TCUcg4jP",
                                    "-MFotyPFL5xjSP_y-he0" };

        string[] validGameIds = { "eggcatcher",
                                  "trapped",
                                  "joyfuljumps",
                                  "yiplirunner",
                                  "skater",
                                  "rollingball" };

        dummyPlayerGameSessionData = new Dictionary <string, dynamic>();
        try
        {
            //dummyPlayerGameSessionData.Add("game-id", validGameIds[UnityEngine.Random.Range(0, validGameIds.Length - 1)]);
            dummyPlayerGameSessionData.Add("game-id", "joyfuljumps");
            dummyPlayerGameSessionData.Add("user-id", "F9zyHSRJUCb0Ctc15F9xkLFSH5f1");
            dummyPlayerGameSessionData.Add("player-id", validPlayerIds[UnityEngine.Random.Range(0, validPlayerIds.Length - 1)]);
            dummyPlayerGameSessionData.Add("age", UnityEngine.Random.Range(6, 60));
            dummyPlayerGameSessionData.Add("points", UnityEngine.Random.Range(0, 500));
            dummyPlayerGameSessionData.Add("player", UnityEngine.Random.Range(120, 200));
            dummyPlayerGameSessionData.Add("duration", UnityEngine.Random.Range(60, 500));
            dummyPlayerGameSessionData.Add("intensity", UnityEngine.Random.Range(1, 3));
            dummyPlayerGameSessionData.Add("player-actions", _T_getDummyPlayerActions(inputAction));
            dummyPlayerGameSessionData.Add("mac-address", "-MGDS-zCTSVHfd4JWB2H");
            dummyPlayerGameSessionData.Add("calories", UnityEngine.Random.Range(10, 100));
            dummyPlayerGameSessionData.Add("fitness-points", UnityEngine.Random.Range(500, 20000));
            double timeStamp = new DateTime(2020, UnityEngine.Random.Range(1, 12), UnityEngine.Random.Range(1, 25)).Subtract(new DateTime(1970, 1, 1)).TotalMilliseconds;
            Debug.Log("Currrent TimeStamp : " + timeStamp);
            Debug.Log("Sending TimeStamp : " + timeStamp);
            dummyPlayerGameSessionData.Add("timestamp", timeStamp);
        }
        catch (Exception exp)
        {
            Debug.Log("Exception in filling data : " + exp.Message);
        }

        return(dummyPlayerGameSessionData);
    }
    private void MenuControlSystem()
    {
        string fmActionData = InitBLE.GetFMResponse();

        Debug.Log("Json Data from Fmdriver : " + fmActionData);

        if (fmActionData == null || fmActionData == "Make action")
        {
            return;
        }

        FmDriverResponseInfo singlePlayerResponse = JsonUtility.FromJson <FmDriverResponseInfo>(fmActionData);

        if (singlePlayerResponse == null)
        {
            return;
        }

        if (PlayerSession.Instance.currentYipliConfig.oldFMResponseCount != singlePlayerResponse.count)
        {
            //Debug.Log("FMResponse " + fmActionData);
            PlayerSession.Instance.currentYipliConfig.oldFMResponseCount = singlePlayerResponse.count;

            YipliUtils.PlayerActions providedAction = ActionAndGameInfoManager.GetActionEnumFromActionID(singlePlayerResponse.playerdata[0].fmresponse.action_id);

            switch (providedAction)
            {
            case YipliUtils.PlayerActions.LEFT:
                ProcessMatInputs(LEFT);
                break;

            case YipliUtils.PlayerActions.RIGHT:
                ProcessMatInputs(RIGHT);
                break;

            case YipliUtils.PlayerActions.ENTER:
                ProcessMatInputs(ENTER);
                break;
            }
        }
    }
Пример #3
0
        public static string getActionIDFromActionName(YipliUtils.PlayerActions actionName)
        {
            switch (actionName)
            {
            case YipliUtils.PlayerActions.LEFT:
                return("9GO5");

            case YipliUtils.PlayerActions.RIGHT:
                return("3KWN");

            case YipliUtils.PlayerActions.ENTER:
                return("PLW3");

            case YipliUtils.PlayerActions.PAUSE:
                return("UDH0");

            case YipliUtils.PlayerActions.RUNNING:
                return("SWLO");

            case YipliUtils.PlayerActions.RUNNINGSTOPPED:
                return("7RCE");

            case YipliUtils.PlayerActions.JUMP:
                return("9D6O");

            case YipliUtils.PlayerActions.RIGHTMOVE:
                return("DMEY");

            case YipliUtils.PlayerActions.LEFTMOVE:
                return("38UF");

            case YipliUtils.PlayerActions.JUMPIN:
                return("EUOA");

            case YipliUtils.PlayerActions.JUMPOUT:
                return("QRTY");

            case YipliUtils.PlayerActions.TILES:
                return("TIL3");

            case YipliUtils.PlayerActions.R_LEG_HOPPING:
                return("3DIN");

            case YipliUtils.PlayerActions.L_LEG_HOPPING:
                return("3DI1");

            case YipliUtils.PlayerActions.JUMPING_JACK:
                return("99XR");

            case YipliUtils.PlayerActions.SKIER_JACK:
                return("NWCH");

            case YipliUtils.PlayerActions.CROSSOVER_JUMPING_JACK:
                return("VUFO");

            case YipliUtils.PlayerActions.LUNGES_RUN:
                return("386I");

            case YipliUtils.PlayerActions.MOUNTAIN_CLIMBING:
                return("BGM4");

            case YipliUtils.PlayerActions.PLANK_STARTED:
                return("58GH");

            case YipliUtils.PlayerActions.PLANK_STOPPED:
                return("0DLA");

            case YipliUtils.PlayerActions.MULE_KICK:
                return("WBUT");

            case YipliUtils.PlayerActions.BURPEE:
                return("FN1S");

            case YipliUtils.PlayerActions.JUMPS_180:
                return("V56G");

            case YipliUtils.PlayerActions.DIAGONAL_JUMP:
                return("6JJR");

            case YipliUtils.PlayerActions.FORWARD_JUMP:
                return("UJ3J");

            case YipliUtils.PlayerActions.BACKWARD_JUMP:
                return("U10J");

            case YipliUtils.PlayerActions.RIGHT_JUMP:
                return("B8X7");

            case YipliUtils.PlayerActions.LEFT_JUMP:
                return("18X7");

            case YipliUtils.PlayerActions.STAR_JUMP:
                return("LPM0");

            case YipliUtils.PlayerActions.CHEST_JUMP:
                return("JASL");

            case YipliUtils.PlayerActions.HOPSCOTCH:
                return("U8W2");

            case YipliUtils.PlayerActions.BALANCE_STARTED:
                return("UWC6");

            case YipliUtils.PlayerActions.BALANCE_STOPPED:
                return("1WC1");

            case YipliUtils.PlayerActions.ARM_STARTED_1:
                return("ISJD");

            case YipliUtils.PlayerActions.ARM_STOPPED_1:
                return("EJ02");

            case YipliUtils.PlayerActions.NINJA_KICK:
                return("90DM");

            case YipliUtils.PlayerActions.HIGH_KNEE:
                return("HXCQ");

            case YipliUtils.PlayerActions.SQUATS_180:
                return("FYN1");

            case YipliUtils.PlayerActions.SQUAT_AND_JUMP:
                return("6CTM");

            case YipliUtils.PlayerActions.SQUAT_AND_KICK:
                return("E0CB");

            case YipliUtils.PlayerActions.SQUATS:
                return("OYMP");

            case YipliUtils.PlayerActions.SQUAT_AND_JUMPING_JACK:
                return("O12U");

            case YipliUtils.PlayerActions.LATERAL_SQUATS:
                return("X5IW");

            case YipliUtils.PlayerActions.PLANK_JUMP_INS:
                return("WBTW");

            case YipliUtils.PlayerActions.LEG_DOG_3:
                return("8G3J");

            case YipliUtils.PlayerActions.BANARSANA:
                return("UWHX");

            case YipliUtils.PlayerActions.ARDHA_CHANDRASANA:
                return("3JCQ");

            case YipliUtils.PlayerActions.MALASANA:
                return("3J11");

            case YipliUtils.PlayerActions.LEFT_TAP:
                return("9015");

            case YipliUtils.PlayerActions.RIGHT_TAP:
                return("3L1N");

            case YipliUtils.PlayerActions.LEFT_TOUCH:
                return("A075");

            case YipliUtils.PlayerActions.RIGHT_TOUCH:
                return("AL0N");

            case YipliUtils.PlayerActions.TROUBLESHOOTING:
                return("TRBL");
            }

            Debug.Log("Invalid action. Returning null Action ID.");
            return(null);
        }
Пример #4
0
    public static IDictionary <YipliUtils.PlayerActions, int> _T_getDummyPlayerActions(YipliUtils.PlayerActions inputAction)
    {
        IDictionary <YipliUtils.PlayerActions, int> playerActionCounts = new Dictionary <YipliUtils.PlayerActions, int>();

        playerActionCounts.Add(inputAction, 100);

        if (playerActionCounts.ContainsKey(YipliUtils.PlayerActions.RUNNING))
        {
            playerActionCounts[YipliUtils.PlayerActions.RUNNING] = playerActionCounts[YipliUtils.PlayerActions.RUNNING] + 1000;
        }
        else
        {
            playerActionCounts.Add(YipliUtils.PlayerActions.RUNNING, 1000);
        }

        return(playerActionCounts);
    }