Exemplo n.º 1
0
        static void OnKillCharacter(ref KillCharacterMsg msg, MyNetworkClient sender)
        {
            MyEntity    entity    = null;
            MyCharacter character = null;

            if (!MyEntities.TryGetEntityById(msg.entityId, out entity) || (character = entity as MyCharacter) == null)
            {
                return;
            }

            character.Kill(false, msg.DamageInfo);
        }
Exemplo n.º 2
0
        public static void KillCharacter(MyCharacter character, MyDamageInformation damageInfo)
        {
            Debug.Assert(Sync.IsServer, "KillCharacter called from client");
            KillCharacterMsg msg = new KillCharacterMsg()
            {
                entityId   = character.EntityId,
                DamageInfo = damageInfo
            };

            character.Kill(false, damageInfo);
            Sync.Layer.SendMessageToAll <KillCharacterMsg>(ref msg);
        }
Exemplo n.º 3
0
		static void OnKillCharacter(ref KillCharacterMsg msg, MyNetworkClient sender)
		{
			MyEntity entity = null;
			MyCharacter character = null;
			if (!MyEntities.TryGetEntityById(msg.entityId, out entity) || (character = entity as MyCharacter) == null)
				return;

			character.Kill(false, msg.DamageInfo);
		}
Exemplo n.º 4
0
		public static void KillCharacter(MyCharacter character, MyDamageInformation damageInfo)
		{
			Debug.Assert(Sync.IsServer, "KillCharacter called from client");
			KillCharacterMsg msg = new KillCharacterMsg()
			{
				entityId = character.EntityId,
                DamageInfo = damageInfo
			};

			character.Kill(false, damageInfo);
			Sync.Layer.SendMessageToAll<KillCharacterMsg>(ref msg);
		}