public override void OnTick(MarryRoom room)
        {
            try 
            {
                if(room != null)
                {
                    room.KickAllPlayer();

                    using(PlayerBussiness db = new PlayerBussiness())
                    {
                        db.DisposeMarryRoomInfo(room.Info.ID);
                    }

                    GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(room.Info.GroomID);
                    GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(room.Info.BrideID);

                    GameServer.Instance.LoginServer.SendMarryRoomInfoToPlayer(room.Info.GroomID, false, room.Info);
                    GameServer.Instance.LoginServer.SendMarryRoomInfoToPlayer(room.Info.BrideID, false, room.Info);

                    MarryRoomMgr.RemoveMarryRoom(room);

                    GSPacketIn pkg = new GSPacketIn((short)ePackageType.MARRY_ROOM_DISPOSE);
                    pkg.WriteInt(room.Info.ID);
                    WorldMgr.MarryScene.SendToALL(pkg);

                    room.StopTimer();
                }
            }
            catch(Exception ex)
            {
                if (log.IsErrorEnabled)
                    log.Error("OnTick",ex);
            }
        }
 public override void OnTick(MarryRoom room)
 {
     try
     {
         if (room != null)
         {
             room.KickAllPlayer();
             using (PlayerBussiness playerBussiness = new PlayerBussiness())
             {
                 playerBussiness.DisposeMarryRoomInfo(room.Info.ID);
             }
             GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(room.Info.GroomID);
             GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(room.Info.BrideID);
             GameServer.Instance.LoginServer.SendMarryRoomInfoToPlayer(room.Info.GroomID, false, room.Info);
             GameServer.Instance.LoginServer.SendMarryRoomInfoToPlayer(room.Info.BrideID, false, room.Info);
             MarryRoomMgr.RemoveMarryRoom(room);
             GSPacketIn gSPacketIn = new GSPacketIn(254);
             gSPacketIn.WriteInt(room.Info.ID);
             WorldMgr.MarryScene.SendToALL(gSPacketIn);
             room.StopTimer();
         }
     }
     catch (Exception exception)
     {
         if (TankMarryLogicProcessor.log.IsErrorEnabled)
         {
             TankMarryLogicProcessor.log.Error("OnTick", exception);
         }
     }
 }
Beispiel #3
0
        public override void OnTick(MarryRoom room)
        {
            try
            {
                if (room != null)
                {
                    room.KickAllPlayer();

                    using (PlayerBussiness db = new PlayerBussiness())
                    {
                        db.DisposeMarryRoomInfo(room.Info.ID);
                    }

                    GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(room.Info.GroomID);
                    GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(room.Info.BrideID);

                    GameServer.Instance.LoginServer.SendMarryRoomInfoToPlayer(room.Info.GroomID, false, room.Info);
                    GameServer.Instance.LoginServer.SendMarryRoomInfoToPlayer(room.Info.BrideID, false, room.Info);

                    MarryRoomMgr.RemoveMarryRoom(room);

                    GSPacketIn pkg = new GSPacketIn((short)ePackageType.MARRY_ROOM_DISPOSE);
                    pkg.WriteInt(room.Info.ID);
                    WorldMgr.MarryScene.SendToALL(pkg);

                    room.StopTimer();
                }
            }
            catch (Exception ex)
            {
                if (log.IsErrorEnabled)
                {
                    log.Error("OnTick", ex);
                }
            }
        }