Ejemplo n.º 1
0
        private void SendRandomMessage()
        {
            Message msg = new Message(
                m_usernames[UnityEngine.Random.Range(0, m_usernames.Count)], m_randomMessages[UnityEngine.Random.Range(0, m_randomMessages.Count)]
                , GetTimestamp(DateTime.Now), Platform.Mockup
                );

            ChatAPI.NotifyNewMessageToListeners(msg);
        }
Ejemplo n.º 2
0
        private IEnumerator SendTimeToAllUsers()
        {
            while (true)
            {
                DateTime now = Message.CreateFromTimestamp();
                Message  msg = new Message("Game Admin", "Server time: " + now.ToString("hh:mm:ss"), Message.GetCurrentTimeUTC(), Platform.Game);

                ChatAPI.SendMessageToEveryUsers(msg);

                yield return(new WaitForSeconds(_sendTimeEvery));
            }
        }
        private void SendWhisperToUser(string userToWhisper, string theWhisper)
        {
            Message whisper = new Message(userToWhisper, theWhisper, Message.GetCurrentTimeUTC(), Platform.Game);

            ChatAPI.SendMessageToUser(userToWhisper, Platform.Twitch, whisper);
        }
        private void Start()
        {
            StartCoroutine(SendTimeToAllUsers());

            ChatAPI.AddListener(CheckForUserAskingTime);
        }
 public override void OnInspectorGUI()
 {
     base.OnInspectorGUI();
     DisplayLastMessages(ChatAPI.GetLastMessages(20));
 }