Пример #1
0
    public void LogoutWebRequest()
    {
        Popup.Ins.PopupWaiting(true);
        HttpClient client = new HttpClient();

        client.Headers.Add("Authorization", "Token " + PlayerPrefs.GetString("token"));

        client.Get(new Uri("https://www.pacheti.com/api/user/logout/"), HttpCompletionOption.AllResponseContent, r =>
        {
            if (!r.IsSuccessStatusCode)
            {
                Debug.Log(r.ReadAsString());
            }
            else
            {
                Debug.Log(r.ReadAsString());
                m_Logout = JsonUtility.FromJson <ResponseLogout>(r.ReadAsString());

                PlayerPrefs.DeleteKey("token");
                PlayerPrefs.DeleteKey("slug");
                PlayerPrefs.DeleteAll();
                PlayerPrefs.SetInt("Music", 1);
                PlayerPrefs.SetInt("Sound", 1);
                Popup.Ins.PopupWaiting(false);
            }
        });
    }
Пример #2
0
	/* DH change 
	 * Remove blinking and set processing 
	private void SetIsProcessing (bool isProc)
	{
		this.isProcessing = isProc;
		blinkOn = true;
		if (isProc) {
			StartCoroutine ("BlinkProcessing");
		} else {
			StopCoroutine ("BlinkProcessing");
		}
	}

	//function to blink the text
	private IEnumerator BlinkProcessing ()
	{
		while (true) {
			//set the Text's text to blank
			blinkOn = true;
			//display blank text for 0.5 seconds
			yield return new WaitForSeconds (.5f);
			//display “I AM FLASHING TEXT” for the next 0.5 seconds
			blinkOn = false;
			yield return new WaitForSeconds (.5f);
		}
	}
	*/
	
	public void ProcessLogout (NetworkResponse response)
	{
		ResponseLogout args = response as ResponseLogout;
		//act on logout regardless of response
		Application.Quit ();
		Game.SwitchScene ("Login");
	}
Пример #3
0
    public static NetworkResponse Parse(MemoryStream dataStream)
    {
        ResponseLogout response = new ResponseLogout();
        response.status = DataReader.ReadShort(dataStream);

        return response;
    }
    public static NetworkResponse Parse(MemoryStream dataStream)
    {
        ResponseLogout response = new ResponseLogout();

        response.status = DataReader.ReadShort(dataStream);

        return(response);
    }