示例#1
0
        public Form1()
        {
            InitializeComponent();
            irc = new TwitchIRC();
            irc.Connect();
            irc.NewMessage += irc_NewMessage;
            TransparencyKey = Color.BlueViolet;
            //this.BackColor = Color.BlueViolet;

            this.TopMost   = true;
            textBox3.Text  = yMine.ToString();
            textBox4.Text  = xMine.ToString();
            textBox1.Text  = Properties.Settings.Default.tb1;
            textBox2.Text  = Properties.Settings.Default.tb2;
            tbChannel.Text = Properties.Settings.Default.channel;

            pntr1 = ConvertStringToPoint(textBox1.Text);
            pntr2 = ConvertStringToPoint(textBox2.Text);
        }
示例#2
0
    public IEnumerator SaveRoutine()
    {
        twichIRC.Disconnect();
        yield return(new WaitForEndOfFrame());

        twichIRC.details.oauth = token.text;
        PlayerPrefs.SetString("oauth", token.text);
        twichIRC.details.nick = nickname.text;
        PlayerPrefs.SetString("nickname", nickname.text);
        twichIRC.details.channel = channel.text;
        PlayerPrefs.SetString("channel", channel.text);
        messageSender.MessageBox = messageBoxSelector.selected;
        PlayerPrefs.SetString("msgBox", messageBoxSelector.selected.gameObject.name);
        messageBoxSelector.selected.gameObject.SetActive(true);
        PlayerPrefs.SetString("chroma", string.Format("{0}|{1}|{2}", Camera.main.backgroundColor.r.ToString(),
                                                      Camera.main.backgroundColor.g.ToString(),
                                                      Camera.main.backgroundColor.b.ToString()));
        yield return(new WaitForEndOfFrame());

        twichIRC.Connect();
        yield return(new WaitForEndOfFrame());

        Close();
    }
示例#3
0
	public void ConnectTwitchIRC()
	{
		bool error = false;
		if (string.IsNullOrEmpty(m_StreamName))
		{
			error = true;
			StreamNameUI.CrossFadeColor(Color.red, 0.5f, true, false);
		}
		if (string.IsNullOrEmpty(m_Username))
		{
			error = true;
			UsernameUI.CrossFadeColor(Color.red, 0.5f, true, false);
		}
		if (string.IsNullOrEmpty(m_OAuthToken))
		{
			error = true;
			OAuthTokenUI.CrossFadeColor(Color.red, 0.5f, true, false);
		}

		if (!error)
		{
			if (m_TwitchIRC != null)
			{
				DestroyImmediate(m_TwitchIRC.gameObject);
			}
			GameObject twitchObj = new GameObject("TwitchIRC");
			m_TwitchIRC = twitchObj.AddComponent<TwitchIRC>();
			m_TwitchIRC.ConnectedEvent += HandleTwitchIRCConnected;
			m_TwitchIRC.ConnectErrorEvent += HandleConnectErrorEvent;
			m_TwitchIRC.StreamName = m_StreamName;
			m_TwitchIRC.Username = m_Username;
			m_TwitchIRC.OAuthToken = m_OAuthToken;
			
			Object.DontDestroyOnLoad(twitchObj);

			m_TwitchIRC.Connect();
		}
	}