コード例 #1
0
        private void OnPushMessage(PushMessage msg)
        {
            var res    = FollowerPackageModule.GetFollowerPackages();
            var resId  = res.Followers.Select(x => x.Id);
            var result = msg.FollowerList.Where(x => resId.Contains(x.Value)).Select(x => res.GetFollowerById(x.Value, x.Key));
            var ftres  = msg.FightFollowerList.Where(x => resId.Contains(x));

            SyncPlayerInfo(result.ToList(), ftres.ToList(), msg.Exp, msg.Money);

            foreach (var obj in PlayerObject.Instance.Self.AllFollower.Followers)
            {
                FollowerObjectManager.Instance.AddObj(obj.ObjectId, obj);
            }
            MessageManager.SendMessage("MessageManager.Login.Success");
        }
コード例 #2
0
ファイル: Program.cs プロジェクト: sgww/cozy
        static void Main(string[] args)
        {
            ModuleManager.Instance.Init();

            var FollowerLevelModule   = ModuleManager.Instance.GetModule("FollowerLevelModule");
            var FollowerModule        = ModuleManager.Instance.GetModule("FollowerModule");
            var FollowerStarModule    = ModuleManager.Instance.GetModule("FollowerStarModule");
            var FollowerCollectModule = ModuleManager.Instance.GetModule("FollowerCollectModule");

            var follower = new Follower()
            {
                CurStar  = 1,
                CurLevel = 2,
            };

            //-------------------------FollowerLevelModule-------------------------------
            Console.WriteLine((FollowerLevelModule.CallFunc("CanUpgrade", follower)[0].ToString()));
            Console.WriteLine(((Package)FollowerLevelModule.CallFunc("UpgradeRequire", follower)[0]).Exp);
            Console.WriteLine(FollowerLevelModule.CallFunc("Upgrade", follower)[0].ToString());
            Console.WriteLine(((Package)FollowerLevelModule.CallFunc("UpgradeRequire", follower)[0]).Exp);

            //-------------------------FollowerModule------------------------------------
            Console.WriteLine(FollowerModule.CallFunc("GetAttack", follower)[0].ToString());

            //-------------------------FollowerModule------------------------------------
            Console.WriteLine(follower.CurStar + " " + follower.CurLevel);
            Console.WriteLine(FollowerStarModule.CallFunc("CanUpgrade", follower)[0].ToString());
            follower.CurLevel = 31;
            Console.WriteLine(FollowerStarModule.CallFunc("CanUpgrade", follower)[0].ToString());
            Console.WriteLine(((Package)FollowerStarModule.CallFunc("UpgradeRequire", follower)[0]).Exp);
            Console.WriteLine(((Package)FollowerStarModule.CallFunc("UpgradeRequire", follower)[0]).Money);
            Console.WriteLine(FollowerStarModule.CallFunc("Upgrade", follower)[0].ToString());
            Console.WriteLine(follower.CurStar + " " + follower.CurLevel);

            FollowerCollect fc = new FollowerCollect()
            {
                Followers = new List <Follower>()
            };

            fc.Followers.Add(follower);
            Console.WriteLine(FollowerCollectModule.CallFunc("GetAttack", fc)[0].ToString());

            var packages = FollowerPackageModule.GetFollowerPackages();

            Console.ReadKey();
        }
コード例 #3
0
        private void OnHireResultMessage(HireResultMessage msg)
        {
            var res = FollowerPackageModule.GetFollowerPackages();

            if (msg.Result == OkTag)
            {
                foreach (var obj in msg.Followers)
                {
                    var follower = res.GetFollowerById(obj.Value, obj.Key);
                    PlayerObject.Instance.Self.AllFollower.Followers.Add(follower);
                    FollowerObjectManager.Instance.AddObj(follower.ObjectId, follower);
                }
                MessageManager.SendMessage("Message.HireFollower.Success");
            }
            else
            {
                MessageManager.SendMessage("Message.HireFollower.Failed");
            }
        }