void Connect(string channelUrl)
 {
     Debug.Log("Connect to " + channelUrl);
     ResetContent();
     Jiver.Join(channelUrl);
     Jiver.Connect(50);
 }
Beispiel #2
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();
    }
Beispiel #3
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();
    }
Beispiel #4
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();
    }