本文整理汇总了C#中Server.MirObjects.PlayerObject.StartGame方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerObject.StartGame方法的具体用法?C# PlayerObject.StartGame怎么用?C# PlayerObject.StartGame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.MirObjects.PlayerObject
的用法示例。
在下文中一共展示了PlayerObject.StartGame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: StartGame
private void StartGame(C.StartGame p)
{
if (Stage != GameStage.Select) return;
if (!Settings.AllowStartGame && (Account == null || (Account != null && !Account.AdminAccount)))
{
Enqueue(new S.StartGame { Result = 0 });
return;
}
if (Account == null)
{
Enqueue(new S.StartGame { Result = 1 });
return;
}
CharacterInfo info = null;
for (int i = 0; i < Account.Characters.Count; i++)
{
if (Account.Characters[i].Index != p.CharacterIndex) continue;
info = Account.Characters[i];
break;
}
if (info == null)
{
Enqueue(new S.StartGame { Result = 2 });
return;
}
if (info.Banned)
{
if (info.ExpiryDate > DateTime.Now)
{
Enqueue(new S.StartGameBanned { Reason = info.BanReason, ExpiryDate = info.ExpiryDate });
return;
}
info.Banned = false;
}
info.BanReason = string.Empty;
info.ExpiryDate = DateTime.MinValue;
long delay = (long) (SMain.Envir.Now - info.LastDate).TotalMilliseconds;
//if (delay < Settings.RelogDelay)
//{
// Enqueue(new S.StartGameDelay { Milliseconds = Settings.RelogDelay - delay });
// return;
//}
Player = new PlayerObject(info, this);
Player.StartGame();
}