Пример #1
0
        public IEnumerator OnServerStart(Coroutine co, ActivityService _this)
        {
            //Thread.Sleep(10000);
            ActivityServer.Instance.Start(_this);
            SpeMonsterManager.Init();
            WorldBossManager.Init();
            InAppPurchase.Init();
            MieShiManager.Init();
            BossHomeManager.Init();
            AcientBattleManager.Init();
            GeneralActivityManager.Init();
            ServerMysteryStoreManager.Init();
            ServerBlackStoreManager.Init();
            ActivityServer.Instance.IsReadyToEnter = true;
            ChickenManager.Init();
            _this.TickDuration = ActivityServerControl.Performance;

            var __this = (ActivityServerControl)_this;

            __this.payDbManagerManager.Init(_this);
            __this.WebRequestManager = new RequestManager(__this);
            var timesp       = DateTime.Now - DateTime.Parse("1970-1-1");
            var milliseconds = timesp.TotalMilliseconds;

            __this.udidSeed = (long)milliseconds % 100000000000L;
            __this.Started  = true;

            yield break;
        }
Пример #2
0
        public IEnumerator ApplyBossHome(Coroutine coroutine, ActivityCharacterProxy _this, ApplyBossHomeInMessage msg)
        {
            var bossDieDic = BossHomeManager.RefreshBossHomeData(msg.Request.ServerId);

            msg.Response.Data.AddRange(bossDieDic);
            msg.Reply((int)ErrorCodes.OK);
            yield break;
        }
Пример #3
0
        public IEnumerator QueryCreateMonsterData(Coroutine co,
                                                  ActivityService _this,
                                                  QueryCreateMonsterDataInMessage msg)
        {
            bool isBossHome = false;

            Table.ForeachBossHome(record =>
            {
                if (record.Scene == msg.Request.SceneId)
                {
                    isBossHome = true;
                    return(false);
                }
                return(true);
            });
            if (isBossHome)
            {
                var        tmp = BossHomeManager.RefreshBossHomeData(msg.Request.ServerId);
                Int32Array ret = new Int32Array();
                foreach (var v in tmp)
                {
                    if (v.Value == 0)
                    {
                        var tb = Table.GetBossHome(v.Key);
                        if (tb != null)
                        {
                            ret.Items.Add(tb.SceneNpcId);
                        }
                    }
                }
                msg.Response = ret;
            }
            else
            {
                msg.Response = SpeMonsterManager.GetCreateMonsterData(msg.Request.ServerId, msg.Request.SceneId);
            }
            msg.Reply();
            yield return(null);
        }
Пример #4
0
 public IEnumerator BossHomeSceneRequest(Coroutine coroutine, ActivityService _this, BossHomeSceneRequestInMessage msg)
 {
     BossHomeManager.OnBossDie(msg.Request.ServerId, msg.Request.NpcId);
     msg.Reply((int)ErrorCodes.OK);
     yield return(null);
 }