Beispiel #1
0
    public static IEnumerator Deactivate(GUIDialogBox cb, bool saveBefore)
    {
        if(Application.internetReachability != NetworkReachability.NotReachable)
        {
            EncodeToolSet encoder = new EncodeToolSet();
            string login = PlayerPrefs.GetString(usefullData.k_logIn);
            string mdp = PlayerPrefs.GetString(usefullData.k_password);
            string code = encoder.createSendCode(false,false,int.Parse(login),mdp);

            WWWForm deactForm = new WWWForm();
            deactForm.AddField("ac", code);

            WWW sender = new WWW(usefullData.DeactivationUrl,deactForm);

            yield return sender;

            if(sender.error != null)
            {
                Debug.Log("ERROR : "+sender.error);
            }
            else
            {
                Debug.Log("Deactivation result "+sender.text);
                usefullData.DeleteLogo();
                PlayerPrefs.DeleteAll();
                //SetAllowQuit(true);
                InterProcess.Stop();
                #if UNITY_STANDALONE_WIN
                System.Diagnostics.Process.GetCurrentProcess().Kill();
        #else
                UnityEngine.Application.Quit();
        #endif
            }
        }
        else if(saveBefore)
        {
            cb.showMe(true,GUI.depth);
                cb.setBtns(TextManager.GetText("GUIMenuRight.Yes"),
                    TextManager.GetText("GUIMenuRight.No"),
                    TextManager.GetText("GUIMenuRight.Save"));

            cb.setText(TextManager.GetText("GUIMenuRight.ConnectionFailed"));
        }
    }
Beispiel #2
0
    //-----------------------------------------------------------
    private PayPerUseMdl()
    {
        m_encodeur = new EncodeToolSet();
        m_decodeur = new DecodeToolSet();
        m_days = new ArrayList();
        m_code = "";
        m_needToSendCode = false;

        if(PlayerPrefs.HasKey(c_payperuseKey))
        {
            m_code = PlayerPrefs.GetString(c_payperuseKey);
            CreateDaysFromCode();
        }

        if(PlayerPrefs.HasKey(c_ppuKWaitSending))
        {
            m_needToSendCode = (PlayerPrefs.GetInt(c_ppuKWaitSending) == 0)? false : true;
            if(m_needToSendCode)
                FirePayPerUseSendRequest(true);
        }
    }
Beispiel #3
0
    /*
     * fonction qui sérialise les donnés d'activations et les
     * enregistre dans la base de registre
     * */
    public string serializeInfos(EncodeToolSet encoder)
    {
        sbyte[] buffer = new sbyte[16];
        int off7 = 0;

        buffer[off7] = _random; 				off7++;//0
        buffer[off7] = _checkSum; 				off7++;//1
        buffer[off7] = (sbyte)(_endDate >> 16); off7++;//2
        buffer[off7] = (sbyte)(_endDate >> 8); 	off7++;//3
        buffer[off7] = (sbyte)(_endDate); 		off7++;//4

        for(int i=0 ; i<_macAddress.Length ; i++)
        {
            buffer[off7] = _macAddress[i];
            off7++;
        }

        buffer[off7] = _idsoft;					off7++;
        putShort(buffer,off7,_revendeur);		off7=off7 + 2;
        buffer[off7] = _version;					off7++;
        buffer[off7] = _nbLibs;

        return encoder.encodeSBytesUpperCase(buffer);
    }