Beispiel #1
0
 /// <summary>
 /// 通知逻辑服,场景结束
 /// </summary>
 /// <param name="evt"></param>
 protected virtual void NotifyAllLogicsGameOver(DeepCore.GameData.Zone.GameOverEvent evt)
 {
     node.ForEachPlayers((p) =>
     {
         var player = p.Client as AreaZonePlayer;
         player.DoGameOver(evt);
     });
 }
Beispiel #2
0
 protected virtual void Z_OnGameOver(InstanceZone zone, DeepCore.GameData.Zone.GameOverEvent evt)
 {
     zoneGameOver = true;
     //log.Info("ZoneNode GameOver : " + evt.message + " " + this.ZoneUUID);
     //notify logic.
     NotifyAllLogicsGameOver(evt);
     //notify areamanager close zone.
     service.area_manager.Invoke(new AreaZoneGameOverNotify()
     {
         zoneUUID = this.ZoneUUID,
         reason   = evt.message,
     });
 }
Beispiel #3
0
 protected virtual void CheckZoneDispose(EditorScene z, TimeTaskMS t)
 {
     if (CheckNeedKeepPlayer(z))
     {
         zoneGameOver       = false;
         keepPlayerLastTick = DateTime.Now;
     }
     else if ((DateTime.Now - keepPlayerLastTick) > keepPlayerExpire)
     {
         if (!zoneGameOver)
         {
             zoneGameOver = true;
             //notify areamanager close zone.
             service.area_manager.Invoke(new AreaZoneGameOverNotify()
             {
                 zoneUUID = this.ZoneUUID,
                 reason   = "KeepPlayerTimeOver",
             });
         }
         t.Dispose();
         //start delay desotry.
         var delayDestoryTime = TimeSpan.FromSeconds(TimerConfig.timer_sec_DelayDestoryTime);
         // if (delayDestoryTime > TimeSpan.Zero)
         {
             //log.Info("ZoneNode Start Delay Destory : " + delayDestoryTime + " " + this.ZoneUUID);
             var evt = new DeepCore.GameData.Zone.GameOverEvent()
             {
                 WinForce = 0, message = "KeepPlayerTimeOver"
             };
             service.Provider.Delay((st) =>
             {
                 if (node.IsDisposed)
                 {
                     return;
                 }
                 //log.Info("ZoneNode Send AreaZoneDestoryNotify ZoneUUID : " + this.ZoneUUID);
                 NotifyAllLogicsGameOver(evt);
                 service.area_manager.Invoke(new AreaZoneDestoryNotify()
                 {
                     zoneUUID = this.ZoneUUID,
                     reason   = evt.message,
                 });
             }, create, delayDestoryTime);
         }
     }
 }