Пример #1
0
        public override async Task <string> HandleMessage(WebSocketConnection connection, BinaryReader reader)
        {
            int count = Math.Min(reader.ReadInt32(), 256);


            for (int i = 0; i < count; i++)
            {
                Guid targetID = ReadMinecraftUUIDFromBinaryReader(reader);

                PubSubManager.Subscribe(targetID, connection.playerID, connection);
                Logger.LogMessage("Subscribing user " + connection.playerID + " to " + targetID);
            }

            return(string.Empty);
        }
Пример #2
0
        private void subscribeToolStripMenuItem_Click(object sender, EventArgs e)
        {
            // subscibe to a node
            var pNode = treeNodes.SelectedNode as DiscoNode;

            if (pNode != null)
            {
                var myBareJid = new Jid {
                    User = XmppClient.Username, Server = XmppClient.XmppDomain
                };
                _pm.Subscribe(cboService.Text,
                              pNode.Node,
                              myBareJid,
                              SubscribeResult, pNode.Node);
            }
        }
Пример #3
0
 public void Subscribe(string node, OnXmppMsgHandler handler)
 {
     m_psMgr.OnEvent += new EventHandler <MessageEventArgs>(handler);
     m_psMgr.Subscribe(m_psJid, node, m_user + "@" + m_server, new EventHandler <IqEventArgs>(OnSubscribe));
     m_subNH.Add(new SubNodeHandler(node, handler));
 }
Пример #4
0
 public void Subscribe(string key)
 {
     pubSubMan.Subscribe(key, this);
 }