本文整理汇总了C#中Bussiness.PlayerBussiness.GetMarryRoomInfo方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerBussiness.GetMarryRoomInfo方法的具体用法?C# PlayerBussiness.GetMarryRoomInfo怎么用?C# PlayerBussiness.GetMarryRoomInfo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bussiness.PlayerBussiness
的用法示例。
在下文中一共展示了PlayerBussiness.GetMarryRoomInfo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: 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);
}
}
}
}