// Obtem o resultado da conexao
    private void handleConnection(WWW conn, string id, object state, byte[] form_data, Hashtable headers)
    {
        // Verifica se houve erro
        if (conn.error != null)
        {
            if (url.Contains(Flow.URL_BASE) && url.EndsWith(".picture.php"))
            {
                return;
            }

            Debug.Log(url);
            Debug.Log("Internal server error to url (" + url + "): " + conn.error);

            sendToCallbackPersistent(conn.error, conn, state, id, conn.url, form_data, headers);

            return;
        }

        // Verifica se pediu senha
        try
        {
            JSonReader  reader = new JSonReader();
            IJSonObject data   = reader.ReadAsJSonObject(conn.text);

            if (data != null && data.Contains("ask"))
            {
                // Caso peca senha, avisa o erro
                if (data["ask"].ToString() == "password")
                {
                    sendToCallbackPersistent(DEFAULT_ERROR_MESSAGE + "r", null, state, id, conn.url, form_data, headers);
                }

                // Obtem o token do Facebook, caso necessario
                else if (data["ask"].ToString() == "fb_token")
                {
                    GameFacebook facebook = new GameFacebook();
                    facebook.login();
                    sendToCallbackPersistent(DEFAULT_FB_TOKEN_ERROR_MESSAGE, null, state, id, conn.url, form_data, headers);
                }

                // Refaz a conexao caso necessario e possivel
                //if (redo && GameGUI.components != null) GameGUI.components.StartCoroutine(startConnection(form, state, false));
                //else Application.LoadLevel(GameGUI.components.login_scene);

                return;
            }
        }
        catch (JSonReaderException)
        {
        }

        sendToCallbackPersistent(conn.error, conn, state, id, conn.url, form_data, headers);
    }
Example #2
0
	// Use this for initialization
	void Start () 
	{		
		scroll = Flow.config.GetComponent<ConfigManager>().inviteAllScroll;
		playingScroll = Flow.config.GetComponent<ConfigManager>().invitePlayingScroll;
		
		scroll.transform.parent = gameObject.transform;
		playingScroll.transform.parent = gameObject.transform;
		
		scroll.transform.position = new Vector3
		(
			// primeira coluna refere-se a posicao do panel manager no mundo
			// segunda coluna refere-se a posicao do invite em relacao ao panel manager
			// terceira coluna refere-se a posicao do scroll em relacao ao invite panel
			-31.4336f 		+65.6814f		-0.7232132f, // x
			-0.9254344f 	+0.9254344f  	+0.7468368f, // y
			914.5213f 		+5.99231f		-7.011475f // z
		);
				
		playingScroll.transform.position = new Vector3
		(
			// primeira coluna refere-se a posicao do panel manager no mundo
			// segunda coluna refere-se a posicao do invite em relacao ao panel manager
			// terceira coluna refere-se a posicao do scroll em relacao ao invite panel
			-31.4336f 		+65.6814f 		-0.7232132f, 	// x
			-0.9254344f		+0.9254344f 	 	+0.7468368f, 	// y
			914.5213f 		+5.99231f 		-7.011475f 		// z
		);
		
		UIInteractivePanel panel = GetComponent<UIInteractivePanel>();
		
		panel.transitions.list[0].AddTransitionStartDelegate(EnteredInvite);
		panel.transitions.list[1].AddTransitionStartDelegate(EnteredInvite);
		
		inviteFriendPanel.GetComponent<UIInteractivePanel>().transitions.list[2].AddTransitionEndDelegate(SetInviteFriendsInactive);
		
		//searchText.SetFocusDelegate(ClearText);
		//searchText.AddValidationDelegate(TextChanged);
		
		ChangedAllPlaying();
		
		// Find Friends Button
		if(Save.HasKey(PlayerPrefsKeys.FACEBOOK_TOKEN.ToString()))
		{
			findFriendsPanel.SetActive(false);
		}
		else
		{
			fb_account = new GameFacebook(handleLinkFacebook);
		}
	}
Example #3
0
    void FindFriends()
    {
        Flow.path = TurnStatus.BeginGame;

        if (Save.HasKey(PlayerPrefsKeys.FACEBOOK_TOKEN.ToString()))
        {
            panelManager.BringIn("InviteScenePanel");
        }
        else
        {
            fb_account = new GameFacebook(HandleLinkFacebook);
            Flow.game_native.startLoading();
            fb_account.link();
        }
    }
Example #4
0
    // Use this for initialization
    void Start()
    {
        accountSettingsPanel.transitions.list[0].AddTransitionStartDelegate(AccountSettingsLoad);

        dayField.AddValidationDelegate(DateFieldValidation);
        monthField.AddValidationDelegate(DateFieldValidation);
        yearField.AddValidationDelegate(DateFieldValidation);
        dayField.AddFocusDelegate(ClearText);
        monthField.AddFocusDelegate(ClearText);
        yearField.AddFocusDelegate(ClearText);
        firstNameField.AddFocusDelegate(ClearText);
        lastNameField.AddFocusDelegate(ClearText);
        countryField.AddFocusDelegate(ClearText);
        changeEmailNewMailField.AddFocusDelegate(ClearText);

        fb_account = new GameFacebook(HandleLinkFacebook);
    }
	// Use this for initialization
	void Start () 
	{
		accountSettingsPanel.transitions.list[0].AddTransitionStartDelegate(AccountSettingsLoad);
		
		dayField.AddValidationDelegate(DateFieldValidation);
		monthField.AddValidationDelegate(DateFieldValidation);
		yearField.AddValidationDelegate(DateFieldValidation);
		dayField.AddFocusDelegate(ClearText);
		monthField.AddFocusDelegate(ClearText);
		yearField.AddFocusDelegate(ClearText);
		firstNameField.AddFocusDelegate(ClearText);
		lastNameField.AddFocusDelegate(ClearText);
		countryField.AddFocusDelegate(ClearText);
		changeEmailNewMailField.AddFocusDelegate(ClearText);
		
		fb_account = new GameFacebook(HandleLinkFacebook);
	}
Example #6
0
    // Use this for initialization
    void Start()
    {
        repositoryLists = Flow.config.transform.FindChild("-Lists-").gameObject;

        scroll        = Flow.config.GetComponent <ConfigManager>().inviteAllScroll;
        playingScroll = Flow.config.GetComponent <ConfigManager>().invitePlayingScroll;

        scroll.transform.parent        = gameObject.transform;
        playingScroll.transform.parent = gameObject.transform;

        scroll.transform.localPosition   = new Vector3(-0.7232132f, 0.7468368f, -7.011475f);
        playingScroll.transform.position = new Vector3(-0.7232132f, 0.7468368f, -7.011475f);

        UIInteractivePanel panel = GetComponent <UIInteractivePanel>();

        panel.transitions.list[0].AddTransitionStartDelegate(EnteredInvite);
        panel.transitions.list[1].AddTransitionStartDelegate(EnteredInvite);

        inviteFriendPanel.GetComponent <UIInteractivePanel>().transitions.list[2].AddTransitionEndDelegate(SetInviteFriendsInactive);
        inviteFriendPanel.GetComponent <UIInteractivePanel>().transitions.list[0].AddTransitionEndDelegate(AddEmail);

        //searchText.SetFocusDelegate(ClearText);
        //searchText.AddValidationDelegate(TextChanged);

        ChangedAllPlaying();

        // Find Friends Button
        if (Save.HasKey(PlayerPrefsKeys.FACEBOOK_TOKEN.ToString()))
        {
            findFriendsPanel.SetActive(false);
        }
        else
        {
            fb_account = new GameFacebook(handleLinkFacebook);
        }
    }
Example #7
0
	// Use this for initialization
	void Start () 
	{
		repositoryLists = Flow.config.transform.FindChild("-Lists-").gameObject;
		
		scroll = Flow.config.GetComponent<ConfigManager>().inviteAllScroll;
		playingScroll = Flow.config.GetComponent<ConfigManager>().invitePlayingScroll;
		
		scroll.transform.parent = gameObject.transform;
		playingScroll.transform.parent = gameObject.transform;
		
		scroll.transform.localPosition = new Vector3(-0.7232132f, 0.7468368f, -7.011475f);
		playingScroll.transform.position = new Vector3(-0.7232132f, 0.7468368f, -7.011475f);
		
		UIInteractivePanel panel = GetComponent<UIInteractivePanel>();
		
		panel.transitions.list[0].AddTransitionStartDelegate(EnteredInvite);
		panel.transitions.list[1].AddTransitionStartDelegate(EnteredInvite);
		
		inviteFriendPanel.GetComponent<UIInteractivePanel>().transitions.list[2].AddTransitionEndDelegate(SetInviteFriendsInactive);
		inviteFriendPanel.GetComponent<UIInteractivePanel>().transitions.list[0].AddTransitionEndDelegate(AddEmail);

		//searchText.SetFocusDelegate(ClearText);
		//searchText.AddValidationDelegate(TextChanged);
		
		ChangedAllPlaying();
		
		// Find Friends Button
		if(Save.HasKey(PlayerPrefsKeys.FACEBOOK_TOKEN.ToString()))
		{
			findFriendsPanel.SetActive(false);
		}
		else
		{
			fb_account = new GameFacebook(handleLinkFacebook);
		}
	}
    // Inicia o "giro" do Facebook nativo e envia callback pra refazer a conexão
	public void Login(object state, GameFacebook.LoginCallback callback)
	{
        new GameFacebook().login(state, callback);
    }
Example #9
0
	void FindFriends()
	{
		Flow.path = TurnStatus.BeginGame;
		
		if(Save.HasKey(PlayerPrefsKeys.FACEBOOK_TOKEN.ToString()))
		{
			panelManager.BringIn("InviteScenePanel");
		}
		else
		{
			fb_account = new GameFacebook(HandleLinkFacebook);
			Flow.game_native.startLoading();
			fb_account.link();
		}
	}