Exemplo n.º 1
0
        public void init(sendQQGroupMsgHandler _outputMessage, getQQNickHandler _getQQNick, string _path)
        {
            outputMessage = _outputMessage;
            getQQNick     = _getQQNick;
            path          = _path;

            users = new Dictionary <long, BTCUser>();
            // read users
            // wallet
            var lines = FileIOActor.readLines(path + walletf);

            foreach (var line in lines)
            {
                BTCWallet wallet = new BTCWallet(line);
                if (wallet.uid > 0)
                {
                    // success
                    if (!users.ContainsKey(wallet.uid))
                    {
                        users[wallet.uid] = new BTCUser(wallet.uid);
                    }
                    users[wallet.uid]._wallet = wallet;
                }
            }
            // benefit
            lines = FileIOActor.readLines(path + benefitf);
            foreach (var line in lines)
            {
                BTCBenefit benefit = new BTCBenefit(line);
                if (benefit.uid > 0)
                {
                    // success
                    if (!users.ContainsKey(benefit.uid))
                    {
                        users[benefit.uid] = new BTCUser(benefit.uid);
                    }
                    users[benefit.uid]._benefit = benefit;
                }
            }
        }
Exemplo n.º 2
0
        //public BTCUser()
        //{
        //    qq = -1;
        //    wallet = new BTCWallet();
        //    benefit = new BTCBenefit();
        //}

        public BTCUser(long _qq)
        {
            qq       = _qq;
            _wallet  = new BTCWallet(qq);
            _benefit = new BTCBenefit(qq);
        }