本文整理汇总了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);
}
}
示例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);
}
}
}
}