public override IEnumerator Process() { if (HeadsetItem.Equals(NetworkInstanceId.Invalid)) { //Failfast Debug.LogWarning($"Headset invalid, processing stopped: {ToString()}"); yield break; } if (EncryptionKey.Equals(NetworkInstanceId.Invalid)) { //No key passed in message -> Removes EncryptionKey from a headset yield return(WaitFor(SentBy, HeadsetItem)); var player = NetworkObjects[0]; var headsetGO = NetworkObjects[1]; if (ValidRemoval(headsetGO)) { detachKey(headsetGO, player); } } else { //Key was passed -> Puts it into headset yield return(WaitFor(SentBy, HeadsetItem, EncryptionKey)); var player = NetworkObjects[0]; var headsetGO = NetworkObjects[1]; var keyGO = NetworkObjects[2]; if (ValidUpdate(headsetGO, keyGO)) { setKey(player, headsetGO, keyGO); } } }
///To be run on client public override IEnumerator Process() { // Debug.Log("Processed " + ToString()); if (ShotBy.Equals(NetworkInstanceId.Invalid) || Weapon.Equals(NetworkInstanceId.Invalid)) { //Failfast Debug.LogWarning($"Shoot request invalid, processing stopped: {ToString()}"); yield break; } yield return(WaitFor(ShotBy, Weapon)); Shoot(NetworkObjects[1], NetworkObjects[0]); }
//Serverside public override IEnumerator Process() { // Logger.Log("Processed " + ToString()); if (Subject.Equals(NetworkInstanceId.Invalid)) { //Drop item message ProcessFurther(SentByPlayer); } else { yield return(WaitFor(Subject)); ProcessFurther(SentByPlayer, NetworkObject); } }
public override IEnumerator Process() { if (ShotBy.Equals(NetworkInstanceId.Invalid) || Weapon.Equals(NetworkInstanceId.Invalid)) { //Failfast Logger.LogWarning($"Shoot request invalid, processing stopped: {ToString()}", Category.Firearms); yield break; } yield return(WaitFor(SentBy, ShotBy, Weapon)); Weapon wep = NetworkObjects[2].GetComponent <Weapon>(); wep.ServerShoot(NetworkObjects[1], Direction, BulletName, DamageZone, IsSuicideShot); }
//Serverside public override IEnumerator Process() { // Debug.Log("Processed " + ToString()); if (Subject.Equals(NetworkInstanceId.Invalid)) { //Drop item message yield return(WaitFor(SentBy)); ProcessFurther(NetworkObject); } else { yield return(WaitFor(SentBy, Subject)); ProcessFurther(NetworkObjects[0], NetworkObjects[1]); } }
public override IEnumerator Process() { //TODO: Validate if player is allowed to destroy things, check if they have admin privs. //For now we will let anyone spawn. if (ToDestroy.Equals(NetworkInstanceId.Invalid)) { Logger.LogWarning("Attempted to destroy an object with invalid netID, destroy will not occur.", Category.ItemSpawn); } else { yield return(WaitFor(ToDestroy)); PoolManager.PoolNetworkDestroy(NetworkObject); } yield return(null); }
///To be run on client public override IEnumerator Process() { if (Shooter.Equals(NetworkInstanceId.Invalid)) { //Failfast Logger.LogWarning($"Shoot request invalid, processing stopped: {ToString()}", Category.Firearms); yield break; } yield return(WaitFor(Shooter, Weapon)); Weapon wep = NetworkObjects[1].GetComponent <Weapon>(); //only needs to run on the clients other than the shooter if (!wep.isServer && PlayerManager.LocalPlayer.gameObject != NetworkObjects[0]) { wep.DisplayShot(NetworkObjects[0], Direction, DamageZone, IsSuicideShot); } }
public override IEnumerator Process() { //TODO: Validate if player is allowed to spawn things, check if they have admin privs. //For now we will let anyone spawn. if (ToClone.Equals(NetworkInstanceId.Invalid)) { Logger.LogWarning("Attempted to clone an object with invalid netID, clone will not occur.", Category.ItemSpawn); } else { yield return(WaitFor(ToClone)); if (MatrixManager.IsPassableAt(WorldPosition.RoundToInt(), true)) { PoolManager.NetworkClone(NetworkObject, WorldPosition); } } yield return(null); }