Пример #1
0
 void Connect(string channelUrl)
 {
     Debug.Log("Connect to " + channelUrl);
     ResetContent();
     Jiver.Join(channelUrl);
     Jiver.Connect(50);
 }
Пример #2
0
    void ConnectToJiver()
    {
        if (UserMgr.Schedule != null)
        {
            Debug.Log("Connecting");
            ClearList();
            Debug.Log("Cleared");
            string appId = "1C0C2894-E73D-4711-B9A0-A55C2C4DEBF6";
            //		string userId = SystemInfo.deviceUniqueIdentifier;
            string userName = UserMgr.UserInfo.memberName;
            string userId   = userName;
            //		string channelUrl = DEFAULT_CHANNEL;

            Jiver.Init(appId);
            Debug.Log("Init");
            Jiver.Login(userId, userName);
            Debug.Log("Login");
            string channelUrl1 = DEFAULT_CHANNEL
                                 + UserMgr.Schedule.extend [0].teamCode + UserMgr.Schedule.extend [1].teamCode;
            string channelUrl2 = DEFAULT_CHANNEL
                                 + UserMgr.Schedule.extend [1].teamCode + UserMgr.Schedule.extend [0].teamCode;
            Debug.Log(channelUrl1 + "," + channelUrl2);
            Jiver.Join(channelUrl1, channelUrl2);
            Debug.Log("Join");
            Jiver.QueryChannelList(false);
            Debug.Log("List");
        }
    }
Пример #3
0
 void Submit()
 {
     if (inputString.Length > 0)
     {
         Jiver.SendMessage(inputString);
         inputString = "";
     }
 }
Пример #4
0
 void Submit()
 {
     if (inputMessage.text.Length > 0)
     {
         Jiver.SendMessage(inputMessage.text);
         inputMessage.text = "";
         ScrollToBottom();
     }
 }
Пример #5
0
    void Start()
    {
        string appId      = "A7A2672C-AD11-11E4-8DAA-0A18B21C2D82";
        string userId     = SystemInfo.deviceUniqueIdentifier;
        string userName   = "******" + userId.Substring(0, 5);
        string channelUrl = "jia_test.Unity3d";

        Jiver.Init(appId);
        Jiver.Login(userId, userName);
        Jiver.Join(channelUrl);
        Jiver.Connect();
    }
Пример #6
0
    void Start()
    {
//		API Token: 95a9676a5e8d1dd421aad0a4e3d6c203752362e4
        string appId      = "1C0C2894-E73D-4711-B9A0-A55C2C4DEBF6";
        string userId     = SystemInfo.deviceUniqueIdentifier;
        string userName   = "******" + userId.Substring(0, 5);
        string channelUrl = "Liveballchat.KTHH";


        Jiver.Init(appId);
        Jiver.Login(userId, userName);
        Jiver.Join(channelUrl);
        Jiver.Connect();
    }
Пример #7
0
    void DrawChannels(float width, float height)
    {
        return;

        int columns  = 4;
        int rowCount = (int)Mathf.Ceil((float)channels.Count / (float)columns);

        float rowWidth     = width - scrollBarWidth - 1;
        float buttonHeight = LINE_HEIGHT * 2f;
        float buttonWidth  = rowWidth / columns;

        float totalHeight = Mathf.Max(height, buttonHeight * rowCount);

        channelScrollViewVector = GUI.BeginScrollView(new Rect(0, 0, width, height), channelScrollViewVector, new Rect(0, 0, rowWidth, totalHeight), false, true);

        for (int i = 0; i < channels.Count; i++)
        {
            float   buttonLeft = i % columns * buttonWidth;
            float   buttonTop  = (i / columns) * buttonHeight;
            Channel channel    = channels[i];

            if (selectedChannelUrl == channel.GetUrl())
            {
                Color c = GUI.backgroundColor;
                GUI.backgroundColor = Color.green;
                if (GUI.Button(new Rect(buttonLeft, buttonTop, buttonWidth, buttonHeight), "#" + channel.GetUrlWithoutAppPrefix()))
                {
                    tabMode = TAB_MODE.CHAT;
                }
                GUI.backgroundColor = c;
            }
            else
            {
                if (GUI.Button(new Rect(buttonLeft, buttonTop, buttonWidth, buttonHeight), "#" + channel.GetUrlWithoutAppPrefix()))
                {
                    Jiver.Join(channel.GetUrl());
                    Jiver.Connect();
                    messages.Clear();
                    tabMode     = TAB_MODE.CHAT;
                    channelName = "Connecting...";
                }
            }
        }
        GUI.EndScrollView();
    }
Пример #8
0
    void DrawTabs(float width, float height)
    {
        if (GUI.Button(new Rect(0, 0, width * 0.5f, height), channelName))
        {
            tabMode = TAB_MODE.CHAT;
        }

        if (GUI.Button(new Rect(width * 0.5f, 0, width * 0.5f, height), "Channels"))
        {
            if (tabMode == TAB_MODE.CHAT)
            {
                tabMode = TAB_MODE.CHANNEL;
                Jiver.QueryChannelList();
            }
            else
            {
                tabMode = TAB_MODE.CHAT;
            }
        }
    }
Пример #9
0
 void OpenChannelList()
 {
     channelPanel.SetActive(true);
     Jiver.QueryChannelList();
 }