Ejemplo n.º 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;
        }
Ejemplo n.º 2
0
        public void NotifyCreate(CreateSpeMonsterNotifier _this)
        {
            var timed = _this.GetTimed();

            //通知各服务器生成boss
            CoroutineFactory.NewCoroutine(NotifyCreateCoroutine, _this).MoveNext();
            SpeMonsterManager.AddToCurAvailableDealers(timed);

            SpeMonsterManager.CreateMonsterDealers.Delete(timed.Handle);
            timed.TargetTime = _this.Config.UseNextTime();
            SpeMonsterManager.CreateMonsterDealers.Add(ref timed.Handle, timed);
        }
Ejemplo n.º 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);
        }