Ejemplo n.º 1
0
        public static bool SendZBJGBlueItem(string KeyString, DBLogger logger)
        {
            if (string.IsNullOrWhiteSpace(KeyString))
            {
                logger.Add("关键字为空");
                return true;
            }

            string receiver = SpyDB.GetParam("2");
            if (string.IsNullOrWhiteSpace(receiver))
            {
                logger.Add("收件人为空");
                return true;
            }

            logger.Add(string.Format("开始发送名称中包含{0}的蓝色物品到{1}", KeyString, receiver));
            if (!SpyFrame.lua_SendBlueItemByName(receiver, KeyString))
            {
                logger.Add(string.Format("发{0}给{1},失败了", KeyString, receiver));
                return false;
            }
            return true;
        }
Ejemplo n.º 2
0
        public static bool SendMain(DBLogger logger, Boolean FullStack)
        {
            // 每次都从数据库读一次邮件列表
            Dictionary<string, string> _mail = SpyDB.GetMailList();
            if (_mail.Count == 0)
            {
                logger.Add("数据库获取邮件列表失败");
                return false;
            }
            Dictionary<string, int> bag = SpyFrame.lua_GetBagInfo();
            if (bag.Count == 0)
            {
                logger.Add("背包内容为空");
                return true;
            }

            logger.Add("整理背包");
            SpyFrame.lua_RepackBag();
            Thread.Sleep(5000);

            logger.Add("开始发送邮件");
            foreach (KeyValuePair<string, string> mail in _mail)
            {
                //logger.Add(string.Format("开始发送{0}到{1}", mail.Key, mail.Value));
                if (bag.ContainsKey(mail.Key))
                {
                    logger.Add(string.Format("开始发送{0}到{1}", mail.Key, mail.Value));
                    if (!SpyFrame.lua_SendItemByName(mail.Value, mail.Key, FullStack))
                    {
                        logger.Add(string.Format("发{0}给{1},失败了", mail.Value, mail.Key));
                        return false;
                    }
                }
                else
                {
                    //logger.Add(string.Format("背包中没有{0}", mail.Key));
                }
            }
            return true;
        }