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);
        }
        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
0
        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;
            }
        }