コード例 #1
0
ファイル: WhatsApp.cs プロジェクト: MrSiir/WhatsAPINet
        //array("sec" => 2, "usec" => 0);
        public WhatsApp(string phoneNum, string imei, string nick, bool debug = false)
        {
            this.messageQueue = new List<ProtocolTreeNode>();
            //this.sysEncoding = Encoding.GetEncoding("ISO-8859-1");
            //this.challengeArray = new Dictionary<string, string>();

            this.phoneNumber = phoneNum;
            this.imei = imei;
            this.name = nick;
            WhatsApp.DEBUG = debug;
            string[] dict = DecodeHelper.getDictionary();
            this.writer = new BinTreeNodeWriter(dict);
            this.reader = new BinTreeNodeReader(dict);

            //this.loginStatus = disconnectedStatus;
            this.loginStatus = CONNECTION_STATUS.DISCONNECTED;

            //this.whatsNetwork = new WhatsNetwork(WhatsConstants.WhatsAppHost, WhatsConstants.WhatsPort, this.sysEncoding, this.timeout);
            //this.WhatsParser = new WhatsParser(this.whatsNetwork);
            this.whatsNetwork = new WhatsNetwork(WhatsConstants.WhatsAppHost, WhatsConstants.WhatsPort, this.timeout);
            this.WhatsParser = new WhatsParser(this.whatsNetwork, this.writer);
            this.WhatsSendHandler = this.WhatsParser.WhatsSendHandler;

            _incompleteBytes = new List<IncompleteMessageException>();
        }
コード例 #2
0
ファイル: WhatsAppBase.cs プロジェクト: badr19/WhatsAPINet
 protected void _constructBase(string phoneNum, string imei, string nick, bool debug, bool hidden)
 {
     this.messageQueue = new List<ProtocolTreeNode>();
     this.phoneNumber = phoneNum;
     this.password = imei;
     this.name = nick;
     this.hidden = hidden;
     WhatsApp.DEBUG = debug;
     this.reader = new BinTreeNodeReader();
     this.loginStatus = CONNECTION_STATUS.DISCONNECTED;
     this.BinWriter = new BinTreeNodeWriter();
     this.whatsNetwork = new WhatsNetwork(WhatsConstants.WhatsAppHost, WhatsConstants.WhatsPort, this.timeout);
 }
コード例 #3
0
 protected void _constructBase(string phoneNum, string imei, string nick, bool debug, bool hidden)
 {
     this.messageQueue = new List <ProtocolTreeNode>();
     this.phoneNumber  = phoneNum;
     this.password     = imei;
     this.name         = nick;
     this.hidden       = hidden;
     WhatsApp.DEBUG    = debug;
     this.reader       = new BinTreeNodeReader();
     this.loginStatus  = CONNECTION_STATUS.DISCONNECTED;
     this.BinWriter    = new BinTreeNodeWriter();
     this.whatsNetwork = new WhatsNetwork(WhatsConstants.WhatsAppHost, WhatsConstants.WhatsPort, this.timeout);
 }
コード例 #4
0
ファイル: WhatsApp.cs プロジェクト: tanhaiwang/WhatsAPINet
        /// <summary>
        /// Default class constructor
        /// </summary>
        /// <param name="phoneNum">The phone number</param>
        /// <param name="imei">The imei / mac</param>
        /// <param name="nick">User nickname</param>
        /// <param name="debug">Debug on or off, false by default</param>
        public WhatsApp(string phoneNum, string imei, string nick, bool debug = false)
        {
            this.messageQueue = new List <ProtocolTreeNode>();
            this.phoneNumber  = phoneNum;
            this.imei         = imei;
            this.name         = nick;
            WhatsApp.DEBUG    = debug;
            string[] dict = DecodeHelper.getDictionary();
            this.writer           = new BinTreeNodeWriter(dict);
            this.reader           = new BinTreeNodeReader(dict);
            this.loginStatus      = CONNECTION_STATUS.DISCONNECTED;
            this.whatsNetwork     = new WhatsNetwork(WhatsConstants.WhatsAppHost, WhatsConstants.WhatsPort, this.timeout);
            this.WhatsParser      = new WhatsParser(this.whatsNetwork, this.writer);
            this.WhatsSendHandler = this.WhatsParser.WhatsSendHandler;

            _incompleteBytes = new List <IncompleteMessageException>();
        }
コード例 #5
0
        //array("sec" => 2, "usec" => 0);
        public WhatsApp(string phoneNum, string imei, string nick, bool debug = false)
        {
            this.messageQueue   = new List <ProtocolTreeNode>();
            this.sysEncoding    = Encoding.GetEncoding("ISO-8859-1");
            this.challengeArray = new Dictionary <string, string>();

            this.phoneNumber = phoneNum;
            this.imei        = imei;
            this.name        = nick;
            this.debug       = debug;
            string[] dict = DecodeHelper.getDictionary();
            this.writer = new BinTreeNodeWriter(dict);
            this.reader = new BinTreeNodeReader(dict);

            this.loginStatus = disconnectedStatus;

            this.whatsNetwork     = new WhatsNetwork(WhatsConstants.WhatsAppHost, WhatsConstants.WhatsPort, this.sysEncoding, this.timeout);
            this.WhatsParser      = new WhatsParser(this.whatsNetwork);
            this.WhatsSendHandler = this.WhatsParser.WhatsSendHandler;
        }
コード例 #6
0
 /// <summary>
 /// Default class constructor
 /// </summary>
 /// <param name="net">An instance of the WhatsNetwork class</param>
 /// <param name="writer">An instance of the BinTreeNodeWriter</param>
 internal WhatsSendHandler(WhatsNetwork net, BinTreeNodeWriter writer)
 {
     this.whatsNetwork = net;
     this.BinWriter = writer;
 }
コード例 #7
0
 /// <summary>
 /// Default class constructor
 /// </summary>
 /// <param name="net">An instance of the WhatsNetwork class</param>
 /// <param name="writer">An instance of the BinTreeNodeWriter</param>
 internal WhatsSendHandler(WhatsNetwork net, BinTreeNodeWriter writer)
 {
     this.whatsNetwork = net;
     this._binWriter   = writer;
 }
コード例 #8
0
ファイル: WhatsApp.cs プロジェクト: hermanho/WhatsAPINet
        /// <summary>
        /// Default class constructor
        /// </summary>
        /// <param name="phoneNum">The phone number</param>
        /// <param name="imei">The imei / mac</param>
        /// <param name="nick">User nickname</param>
        /// <param name="debug">Debug on or off, false by default</param>
        public WhatsApp(string phoneNum, string imei, string nick, bool debug = false, bool hidden = false)
        {
            this.messageQueue = new List<ProtocolTreeNode>();
            this.phoneNumber = phoneNum;
            this.imei = imei;
            this.name = nick;
            this.hidden = hidden;
            WhatsApp.DEBUG = debug;
            this.reader = new BinTreeNodeReader();
            this.loginStatus = CONNECTION_STATUS.DISCONNECTED;
            this.whatsNetwork = new WhatsNetwork(WhatsConstants.WhatsAppHost, WhatsConstants.WhatsPort, this.timeout);
            this.WhatsParser = new WhatsParser(this.whatsNetwork, new BinTreeNodeWriter());
            this.WhatsSendHandler = this.WhatsParser.WhatsSendHandler;

            _incompleteBytes = new List<IncompleteMessageException>();
        }
コード例 #9
0
 //this.Login.domain ??
 public WhatsSendHandler(WhatsNetwork net)
 {
     //this.TreeNodeWriter = new BinTreeNodeWriter(DecodeHelper.getDictionary());
     this.whatsNetwork = net;
 }
コード例 #10
0
 //this.Login.domain ??
 //public WhatsSendHandler(WhatsNetwork net)
 internal WhatsSendHandler(WhatsNetwork net, BinTreeNodeWriter writer)
 {
     //this.TreeNodeWriter = new BinTreeNodeWriter(DecodeHelper.getDictionary());
     this.whatsNetwork = net;
     this._binWriter = writer;
 }
コード例 #11
0
 //this.Login.domain ??
 public WhatsSendHandler(WhatsNetwork net)
 {
     //this.TreeNodeWriter = new BinTreeNodeWriter(DecodeHelper.getDictionary());
     this.whatsNetwork = net;
 }