Ejemplo n.º 1
0
	    // Use this for initialization
	    void Start()
	    {
			this.chatView.SetActive (true);
	        Application.runInBackground = true;
	        scroll_view_heigth = ((RectTransform)this.scroll_view.transform).sizeDelta.y;

	        photon_enemy = PhotonNetwork.otherPlayers[0];
	        user_enemy = (User)photon_enemy.allProperties["User"];
	        string txt_chat = "Vous jouez contre : " + user_enemy.username;
	        InstanciateMessage(txt_chat, Chat.EVENT);

	        channel_name = PhotonNetwork.room.name;
	        int alea = rand.Next(1000);
	        UserName = User.Instance.username + alea.ToString();

	        chatClient = new ChatClient(this);
	        chatClient.Connect(APP_ID, APP_VERSION, new AuthValues(UserName));

	        inputField.onEndEdit.AddListener(val =>
	            {
	                if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.KeypadEnter))
	                {
	                    SendMessageToOtherClient(inputField.text);
	                    inputField.text = "";
	                }
	            });
	    }
Ejemplo n.º 2
0
    public void Start()
    {
        DontDestroyOnLoad(this.gameObject);
        Application.runInBackground = true; // this must run in background or it will drop connection if not focussed.

        if (string.IsNullOrEmpty(this.UserName))
        {
            this.UserName = "******" + Environment.TickCount%99; //made-up username
        }

        chatClient = new ChatClient(this);
        chatClient.Connect(ChatAppId, "1.0", this.UserName, null);

        if (this.AlignBottom)
        {
            this.GuiRect.y = Screen.height - this.GuiRect.height;
        }
        if (this.FullScreen)
        {
            this.GuiRect.x = 0;
            this.GuiRect.y = 0;
            this.GuiRect.width = Screen.width;
            this.GuiRect.height = Screen.height;
        }

        Debug.Log(this.UserName);
    }
Ejemplo n.º 3
0
	public void LoginChat (string username) 
	{
		FindObjectOfType<PartyMatchmaker>().ClearParty();
		chatClient = new ChatClient( this , ExitGames.Client.Photon.ConnectionProtocol.Udp);
		ExitGames.Client.Photon.Chat.AuthenticationValues auth = new ExitGames.Client.Photon.Chat.AuthenticationValues();
		auth.UserId = username;
		chatClient.Connect( appID, "1.0", auth);
	}
Ejemplo n.º 4
0
    public void Start()
    {
        Application.runInBackground = true; // this must run in background or it will drop connection if not focussed.

        if (string.IsNullOrEmpty(this.UserName))
        {
            this.UserName = "******" + Environment.TickCount%99; //made-up username
        }

        chatClient = new ChatClient(this);
        chatClient.Connect(ChatAppId, "1.0", new ExitGames.Client.Photon.Chat.AuthenticationValues(this.UserName));

        if (this.AlignBottom)
        {
            this.GuiRect.y = Screen.height - this.GuiRect.height;
        }
        if (this.FullScreen)
        {
            this.GuiRect.x = 0;
            this.GuiRect.y = 0;
            this.GuiRect.width = Screen.width;
            this.GuiRect.height = Screen.height;
        }

        Debug.Log(this.UserName);
    }
Ejemplo n.º 5
0
 void Start()
 {
     inputToSend = GameObject.Find("InputFieldToSendMessage").GetComponent<InputField>();
     listMessages = new List<string>();
     chatMessage = GameObject.Find("ChatMessage").GetComponent<Text>();
     textToSend = GameObject.Find("TextToSend").GetComponent<Text>();
     AppChatID = "a00e75c3-326c-472a-8f52-4c90184041aa";
     chatClient = new ChatClient(this);
     chatClient.Connect(AppChatID, "1.0", new ExitGames.Client.Photon.Chat.AuthenticationValues(PhotonNetwork.playerName));
 }
Ejemplo n.º 6
0
    // Use this for initialization
    void Start()
    {
        DontDestroyOnLoad(gameObject);
        userInputField.onSubmit.AddListener(OnSubmit);
        chatUsername = "******" + PhotonNetwork.playerList.Length;

        chatClient = new ChatClient(this);
        chatClient.Connect(APP_ID, "0.1", chatUsername, null);
    }