Exemplo n.º 1
0
    public void MenuTus(MenuStack menuStack)
    {
        this.menuTus.Update();
        bool enabled = User.get_IsSignedInPSN() && !TusTss.IsTusBusy();

        if (this.menuTus.AddItem("TUS Set Data", enabled))
        {
            byte[] array = new byte[4];
            for (int i = 0; i < 4; i++)
            {
                array[i] = (byte)(3 - i);
            }
            OnScreenLog.Add(" Data size: " + array.Length);
            string text = string.Empty;
            int    num  = 0;
            while (num < 16 && num < array.Length)
            {
                text = text + array[num].ToString() + ", ";
                num++;
            }
            OnScreenLog.Add(" Data: " + text);
            this.m_TUSDataRequestType = SonyNpCloudTUS.TUSDataRequestType.SaveRawData;
            this.ErrorHandler(TusTss.SetTusData(1, array));
        }
        if (this.menuTus.AddItem("TUS Request Data", enabled))
        {
            this.m_TUSDataRequestType = SonyNpCloudTUS.TUSDataRequestType.LoadRawData;
            this.ErrorHandler(TusTss.RequestTusData(1));
        }
        if (this.menuTus.AddItem("TUS Save PlayerPrefs", enabled))
        {
            PlayerPrefs.DeleteAll();
            PlayerPrefs.SetInt("keyA", 1);
            PlayerPrefs.SetString("keyB", "Hello");
            PlayerPrefs.SetInt("keyC", 3);
            PlayerPrefs.SetInt("keyD", 4);
            byte[] array2 = PSVitaPlayerPrefs.SaveToByteArray();
            this.m_TUSDataRequestType = SonyNpCloudTUS.TUSDataRequestType.SavePlayerPrefs;
            this.ErrorHandler(TusTss.SetTusData(3, array2));
        }
        if (this.menuTus.AddItem("TUS Load PlayerPrefs", enabled))
        {
            this.m_TUSDataRequestType = SonyNpCloudTUS.TUSDataRequestType.LoadPlayerPrefs;
            this.ErrorHandler(TusTss.RequestTusData(3));
        }
        if (this.menuTus.AddItem("TUS Set Variables", enabled))
        {
            this.ErrorHandler(TusTss.SetTusVariables(new TusTss.TusVariable[]
            {
                new TusTss.TusVariable(1, 110L),
                new TusTss.TusVariable(2, 220L),
                new TusTss.TusVariable(3, 330L),
                new TusTss.TusVariable(4, 440L)
            }));
        }
        if (this.menuTus.AddItem("TUS Request Variables", enabled))
        {
            int[] array3 = new int[]
            {
                1,
                2,
                3,
                4
            };
            this.ErrorHandler(TusTss.RequestTusVariables(array3));
        }
        if (this.menuTus.AddItem("TUS Set Variables VU", enabled))
        {
            TusTss.TusVariable[] array4 = new TusTss.TusVariable[]
            {
                new TusTss.TusVariable(5, 12345L)
            };
            this.ErrorHandler(TusTss.SetTusVariablesForVirtualUser(this.virtualUserOnlineID, array4));
        }
        if (this.menuTus.AddItem("TUS Request Variables VU", enabled))
        {
            int[] array5 = new int[]
            {
                5
            };
            this.ErrorHandler(TusTss.RequestTusVariablesForVirtualUser(this.virtualUserOnlineID, array5));
        }
        if (this.menuTus.AddItem("TUS Modify Variables VU", enabled))
        {
            TusTss.TusVariable[] array6 = new TusTss.TusVariable[]
            {
                new TusTss.TusVariable(5, 1L)
            };
            this.ErrorHandler(TusTss.ModifyTusVariablesForVirtualUser(this.virtualUserOnlineID, array6));
        }
        if (this.menuTus.AddBackIndex("Back", true))
        {
            menuStack.PopMenu();
        }
    }
Exemplo n.º 2
0
    public void MenuTus(MenuStack menuStack)
    {
        menuTus.Update();
        bool enabled = User.IsSignedInPSN && !TusTss.IsTusBusy();

        if (menuTus.AddItem("TUS Set Data", enabled))
        {
            byte[] array = new byte[4];
            for (int i = 0; i < 4; i++)
            {
                array[i] = (byte)(3 - i);
            }
            OnScreenLog.Add(" Data size: " + array.Length);
            string text = string.Empty;
            for (int j = 0; j < 16 && j < array.Length; j++)
            {
                text = text + array[j].ToString() + ", ";
            }
            OnScreenLog.Add(" Data: " + text);
            m_TUSDataRequestType = TUSDataRequestType.SaveRawData;
            ErrorHandler(TusTss.SetTusData(1, array));
        }
        if (menuTus.AddItem("TUS Request Data", enabled))
        {
            m_TUSDataRequestType = TUSDataRequestType.LoadRawData;
            ErrorHandler(TusTss.RequestTusData(1));
        }
        if (menuTus.AddItem("TUS Save PlayerPrefs", enabled))
        {
            PlayerPrefs.DeleteAll();
            PlayerPrefs.SetInt("keyA", 1);
            PlayerPrefs.SetString("keyB", "Hello");
            PlayerPrefs.SetInt("keyC", 3);
            PlayerPrefs.SetInt("keyD", 4);
            byte[] data = PSVitaPlayerPrefs.SaveToByteArray();
            m_TUSDataRequestType = TUSDataRequestType.SavePlayerPrefs;
            ErrorHandler(TusTss.SetTusData(3, data));
        }
        if (menuTus.AddItem("TUS Load PlayerPrefs", enabled))
        {
            m_TUSDataRequestType = TUSDataRequestType.LoadPlayerPrefs;
            ErrorHandler(TusTss.RequestTusData(3));
        }
        if (menuTus.AddItem("TUS Set Variables", enabled))
        {
            ErrorHandler(TusTss.SetTusVariables(new TusTss.TusVariable[4]
            {
                new TusTss.TusVariable(1, 110L),
                new TusTss.TusVariable(2, 220L),
                new TusTss.TusVariable(3, 330L),
                new TusTss.TusVariable(4, 440L)
            }));
        }
        if (menuTus.AddItem("TUS Request Variables", enabled))
        {
            int[] slotIDs = new int[4]
            {
                1,
                2,
                3,
                4
            };
            ErrorHandler(TusTss.RequestTusVariables(slotIDs));
        }
        if (menuTus.AddItem("TUS Set Variables VU", enabled))
        {
            ErrorHandler(TusTss.SetTusVariablesForVirtualUser(variables: new TusTss.TusVariable[1]
            {
                new TusTss.TusVariable(5, 12345L)
            }, onlineID: virtualUserOnlineID));
        }
        if (menuTus.AddItem("TUS Request Variables VU", enabled))
        {
            int[] slotIDs2 = new int[1]
            {
                5
            };
            ErrorHandler(TusTss.RequestTusVariablesForVirtualUser(virtualUserOnlineID, slotIDs2));
        }
        if (menuTus.AddItem("TUS Modify Variables VU", enabled))
        {
            ErrorHandler(TusTss.ModifyTusVariablesForVirtualUser(variables: new TusTss.TusVariable[1]
            {
                new TusTss.TusVariable(5, 1L)
            }, onlineID: virtualUserOnlineID));
        }
        if (menuTus.AddBackIndex("Back"))
        {
            menuStack.PopMenu();
        }
    }