Example #1
0
    public void Start()
    {
        DontDestroyOnLoad(this.gameObject);
        connexionIndex      = 0;
        this.StateText.text = "";
        this.StateText.gameObject.SetActive(true);
        this.ConnectingLabel.SetActive(false);
        myUserName    = PhotonNetwork.LocalPlayer.NickName;
        this.UserName = myUserName;
        PlayerList    = new string[PhotonNetwork.PlayerList.Length];
        PopulatePlayerList();
        if (string.IsNullOrEmpty(this.UserName))
        {
            this.UserName = "******" + Environment.TickCount % 99;             //made-up username
        }

#if PHOTON_UNITY_NETWORKING
        this.chatAppSettings = PhotonNetwork.PhotonServerSettings.AppSettings.GetChatSettings();
#endif

        bool appIdPresent = !string.IsNullOrEmpty(this.chatAppSettings.AppId);

        this.missingAppIdErrorPanel.SetActive(!appIdPresent);
        //this.UserIdFormPanel.gameObject.SetActive(appIdPresent);

        if (!appIdPresent)
        {
            Debug.LogError("You need to set the chat app ID in the PhotonServerSettings file in order to continue.");
        }

        Connect();
    }
Example #2
0
        public void Start()
        {
            DontDestroyOnLoad(this.gameObject);

            this.UserIdText.text = "";
            this.StateText.text  = "";
            this.StateText.gameObject.SetActive(true);
            this.UserIdText.gameObject.SetActive(true);
            this.Title.SetActive(true);
            this.ChatPanel.gameObject.SetActive(false);
            this.ConnectingLabel.SetActive(false);

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

            #if PHOTON_UNITY_NETWORKING
            this.chatAppSettings = PhotonNetwork.PhotonServerSettings.AppSettings.GetChatSettings();
            #endif

            bool appIdPresent = !string.IsNullOrEmpty(this.chatAppSettings.AppIdChat);

            this.missingAppIdErrorPanel.SetActive(!appIdPresent);
            this.UserIdFormPanel.gameObject.SetActive(appIdPresent);

            if (!appIdPresent)
            {
                Debug.LogError("You need to set the chat app ID in the PhotonServerSettings file in order to continue.");
            }
        }
Example #3
0
    public void ConnectChat(string ID)
    {
        this.userID = ID;


        Debug.Log(PhotonNetwork.PhotonServerSettings.AppSettings.GetChatSettings());
        Debug.Log(PhotonNetwork.PhotonServerSettings.AppSettings.GetChatSettings().AppId);
        Debug.Log(PhotonNetwork.PhotonServerSettings.AppSettings.GetChatSettings().Server);

#if PHOTON_UNITY_NETWORKING
        this.chatAppSettings = PhotonNetwork.PhotonServerSettings.AppSettings.GetChatSettings();
#endif

        bool appIdPresent = !string.IsNullOrEmpty(this.chatAppSettings.AppId);
        if (!appIdPresent)
        {
            Debug.LogError("You need to set the chat app ID in the PhotonServerSettings file in order to continue.");
        }


        this.chatClient = new ChatClient(this);
#if !UNITY_WEBGL
        this.chatClient.UseBackgroundWorkerForSending = true;
#endif
        this.chatClient.AuthValues = new AuthenticationValues(this.userID);
        Debug.Log("Chat authValues: " + chatClient.AuthValues.ToString());
        this.chatClient.ConnectUsingSettings(this.chatAppSettings);
        Debug.Log("Connecting chat as: " + this.userID);
    }
Example #4
0
        public IEnumerator Start()
        {
            m_chatPool = new Pool <ChatElement>(m_chatContentRoot, m_chatElementPrefab.gameObject);
            this.ChatPanel.gameObject.SetActive(false);
            //this.ConnectingLabel.SetActive(false);
            m_webInterface = IOCCore.Resolve <IWebInterface>();
            m_vrMenu       = IOCCore.Resolve <IUserInterface>();

            this.UserName = m_webInterface.UserInfo.name;

#if PHOTON_UNITY_NETWORKING
            this.chatAppSettings = PhotonNetwork.PhotonServerSettings.AppSettings.GetChatSettings();
#endif

            bool appIdPresent = !string.IsNullOrEmpty(this.chatAppSettings.AppId);

            if (!appIdPresent)
            {
                Debug.LogError("You need to set the chat app ID in the PhotonServerSettings file in order to continue.");
            }

            yield return(null);

            m_sendButton.interactable = false;

            Connect();
        }
Example #5
0
    public void Connect()
    {
        this.chatClient = new ChatClient(this);
#if !UNITY_WEBGL
        this.chatClient.UseBackgroundWorkerForSending = true;
#endif
        this.chatClient.AuthValues = new AuthenticationValues(this.nickName);
        ChatAppSettings chatSetting = PhotonNetwork.PhotonServerSettings.AppSettings.GetChatSettings();
        this.chatClient.ConnectUsingSettings(this.chatAppSettings);
    }
Example #6
0
    private void Start()
    {
#if PHOTON_UNITY_NETWORKING
        this.chatAppSettings = PhotonNetwork.PhotonServerSettings.AppSettings.GetChatSettings();
#endif

        bool appIdPresent = !string.IsNullOrEmpty(this.chatAppSettings.AppId);
        if (!appIdPresent)
        {
            Debug.LogError("You need to set the chat app ID in the PhotonServerSettings file in order to continue.");
        }
    }
Example #7
0
    private void Start()
    {
        ///DontDestroyOnLoad(this.gameObject);

        if (string.IsNullOrEmpty(this.UserName))
        {
            this.UserName = "******" + PhotonNetwork.NickName;             //made-up username
        }

#if PHOTON_UNITY_NETWORKING
        this.chatAppSettings = PhotonNetwork.PhotonServerSettings.AppSettings.GetChatSettings();
#endif

        bool appIdPresent = !string.IsNullOrEmpty(this.chatAppSettings.AppId);
        if (!appIdPresent)
        {
            Debug.LogError("You need to set the chat app ID in the PhotonServerSettings file in order to continue.");
        }
    }
Example #8
0
        public void EnableChat()
        {
            channelRoomNames[0] = PhotonNetwork.CurrentRoom.Name;
            appSettings         = PhotonNetwork.PhotonServerSettings.AppSettings.GetChatSettings();
            AuthenticationValues authvals = new AuthenticationValues();

            authvals.UserId   = PhotonNetwork.NickName;
            authvals.AuthType = CustomAuthenticationType.None;
            client            = new ChatClient(this);
            client.AuthValues = authvals;
            client.ChatRegion = "US";
            client.UseBackgroundWorkerForSending = true;
            if (printDebug)
            {
                Debug.Log("connecting to chat as: " + client.AuthValues.UserId);
            }
            client.ConnectUsingSettings(appSettings);
            InRoom     = true;
            ChatActive = true;
        }