当前位置: 首页>>代码示例>>C#>>正文


C# PlayerBussiness.DisposeMarryRoomInfo方法代码示例

本文整理汇总了C#中Bussiness.PlayerBussiness.DisposeMarryRoomInfo方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerBussiness.DisposeMarryRoomInfo方法的具体用法?C# PlayerBussiness.DisposeMarryRoomInfo怎么用?C# PlayerBussiness.DisposeMarryRoomInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Bussiness.PlayerBussiness的用法示例。


在下文中一共展示了PlayerBussiness.DisposeMarryRoomInfo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnTick

        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);
            }
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:34,代码来源:TankMarryLogicProcessor.cs

示例2: CheckRoomStatus

        private static void CheckRoomStatus()
        {
            using(PlayerBussiness db = new PlayerBussiness())
            {
                MarryRoomInfo[] roomInfos = db.GetMarryRoomInfo();

                foreach(MarryRoomInfo roomInfo in roomInfos)
                {
                    //TimeSpan usedTime = roomInfo.BreakTime - roomInfo.BeginTime;
                    //int timeLeft = roomInfo.AvailTime - usedTime.Hours;
                    
                    if(roomInfo.ServerID != GameServer.Instance.Configuration.ServerID)
                    {
                        continue;
                    }

                    TimeSpan usedTime = DateTime.Now - roomInfo.BeginTime;
                    int timeLeft = roomInfo.AvailTime * 60 - (int)usedTime.TotalMinutes;

                    if (timeLeft > 0)
                    {
                        //创建房间
                        CreateMarryRoomFromDB(roomInfo, timeLeft);
                    }
                    else
                    { 
                        db.DisposeMarryRoomInfo(roomInfo.ID);
                        GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(roomInfo.GroomID);
                        GameServer.Instance.LoginServer.SendUpdatePlayerMarriedStates(roomInfo.BrideID);

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

                    }

                }
            }
        }
开发者ID:geniushuai,项目名称:DDTank-3.0,代码行数:38,代码来源:MarryRoomMgr.cs


注:本文中的Bussiness.PlayerBussiness.DisposeMarryRoomInfo方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。