static void queryWinLoseSum(OpMgr mgr)
        {
            string retStr = mgr.queryWinLoseSum("2016-05-01", "2016-05-08");

            System.Console.WriteLine("输赢总和1----------------------------");
            System.Console.WriteLine(retStr);

            retStr = mgr.queryWinLoseSum("2016-05-08", "2016-06-08");
            System.Console.WriteLine("输赢总和2----------------------------");
            System.Console.WriteLine(retStr);
        }
        static void playerOp(OpMgr mgr, string playerAcc)
        {
            string retStr = mgr.playerOp(playerAcc, 0);

            Console.WriteLine("停封结果----------------------------");
            Console.WriteLine(retStr);

            retStr = mgr.playerOp(playerAcc, 1);
            Console.WriteLine("解封结果----------------------------");
            Console.WriteLine(retStr);
        }
        static void updatePwd(OpMgr mgr, string playerAcc)
        {
            string retStr = mgr.updatePlayerPwd(playerAcc, "", "654321");

            System.Console.WriteLine("修改密码结果1----------------------------");
            System.Console.WriteLine(retStr);

            retStr = mgr.updatePlayerPwd(playerAcc, "", "123456");
            System.Console.WriteLine("修改密码结果2----------------------------");
            System.Console.WriteLine(retStr);
        }
        static void queryWinLose(OpMgr mgr, string playerAcc)
        {
            string retStr = mgr.queryPlayerWinLose(playerAcc, 0, 0, "2016-04-01", "2016-04-27");

            System.Console.WriteLine("玩家输赢结果1----------------------------");
            System.Console.WriteLine(retStr);

            retStr = mgr.queryPlayerWinLose(playerAcc, 1, 100, "2016-04-01", "2016-04-27");
            System.Console.WriteLine("玩家输赢结果2----------------------------");
            System.Console.WriteLine(retStr);
        }
        static void queryMoneyChange(OpMgr mgr, string playerAcc)
        {
            string retStr = mgr.queryPlayerMoneyChange(playerAcc, 0, 0, "2016-09-07 00:00:00", "2016-09-07 23:59:59");

            System.Console.WriteLine("玩家货币变化结果1----------------------------");
            System.Console.WriteLine(retStr);

            retStr = mgr.queryPlayerMoneyChange(playerAcc, 1, 100, "2016-09-07 00:00:00", "2016-09-07 23:59:59");
            System.Console.WriteLine("玩家货币变化结果2----------------------------");
            System.Console.WriteLine(retStr);

            retStr = mgr.queryPlayerMoneyChange("", 0, 0, "2016-08-01 00:00:00", "2016-08-31 23:59:59");
            System.Console.WriteLine("玩家货币变化结果3----------------------------");
            System.Console.WriteLine(retStr);

            retStr = mgr.queryPlayerMoneyChange("", 1, 100, "2016-08-01 00:00:00", "2016-08-31 23:59:59");
            System.Console.WriteLine("玩家货币变化结果4----------------------------");
            System.Console.WriteLine(retStr);
        }
Exemplo n.º 6
0
        /// <summary>
        /// 释放技能效果
        /// </summary>
        /// <param name="src">效果发起者</param>
        /// <param name="skTarget">技能选择的目标</param>
        /// <param name="target">技能先选择目标后,再次Effect选择后的目标</param>
        /// <param name="skDirectHurt">是否是技能的直接伤害</param>
        /// <param name="container">所有数据展现的容器,本次Effect施法的效果会依次加入</param>
        public void Cast(ServerNPC src, IEnumerable <ServerNPC> skTarget, IEnumerable <ServerNPC> target, bool skDirectHurt, List <MsgParam> container)
        {
            InjuryOp cal = OpMgr.getImplement <InjuryOp>(EffectOp.Injury);

                        #if DEBUG
            Utils.Assert(src == null, "Treat Effect can't find attacker.");
                        #endif

            List <ServerNPC> effTarget = target.ToList();
            int count = effTarget.Count;
            if (count > 0)
            {
                for (int i = 0; i < count; ++i)
                {
                    WarTarAnimParam param = new WarTarAnimParam();

                    ServerNPC     tar = effTarget[i];
                    Treat         dmg = cal.toTargetTreat(src.data, tar.data, cfg);
                    SelfDescribed des = new SelfDescribed()
                    {
                        src       = src.UniqueID,
                        target    = tar.UniqueID,
                        act       = Verb.Recover,
                        srcEnd    = null,
                        targetEnd = new EndResult()
                        {
                            param1 = (int)dmg.treatValue,
                            param2 = dmg.isCritical ? 1 : 0,
                            param3 = (int)dmg.treatType,
                        },
                    };

                    param.OP        = EffectOp.Treat;
                    param.described = des;

                    container.Add(param);
                }
            }
        }
        // 测试前,需要先把 SERVER_DOMAIN.SERVER_DOMAIN  改成正确的IP
        static void Main(string[] args)
        {
            // 假定申请的GM后台账号
            string gmAcc = "ybiaoCNY123z";
            // 假定申请的GM后台账号密码
            string gmPwd = "123456";
            // 假定申请的GM后台接入密钥
            string devKey = "fa4c1529f25e426ea489a88637178d36";

            OpMgr mgr = new OpMgr(gmAcc, gmPwd, devKey);

            // 玩家账号构成,前缀+账号名
            string playerAcc = "123zyb001";
            string retStr    = "";

            retStr = mgr.queryOrderInfo("201605181650367701_aaaaCNY123_123test00");
            System.Console.WriteLine(retStr);

            retStr = mgr.createPlayer(playerAcc, "abc123");
            System.Console.WriteLine("创建玩家结果----------------------------");
            System.Console.WriteLine(retStr);

            retStr = mgr.playerSaveMoney(playerAcc, 500, Guid.NewGuid().ToString().Replace("-", ""), "http://localhost:10747/ApiNotify.aspx");
            System.Console.WriteLine("玩家存款结果----------------------------");
            System.Console.WriteLine(retStr);

            retStr = mgr.playerDrawMoney(playerAcc, 500);
            System.Console.WriteLine("玩家提款结果----------------------------");
            System.Console.WriteLine(retStr);

            retStr = mgr.queryPlayerTradingRecord(playerAcc, 0, 0, 0, "2016-03-01 00:00:00", "2016-03-31 23:59:59");
            System.Console.WriteLine("玩家存取款结果1----------------------------");
            System.Console.WriteLine(retStr);

            retStr = mgr.queryPlayerTradingRecord(playerAcc, 2, 1, 9, "2016-03-01 00:00:00", "2016-03-31 23:59:59");
            System.Console.WriteLine("玩家存取款结果2----------------------------");
            System.Console.WriteLine(retStr);

            retStr = mgr.queryPlayerInfo(playerAcc);
            System.Console.WriteLine("查询玩家信息结果----------------------------");
            System.Console.WriteLine(retStr);

            retStr = mgr.queryPlayerOnline(playerAcc);
            System.Console.WriteLine("查询玩家是否在线----------------------------");
            System.Console.WriteLine(retStr);

            retStr = mgr.logoutPlayer(playerAcc, 600);
            System.Console.WriteLine("登出玩家----------------------------");
            System.Console.WriteLine(retStr);

            retStr = mgr.clearLoginFailed(playerAcc);
            System.Console.WriteLine("清理玩家登录失败次数结果---------------------------");
            System.Console.WriteLine(retStr);

            retStr = mgr.unlockPlayer(playerAcc);
            System.Console.WriteLine("解锁玩家结果---------------------------");
            System.Console.WriteLine(retStr);

            queryMoneyChange(mgr, playerAcc);

            queryWinLose(mgr, playerAcc);

            updatePwd(mgr, playerAcc);

            queryWinLoseSum(mgr);

            playerOp(mgr, playerAcc);
            System.Console.Read();
        }
Exemplo n.º 8
0
        public void Cast(ServerNPC src, IEnumerable <ServerNPC> skTarget, IEnumerable <ServerNPC> target, bool skDirectHurt, List <MsgParam> container)
        {
                        #if DEBUG
            Utils.Assert(src == null, "Injury Effect can't find attacker.");
            Utils.Assert(skCfg == null, "Skill Configure is null in Injury Effect .");
                        #endif

            //发起者的信息
            WarSrcAnimParam SrcParam = new WarSrcAnimParam()
            {
                OP             = EffectOp.Injury,
                ShootAction    = skCfg.ShootAction,
                ShootTime      = skCfg.ShootTime,
                ShootEventTime = skCfg.ShootEventTime,
                //Debug信息
                SkillId = skCfg == null ? -1 : skCfg.ID,
            };

            SelfDescribed SrcDes = new SelfDescribed()
            {
                src       = src.UniqueID,
                target    = src.UniqueID,
                act       = Verb.Punch,
                srcEnd    = null,
                targetEnd = new EndResult()
                {
                    param1 = 0,
                    param2 = 0,
                    param3 = 0,
                    param4 = 0,
                    param8 = skCfg.MissileSpeed,
                    param9 = skCfg.Distance,
                },
            };

            SrcParam.described = SrcDes;

            List <ServerNPC> effTarget = target.ToList();
            int count = effTarget.Count;
            //如果没有目标的时候
            if (count == 0)
            {
                SrcParam.InjureTar = null;
                //新建一个目标为空的序列,主要告知skCfg.MissileSpeed 和 skCfg.Distance
                //该技能没有目标去命中
                container.Add(SrcParam);
                return;
            }
            //如果存在目标的时候
            InjuryOp cal = OpMgr.getImplement <InjuryOp>(EffectOp.Injury);

            List <ServerNPC> skillTarget = skTarget.ToList();

            ///
            /// ---- 获取主目标
            ///
            int MainTargetID = 0;
            int skcount      = skillTarget.Count;
            if (skcount > 0)
            {
                ServerNPC npc = skillTarget[0];
                MainTargetID = npc.UniqueID;
            }

            //count 必定 > 0
            //如果是技能直接的伤害
            if (skDirectHurt)
            {
                WarTarAnimParam[] TarList = new WarTarAnimParam[count];

                for (int i = 0; i < count; ++i)
                {
                    WarTarAnimParam TarParam = new WarTarAnimParam()
                    {
                        OP        = EffectOp.Injury,
                        HitAction = cfg.HitAction,
                        SkillId   = skCfg.ID,
                    };

                    ServerNPC     tar = effTarget[i];
                    Dmg           dmg = cal.toTargetDmg(src.data, tar.data, cfg);
                    SelfDescribed des = new SelfDescribed()
                    {
                        src       = src.UniqueID,
                        target    = tar.UniqueID,
                        act       = Verb.Punch,
                        srcEnd    = null,
                        targetEnd = new EndResult()
                        {
                            param1 = (int)dmg.dmgValue,
                            param2 = dmg.isCritical ? 1 : 0,
                            param3 = (int)dmg.dmgType,
                            param4 = (int)dmg.hitCls,
                            param5 = MainTargetID,
                            param8 = skCfg.MissileSpeed,
                            param9 = skCfg.Distance,
                        },
                    };
                    TarParam.described = des;

                    TarList[i] = TarParam;
                }

                SrcParam.InjureTar = TarList;
                container.Add(SrcParam);
            }
            else
            {
                container.Add(SrcParam);
                //如果不是技能的伤害,而是buff或者Trigger的伤害
                for (int i = 0; i < count; ++i)
                {
                    WarTarAnimParam TarParam = new WarTarAnimParam()
                    {
                        OP        = EffectOp.Injury,
                        HitAction = cfg.HitAction,
                        SkillId   = skCfg.ID,
                    };

                    ServerNPC     tar = effTarget[i];
                    Dmg           dmg = cal.toTargetDmg(src.data, tar.data, cfg);
                    SelfDescribed des = new SelfDescribed()
                    {
                        src       = src.UniqueID,
                        target    = tar.UniqueID,
                        act       = Verb.Punch,
                        srcEnd    = null,
                        targetEnd = new EndResult()
                        {
                            param1 = (int)dmg.dmgValue,
                            param2 = dmg.isCritical ? 1 : 0,
                            param3 = (int)dmg.dmgType,
                            param4 = (int)dmg.hitCls,
                            param5 = MainTargetID,
                            param8 = skCfg.MissileSpeed,
                            param9 = skCfg.Distance,
                        },
                    };

                    TarParam.described = des;

                    container.Add(TarParam);
                }
            }
        }