Esempio n. 1
0
        void hashd_OnMessage(object sender, Hashd.HashdMessageEventArgs e)
        {
            if (e.Message.User.ToLower() == hashd.User)
                return;

            SendMessage(new UbiMessage(String.Format("{0}", e.Message.Text), EndPoint.Hashd, EndPoint.SteamAdmin) 
            { 
                FromName = e.Message.User,
                NickColor = settings.hashdNickColor,
                TextOnly = false

            });
        }
Esempio n. 2
0
        private void ConnectHashd()
        {
            if (isClosing)
                return; 
            if (!settings.hashdEnabled ||
                String.IsNullOrEmpty(settings.hashdUser) ||
                String.IsNullOrEmpty(settings.hashdPassword))
                return;
            hashd = new Hashd(settings.hashdUser, settings.hashdPassword);
            hashd.Live += new EventHandler<EventArgs>(hashd_Live);
            hashd.Offline += new EventHandler<EventArgs>(hashd_Offline);
            hashd.OnLogin += new EventHandler<EventArgs>(hashd_OnLogin);
            hashd.OnMessage += new EventHandler<Hashd.HashdMessageEventArgs>(hashd_OnMessage);

            if (!hashd.Login())
            {
                SendMessage(new UbiMessage("Hashd: login failed!", EndPoint.Hashd, EndPoint.Error));
            }
            else
            {
                hashd.Start();
            }
        }