本文整理汇总了C#中Bussiness.PlayerBussiness.GetMarryRoomInfoSingle方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerBussiness.GetMarryRoomInfoSingle方法的具体用法?C# PlayerBussiness.GetMarryRoomInfoSingle怎么用?C# PlayerBussiness.GetMarryRoomInfoSingle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Bussiness.PlayerBussiness
的用法示例。
在下文中一共展示了PlayerBussiness.GetMarryRoomInfoSingle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandlePacket
public int HandlePacket(GameClient client, GSPacketIn packet)
{
//if (client.Player.CurrentGame != null)
//{
// client.Player.CurrentGame.RemovePlayer(client.Player);
//}
//if(client.Player.CurrentMarryRoom != null)
//{
// client.Player.CurrentMarryRoom.RemovePlayer(client.Player);
//}
MarryRoom room = null;
string msg = "";
int id = packet.ReadInt();
string pwd = packet.ReadString();
int sceneID = packet.ReadInt();
if (id != 0)
{
room = MarryRoomMgr.GetMarryRoombyID(id, pwd == null ? "" : pwd, ref msg);
}
else
{
if(client.Player.PlayerCharacter.IsCreatedMarryRoom)
{
MarryRoom[] rooms = MarryRoomMgr.GetAllMarryRoom();
foreach (MarryRoom r in rooms)
{
if (r.Info.GroomID == client.Player.PlayerCharacter.ID || r.Info.BrideID == client.Player.PlayerCharacter.ID)
{
room = r;
break;
}
}
}
if (room == null && client.Player.PlayerCharacter.SelfMarryRoomID != 0)
{
client.Player.Out.SendMarryRoomLogin(client.Player, false);
MarryRoomInfo info = null;
using(PlayerBussiness db = new PlayerBussiness())
{
info = db.GetMarryRoomInfoSingle(client.Player.PlayerCharacter.SelfMarryRoomID);
}
if (info != null)
{
client.Player.Out.SendMessage(eMessageType.ChatNormal, LanguageMgr.GetTranslation("MarryRoomLoginHandler.RoomExist",info.ServerID,client.Player.PlayerCharacter.SelfMarryRoomID));
return 0;
}
}
}
if (room != null)
{
if(room.CheckUserForbid(client.Player.PlayerCharacter.ID))
{
client.Out.SendMessage(eMessageType.ERROR, LanguageMgr.GetTranslation("MarryRoomLoginHandler.Forbid"));
client.Player.Out.SendMarryRoomLogin(client.Player, false);
return 1;
}
if (room.RoomState == eRoomState.FREE)
{
if (room.AddPlayer(client.Player))
{
client.Player.MarryMap = sceneID;
GSPacketIn pkg = client.Player.Out.SendMarryRoomLogin(client.Player, true);
room.SendMarryRoomInfoUpdateToScenePlayers(room);
return 0;
}
}
else
{
client.Player.Out.SendMessage(eMessageType.Normal, LanguageMgr.GetTranslation("MarryRoomLoginHandler.AlreadyBegin"));
}
client.Player.Out.SendMarryRoomLogin(client.Player, false);
}
else
{
client.Out.SendMessage(eMessageType.ERROR, LanguageMgr.GetTranslation(string.IsNullOrEmpty(msg) ? "MarryRoomLoginHandler.Failed" : msg));
client.Player.Out.SendMarryRoomLogin(client.Player, false);
}
return 1;
}