public XmppClientConnection(int connectTimeout = 30000, int port = 5222)
 {
     _dictDataResolveStrategies = InitDictionaries();
     _clientSocket   = InitSocket(connectTimeout);
     _stanzaManager  = new StanzaManager();
     _authenticated  = false;
     _connected      = false;
     _port           = port;
     _messageGrabber = new MessageGrabber(this);
 }
Example #2
0
 public virtual void OnMouseUp(GameObject go)
 {
     if (go.tag == "text")
     {
         if (stanzaManager == null)
         {
             stanzaManager = GameObject.Find("StanzaManager").GetComponent <StanzaManager>();
         }
         if (stanzaManager != null)
         {
             stanzaManager.OnMouseUp(go.GetComponent <TinkerText>());
         }
     }
 }
Example #3
0
 public virtual void OnDragBegin(GameObject go)
 {
     if (go.tag == "text")
     {
         stanzaManager.LoadStanzaXML();
         if (stanzaManager == null)
         {
             stanzaManager = GameObject.Find("StanzaManager").GetComponent <StanzaManager>();
         }
         if (stanzaManager != null)
         {
             Debug.Log("begin  again2");
             stanzaManager.OnDragBegin(go.GetComponent <TinkerText>());
             Debug.Log("begin  again");
         }
     }
 }
        public static string DigestMD5AuthAlgo(string xml, JabberID jid, string password)
        {
            var    realm     = jid.Server;
            var    digestUri = "xmpp/" + jid.Server;
            string uniqData  = StanzaManager.ParseChallenge(xml);
            Regex  reg       = new Regex("nonce=\"[0-9]*\"");
            Match  m         = reg.Match(uniqData);
            string nonce     = string.Empty;

            if (m.Success)
            {
                nonce = m.Groups[0].Value;
                nonce = nonce.Replace("nonce=\"", "").Replace("\"", "");
            }

            string cNonce     = Environment.MachineName; //GetUniqCNonce();
            string clientHash = GenerateClientHash(jid.Username, password, nonce, cNonce, realm, digestUri);
            string value      = GetAuthenticationString(jid.Username, password, nonce, cNonce, clientHash, realm, digestUri);

            string baseResponse = Convert.ToBase64String(Encoding.UTF8.GetBytes(value));

            return(baseResponse);
        }