本文整理汇总了C#中Sandbox.Game.World.MyNetworkClient.IsGameServer方法的典型用法代码示例。如果您正苦于以下问题:C# MyNetworkClient.IsGameServer方法的具体用法?C# MyNetworkClient.IsGameServer怎么用?C# MyNetworkClient.IsGameServer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Sandbox.Game.World.MyNetworkClient
的用法示例。
在下文中一共展示了MyNetworkClient.IsGameServer方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ShootEndCallback
static void ShootEndCallback(MySyncControllableEntity sync, ref ShootEndMsg msg, MyNetworkClient sender)
{
if (Sync.IsServer)
{
Sync.Layer.SendMessageToAllButOne(ref msg, sender.SteamUserId);
}
bool wouldCallStopTwice = Sync.IsServer && sender.IsGameServer();
if (!wouldCallStopTwice)
sync.StopShooting(msg.Action);
}
示例2: ResponsibleForUpdate
public bool ResponsibleForUpdate(MyNetworkClient player)
{
if (Sync.Players == null)
return false;
var controllingPlayer = Sync.Players.GetControllingPlayer(this);
if (controllingPlayer == null)
{
if (CurrentRemoteControl != null)
{
controllingPlayer = Sync.Players.GetControllingPlayer(CurrentRemoteControl as MyEntity);
}
}
if (controllingPlayer == null)
{
return player.IsGameServer();
}
else
{
return controllingPlayer.Client == player;
}
}
示例3: ResponsibleForUpdate
internal bool ResponsibleForUpdate(MyNetworkClient player)
{
if (Sync.Players == null)
return false;
var controllingPlayer = Sync.Players.GetControllingPlayer(Entity);
if (controllingPlayer == null)
{
var character = Entity as MyCharacter;
if (character != null && character.CurrentRemoteControl != null)
{
controllingPlayer = Sync.Players.GetControllingPlayer(character.CurrentRemoteControl as MyEntity);
}
}
if (controllingPlayer == null)
{
return player.IsGameServer();
}
else
{
return controllingPlayer.Client == player;
}
}