public override void ServerBehaviour(AimApply interaction, bool isSuicide) { /* --ACCESS REWORK-- * TODO Remove the AccessRestriction check when we finish migrating! * */ if (AccessRestrictions.CheckAccess(interaction.Performer)) { //TODO Commented out as client doesnt sync job, after mind rework see if job is now sync'd // JobType job = GetJobServer(interaction.Performer); // // if (clusmyMisfire && job == JobType.CLOWN) // { // ClumsyShotServer(interaction, isSuicide); // } // else // { // CallShotServer(interaction, isSuicide); // } CallShotServer(interaction, isSuicide); return; //we found access skip clearance check } if (clearanceCheckable.HasClearance(interaction.Performer)) { CallShotServer(interaction, isSuicide); return; } Chat.AddExamineMsg(interaction.Performer, deniedMessage); }
public override void ClientBehaviour(AimApply interaction, bool isSuicide) { /* --ACCESS REWORK-- * TODO Remove the AccessRestriction check when we finish migrating! * */ if (AccessRestrictions.CheckAccess(interaction.Performer)) { //TODO Commented out as client doesnt sync job, after mind rework see if job is now sync'd // JobType job = GetJobClient(); // // if ((clusmyMisfire && job == JobType.CLOWN) == false) // { // CallShotClient(interaction, isSuicide); // } CallShotClient(interaction, isSuicide); return; //we found access skip clearance check } if (clearanceCheckable.HasClearance(interaction.Performer)) { CallShotClient(interaction, isSuicide); } }
public void ServerPerformInteraction(AimApply interaction) { if (reagentContainer.CurrentCapacity < reagentsPerUse || safety) { return; } Vector2 startPos = gameObject.AssumedWorldPosServer(); Vector2 targetPos = interaction.WorldPositionTarget.To2Int(); List <Vector3Int> positionList = CheckPassableTiles(startPos, targetPos); StartCoroutine(Fire(positionList)); var points = GetParallelPoints(startPos, targetPos, true); positionList = CheckPassableTiles(points[0], points[1]); StartCoroutine(Fire(positionList)); points = GetParallelPoints(startPos, targetPos, false); positionList = CheckPassableTiles(points[0], points[1]); StartCoroutine(Fire(positionList)); Effect.PlayParticleDirectional(this.gameObject, interaction.TargetVector); SoundManager.PlayNetworkedAtPos("Extinguish", startPos, 1, sourceObj: interaction.Performer); interaction.Performer.Pushable()?.NewtonianMove((-interaction.TargetVector).NormalizeToInt()); }
private bool CheckAimApply(MouseButtonState buttonState) { ChangeDirection(); //currently there is nothing for ghosts to interact with, they only can change facing if (PlayerManager.LocalPlayerScript.IsGhost) { return(false); } //can't do anything if we have no item in hand var handObj = UIManager.Hands.CurrentSlot.Item; if (handObj == null) { triggeredAimApply = null; secondsSinceLastAimApplyTrigger = 0; return(false); } var aimApplyInfo = AimApply.ByLocalPlayer(buttonState); if (buttonState == MouseButtonState.PRESS) { //it's being clicked down triggeredAimApply = null; //Checks for aim apply interactions which can trigger var comps = handObj.GetComponents <IBaseInteractable <AimApply> >() .Where(mb => mb != null && (mb as MonoBehaviour).enabled); var triggered = InteractionUtils.ClientCheckAndTrigger(comps, aimApplyInfo); if (triggered != null) { triggeredAimApply = triggered; secondsSinceLastAimApplyTrigger = 0; return(true); } } else { //it's being held //if we are already triggering an AimApply, keep triggering it based on the AimApplyInterval if (triggeredAimApply != null) { secondsSinceLastAimApplyTrigger += Time.deltaTime; if (secondsSinceLastAimApplyTrigger > AimApplyInterval) { if (triggeredAimApply.CheckInteract(aimApplyInfo, NetworkSide.Client)) { //only reset timer if it was actually triggered secondsSinceLastAimApplyTrigger = 0; InteractionUtils.RequestInteract(aimApplyInfo, triggeredAimApply); } } //no matter what the result, we keep trying to trigger it until mouse is released. return(true); } } return(false); }
public override void ServerBehaviour(AimApply interaction, bool isSuicide) { AudioSourceParameters hornParameters = new AudioSourceParameters(pitch: UnityEngine.Random.Range(0.7f, 1.2f)); SoundManager.PlayNetworkedAtPos(CommonSounds.Instance.ClownHonk, interaction.Performer.AssumedWorldPosServer(), hornParameters, true, sourceObj: interaction.Performer); }
public override void ServerPerformInteraction(AimApply interaction) { ServerShoot(interaction.Performer, interaction.TargetVector.normalized, UIManager.DamageZone, false); if (allowRecharge) { StartCoroutine(StartCooldown()); } }
protected override bool WillInteract(AimApply interaction, NetworkSide side) { if (interaction.MouseButtonState == MouseButtonState.PRESS) { return(true); } return(false); }
public override void ServerPerformInteraction(AimApply interaction) { if (firemodeUsage[currentFiremode] > battery.Watts) { return; } base.ServerPerformInteraction(interaction); }
public bool WillInteract(AimApply interaction, NetworkSide side) { if (!DefaultWillInteract.Default(interaction, side) || (!IsCoolDown() && !isServer)) { return(false); } return(true); }
public override void ServerPerformInteraction(AimApply interaction) { if (firemodeUsage[currentFiremode] > battery.Watts) { return; } base.ServerPerformInteraction(interaction); CurrentMagazine.ServerSetAmmoRemains(battery.Watts / firemodeUsage[currentFiremode]); }
public override void ServerPerformInteraction(AimApply interaction) { if (allowRecharge) { //enqueue the shot (will be processed in Update) base.ServerPerformInteraction(interaction); StartCoroutine(StartCooldown()); } }
public override void ClientBehaviour(AimApply interaction, bool isSuicide) { //TODO Commented out as client doesnt sync job, after mind rework see if job is now sync'd // JobType job = GetJobClient(); // if ((clusmyMisfire && job == JobType.CLOWN) == false) // { // CallShotClient(interaction, isSuicide); // } CallShotClient(interaction, isSuicide); }
/// <summary> /// For most cases you should use InteractionMessageUtils.SendRequest() instead of this. /// /// Sends a request to the server to validate + perform the interaction. /// </summary> /// <param name="aimApply">info on the interaction being performed. Each object involved in the interaction /// must have a networkidentity.</param> /// <param name="processorObject">object who has a component implementing IInteractionProcessor<AimApply> which /// will process the interaction on the server-side. This object must have a NetworkIdentity and there must only be one instance /// of this component on the object. For organization, we suggest that the component which is sending this message /// should be on the processorObject, as such this parameter should almost always be passed using "this.gameObject", and /// should almost always be either a component on the target object or a component on the used object</param> public static void Send(AimApply aimApply, GameObject processorObject) { var msg = new RequestAimApplyMessage { TargetVector = aimApply.TargetVector, ProcessorObject = processorObject.GetComponent <NetworkIdentity>().netId, MouseButtonState = aimApply.MouseButtonState }; msg.Send(); }
/// <summary> /// Default WillInteract logic for AimApply /// </summary> public static bool AimApply(AimApply interaction, NetworkSide side) { if (!Validations.CanInteract(interaction.Performer, side)) { return(false); } bool?isNotHidden = !interaction.Performer.Player()?.Script.IsHidden; return(isNotHidden.GetValueOrDefault(true)); }
public override bool WillInteract(AimApply interaction, NetworkSide side) { if (battery == null || firemodeUsage[currentFiremode] > battery.Watts) { PlayEmptySFX(); return(false); } CurrentMagazine.containedBullets[0] = firemodeProjectiles[currentFiremode]; currentElectricalMag.toRemove = firemodeUsage[currentFiremode]; return(base.WillInteract(interaction, side)); }
public override void ServerBehaviour(AimApply interaction, bool isSuicide) { JobType job = GetJobServer(interaction.Performer); if (clusmyMisfire) { ClumsyShotServer(interaction, isSuicide); } else { CallShotServer(interaction, isSuicide); } }
protected override void ServerPerformInteraction(AimApply interaction) { if (reagentContainer.CurrentCapacity >= 5) { Vector2 startPos = interaction.Performer.transform.position; Vector2 targetPos = new Vector2(Mathf.RoundToInt(interaction.WorldPositionTarget.x), Mathf.RoundToInt(interaction.WorldPositionTarget.y)); List <Vector3Int> positionList = MatrixManager.GetTiles(startPos, targetPos, travelDistance); StartCoroutine(Fire(positionList)); var angle = Mathf.Atan2(targetPos.y - startPos.y, targetPos.x - startPos.x) * 180 / Mathf.PI; particleSync = angle; reagentContainer.MoveReagentsTo(5); SoundManager.PlayNetworkedAtPos("Spray2", startPos, 1); } }
protected void ClumsyShotServer(AimApply interaction, bool isSuicide) { //shooting a non-clusmy weapon as a clusmy person if (DMMath.Prob(50)) { CallShotServer(interaction, true); Chat.AddActionMsgToChat(interaction.Performer, "You fumble up and shoot yourself!", $"{interaction.Performer.ExpensiveName()} fumbles up and shoots themself!"); } else { CallShotServer(interaction, isSuicide); } }
public override void ServerBehaviour(AimApply interaction, bool isSuicide) { JobType job = GetJobServer(interaction.Performer); if (clusmyMisfire && job == JobType.CLOWN) { CallShotServer(interaction, isSuicide); } else { CallShotServer(interaction, true); Chat.AddActionMsgToChat(interaction.Performer, "You somehow shoot yourself in the face! How the hell?!", $"{interaction.Performer.ExpensiveName()} somehow manages to shoot themself in the face!"); } }
private void ProcessAimApply(GameObject handObject, Vector2 targetVector, GameObject processorObj, GameObject performerObj, HandSlot usedSlot, MouseButtonState buttonState) { //try to look up the components on the processor that can handle this interaction var processorComponents = InteractionMessageUtils.TryGetProcessors <AimApply>(processorObj); //invoke each component that can handle this interaction var aimApply = AimApply.ByClient(performerObj, targetVector, handObject, usedSlot, buttonState); foreach (var processorComponent in processorComponents) { if (processorComponent.ServerProcessInteraction(aimApply)) { //something happened, don't check further components return; } } }
protected override void ServerPerformInteraction(AimApply interaction) { //do we need to check if this is a suicide (want to avoid the check because it involves a raycast). //case 1 - we are beginning a new shot, need to see if we are shooting ourselves //case 2 - we are firing an automatic and are currently shooting ourselves, need to see if we moused off // ourselves. var isSuicide = false; if (interaction.MouseButtonState == MouseButtonState.PRESS || (WeaponType == WeaponType.FullyAutomatic && AllowSuicide)) { isSuicide = interaction.IsAimingAtSelf; AllowSuicide = isSuicide; } //enqueue the shot (will be processed in Update) ServerShoot(interaction.Performer, interaction.TargetVector.normalized, UIManager.DamageZone, isSuicide); }
protected override void ClientPredictInteraction(AimApply interaction) { //do we need to check if this is a suicide (want to avoid the check because it involves a raycast). //case 1 - we are beginning a new shot, need to see if we are shooting ourselves //case 2 - we are firing an automatic and are currently shooting ourselves, need to see if we moused off // ourselves. var isSuicide = false; if (interaction.MouseButtonState == MouseButtonState.PRESS || (WeaponType == WeaponType.FullyAutomatic && AllowSuicide)) { isSuicide = interaction.IsAimingAtSelf; AllowSuicide = isSuicide; } var dir = ApplyRecoil(interaction.TargetVector.normalized); DisplayShot(PlayerManager.LocalPlayer, dir, UIManager.DamageZone, isSuicide); }
public override void ServerPerformInteraction(AimApply interaction) { var isSuicide = false; if (interaction.MouseButtonState == MouseButtonState.PRESS || (WeaponType != WeaponType.SemiAutomatic && AllowSuicide)) { isSuicide = interaction.IsAimingAtSelf; AllowSuicide = isSuicide; } //enqueue the shot (will be processed in Update) ServerShoot(interaction.Performer, interaction.TargetVector.normalized, UIManager.DamageZone, isSuicide); if (allowRecharge) { StartCoroutine(StartCooldown()); } }
protected override bool WillInteract(AimApply interaction, NetworkSide side) { if (!base.WillInteract(interaction, side)) { return(false); } if (CurrentMagazine == null) { PlayEmptySFX(); return(false); } if (Projectile != null && CurrentMagazine.ammoRemains <= 0 && FireCountDown <= 0) { if (SmartGun) { RequestUnload(CurrentMagazine); OutOfAmmoSFX(); } else { PlayEmptySFX(); } return(false); } if (Projectile != null && CurrentMagazine.ammoRemains > 0 && FireCountDown <= 0) { if (interaction.MouseButtonState == MouseButtonState.PRESS) { return(true); } else { //being held, only can shoot if this is an automatic return(WeaponType == WeaponType.FullyAutomatic); } } return(false); }
/// <summary> /// Default WillInteract logic for AimApply /// </summary> public static bool AimApply(AimApply interaction, NetworkSide side) { if (!Validations.CanInteract(interaction.Performer, side)) { return(false); } bool?isNotHidden = true; if (side == NetworkSide.Client) { //local player is performing interaction isNotHidden = !PlayerManager.LocalPlayerScript.IsHidden; } else { //server is validating the interaction isNotHidden = !interaction.Performer.Player()?.Script.IsHidden; } return(isNotHidden.GetValueOrDefault(true)); }
public override void ServerBehaviour(AimApply interaction, bool isSuicide) { if (AccessRestrictions.CheckAccess(interaction.Performer)) { //TODO Commented out as client doesnt sync job, after mind rework see if job is now sync'd // JobType job = GetJobServer(interaction.Performer); // // if (clusmyMisfire && job == JobType.CLOWN) // { // ClumsyShotServer(interaction, isSuicide); // } // else // { // CallShotServer(interaction, isSuicide); // } CallShotServer(interaction, isSuicide); } else { Chat.AddExamineMsg(interaction.Performer, deniedMessage); } }
protected override void ServerPerformInteraction(AimApply interaction) { if (reagentContainer.CurrentCapacity >= 5 && !safety) { Vector2 startPos = interaction.Performer.transform.position; //TODO: use registeritem position once picked up items get fixed Vector2 targetPos = new Vector2(Mathf.RoundToInt(interaction.WorldPositionTarget.x), Mathf.RoundToInt(interaction.WorldPositionTarget.y)); List <Vector3Int> positionList = MatrixManager.GetTiles(startPos, targetPos, travelDistance); StartCoroutine(Fire(positionList)); var points = GetParallelPoints(startPos, targetPos, true); positionList = MatrixManager.GetTiles(points[0], points[1], travelDistance); StartCoroutine(Fire(positionList)); points = GetParallelPoints(startPos, targetPos, false); positionList = MatrixManager.GetTiles(points[0], points[1], travelDistance); StartCoroutine(Fire(positionList)); var angle = Mathf.Atan2(targetPos.y - startPos.y, targetPos.x - startPos.x) * 180 / Mathf.PI; particleSync = angle; SoundManager.PlayNetworkedAtPos("Extinguish", startPos, 1); reagentContainer.MoveReagentsTo(5); } }
public override bool WillInteract(AimApply interaction, NetworkSide side) { CurrentMagazine.containedBullets[0] = Projectile; return(base.WillInteract(interaction, side)); }
public override void Process(NetMessage msg) { var ComponentType = msg.ComponentType; var InteractionType = msg.InteractionType; var ProcessorObject = msg.ProcessorObject; var Intent = msg.Intent; var TargetObject = msg.TargetObject; var UsedObject = msg.UsedObject; var TargetBodyPart = msg.TargetBodyPart; var TargetVector = msg.TargetVector; var MouseButtonState = msg.MouseButtonState; var IsAltUsed = msg.IsAltUsed; var Storage = msg.Storage; var SlotIndex = msg.SlotIndex; var NamedSlot = msg.NamedSlot; var connectionPointA = msg.connectionPointA; var connectionPointB = msg.connectionPointB; var RequestedOption = msg.RequestedOption; var performer = SentByPlayer.GameObject; if (SentByPlayer == null || SentByPlayer.Script == null) { return; } if (SentByPlayer.Script.DynamicItemStorage == null) { if (InteractionType == typeof(AiActivate)) { LoadMultipleObjects(new uint[] { TargetObject, ProcessorObject }); var targetObj = NetworkObjects[0]; var processorObj = NetworkObjects[1]; var interaction = new AiActivate(performer, null, targetObj, Intent, msg.ClickTypes); ProcessInteraction(interaction, processorObj, ComponentType); } return; } if (InteractionType == typeof(PositionalHandApply)) { //look up item in active hand slot var clientStorage = SentByPlayer.Script.DynamicItemStorage; var usedSlot = clientStorage.GetActiveHandSlot(); var usedObject = clientStorage.GetActiveHandSlot().ItemObject; LoadMultipleObjects(new uint[] { TargetObject, ProcessorObject }); var targetObj = NetworkObjects[0]; var processorObj = NetworkObjects[1]; CheckMatrixSync(ref targetObj); CheckMatrixSync(ref processorObj); var interaction = PositionalHandApply.ByClient(performer, usedObject, targetObj, TargetVector, usedSlot, Intent, TargetBodyPart); ProcessInteraction(interaction, processorObj, ComponentType); } else if (InteractionType == typeof(HandApply)) { var clientStorage = SentByPlayer.Script.DynamicItemStorage; var usedSlot = clientStorage.GetActiveHandSlot(); var usedObject = clientStorage.GetActiveHandSlot()?.ItemObject; LoadMultipleObjects(new uint[] { TargetObject, ProcessorObject }); var targetObj = NetworkObjects[0]; var processorObj = NetworkObjects[1]; CheckMatrixSync(ref targetObj); CheckMatrixSync(ref processorObj); var interaction = HandApply.ByClient(performer, usedObject, targetObj, TargetBodyPart, usedSlot, Intent, IsAltUsed); ProcessInteraction(interaction, processorObj, ComponentType); } else if (InteractionType == typeof(AimApply)) { var clientStorage = SentByPlayer.Script.DynamicItemStorage; var usedSlot = clientStorage.GetActiveHandSlot(); var usedObject = clientStorage.GetActiveHandSlot().ItemObject; LoadNetworkObject(ProcessorObject); var processorObj = NetworkObject; CheckMatrixSync(ref processorObj); var interaction = AimApply.ByClient(performer, TargetVector, usedObject, usedSlot, MouseButtonState, Intent); ProcessInteraction(interaction, processorObj, ComponentType); } else if (InteractionType == typeof(MouseDrop)) { LoadMultipleObjects(new uint[] { UsedObject, TargetObject, ProcessorObject }); var usedObj = NetworkObjects[0]; var targetObj = NetworkObjects[1]; var processorObj = NetworkObjects[2]; CheckMatrixSync(ref targetObj); CheckMatrixSync(ref processorObj); var interaction = MouseDrop.ByClient(performer, usedObj, targetObj, Intent); ProcessInteraction(interaction, processorObj, ComponentType); } else if (InteractionType == typeof(HandActivate)) { LoadNetworkObject(ProcessorObject); var processorObj = NetworkObject; CheckMatrixSync(ref processorObj); var performerObj = SentByPlayer.GameObject; //look up item in active hand slot var clientStorage = SentByPlayer.Script.DynamicItemStorage; var usedSlot = clientStorage.GetActiveHandSlot(); var usedObject = clientStorage.GetActiveHandSlot().ItemObject; var interaction = HandActivate.ByClient(performer, usedObject, usedSlot, Intent); ProcessInteraction(interaction, processorObj, ComponentType); } else if (InteractionType == typeof(InventoryApply)) { LoadMultipleObjects(new uint[] { ProcessorObject, UsedObject, Storage }); var processorObj = NetworkObjects[0]; var usedObj = NetworkObjects[1]; var storageObj = NetworkObjects[2]; CheckMatrixSync(ref processorObj); ItemSlot targetSlot = null; if (SlotIndex == -1) { targetSlot = ItemSlot.GetNamed(storageObj.GetComponents <ItemStorage>()[msg.StorageIndexOnGameObject], NamedSlot); } else { targetSlot = ItemSlot.GetIndexed(storageObj.GetComponents <ItemStorage>()[msg.StorageIndexOnGameObject], SlotIndex); } //if used object is null, then empty hand was used ItemSlot fromSlot = null; if (usedObj == null) { fromSlot = SentByPlayer.Script.DynamicItemStorage.GetActiveHandSlot(); } else { fromSlot = usedObj.GetComponent <Pickupable>().ItemSlot; } var interaction = InventoryApply.ByClient(performer, targetSlot, fromSlot, Intent, IsAltUsed); ProcessInteraction(interaction, processorObj, ComponentType); } else if (InteractionType == typeof(TileApply)) { var clientStorage = SentByPlayer.Script.DynamicItemStorage; var usedSlot = clientStorage.GetActiveHandSlot(); var usedObject = clientStorage.GetActiveHandSlot().ItemObject; LoadNetworkObject(ProcessorObject); var processorObj = NetworkObject; CheckMatrixSync(ref processorObj); processorObj.GetComponent <InteractableTiles>().ServerProcessInteraction(SentByPlayer.GameObject, TargetVector, processorObj, usedSlot, usedObject, Intent, TileApply.ApplyType.HandApply); } else if (InteractionType == typeof(TileMouseDrop)) { LoadMultipleObjects(new uint[] { UsedObject, ProcessorObject }); var usedObj = NetworkObjects[0]; var processorObj = NetworkObjects[1]; CheckMatrixSync(ref processorObj); processorObj.GetComponent <InteractableTiles>().ServerProcessInteraction(SentByPlayer.GameObject, TargetVector, processorObj, null, usedObj, Intent, TileApply.ApplyType.MouseDrop); } else if (InteractionType == typeof(ConnectionApply)) { //look up item in active hand slot var clientStorage = SentByPlayer.Script.DynamicItemStorage; var usedSlot = clientStorage.GetActiveHandSlot(); var usedObject = clientStorage.GetActiveHandSlot().ItemObject; LoadMultipleObjects(new uint[] { TargetObject, ProcessorObject }); var targetObj = NetworkObjects[0]; var processorObj = NetworkObjects[1]; CheckMatrixSync(ref targetObj); CheckMatrixSync(ref processorObj); var interaction = ConnectionApply.ByClient(performer, usedObject, targetObj, connectionPointA, connectionPointB, TargetVector, usedSlot, Intent); ProcessInteraction(interaction, processorObj, ComponentType); } else if (InteractionType == typeof(ContextMenuApply)) { LoadMultipleObjects(new uint[] { TargetObject, ProcessorObject }); var clientStorage = SentByPlayer.Script.DynamicItemStorage; var usedObj = clientStorage.GetActiveHandSlot().ItemObject; var targetObj = NetworkObjects[0]; var processorObj = NetworkObjects[1]; CheckMatrixSync(ref targetObj); CheckMatrixSync(ref processorObj); var interaction = ContextMenuApply.ByClient(performer, usedObj, targetObj, RequestedOption, Intent); ProcessInteraction(interaction, processorObj, ComponentType); } }
public override void Process() { var performer = SentByPlayer.GameObject; if (SentByPlayer == null || SentByPlayer.Script == null || SentByPlayer.Script.ItemStorage == null) { return; } if (InteractionType == typeof(PositionalHandApply)) { //look up item in active hand slot var clientStorage = SentByPlayer.Script.ItemStorage; var usedSlot = clientStorage.GetActiveHandSlot(); var usedObject = clientStorage.GetActiveHandSlot().ItemObject; LoadMultipleObjects(new uint[] { TargetObject, ProcessorObject }); var targetObj = NetworkObjects[0]; var processorObj = NetworkObjects[1]; var interaction = PositionalHandApply.ByClient(performer, usedObject, targetObj, TargetVector, usedSlot, Intent, TargetBodyPart); ProcessInteraction(interaction, processorObj); } else if (InteractionType == typeof(HandApply)) { var clientStorage = SentByPlayer.Script.ItemStorage; var usedSlot = clientStorage.GetActiveHandSlot(); var usedObject = clientStorage.GetActiveHandSlot().ItemObject; LoadMultipleObjects(new uint[] { TargetObject, ProcessorObject }); var targetObj = NetworkObjects[0]; var processorObj = NetworkObjects[1]; var interaction = HandApply.ByClient(performer, usedObject, targetObj, TargetBodyPart, usedSlot, Intent, IsAltUsed); ProcessInteraction(interaction, processorObj); } else if (InteractionType == typeof(AimApply)) { var clientStorage = SentByPlayer.Script.ItemStorage; var usedSlot = clientStorage.GetActiveHandSlot(); var usedObject = clientStorage.GetActiveHandSlot().ItemObject; LoadNetworkObject(ProcessorObject); var processorObj = NetworkObject; var interaction = AimApply.ByClient(performer, TargetVector, usedObject, usedSlot, MouseButtonState, Intent); ProcessInteraction(interaction, processorObj); } else if (InteractionType == typeof(MouseDrop)) { LoadMultipleObjects(new uint[] { UsedObject, TargetObject, ProcessorObject }); var usedObj = NetworkObjects[0]; var targetObj = NetworkObjects[1]; var processorObj = NetworkObjects[2]; var interaction = MouseDrop.ByClient(performer, usedObj, targetObj, Intent); ProcessInteraction(interaction, processorObj); } else if (InteractionType == typeof(HandActivate)) { LoadNetworkObject(ProcessorObject); var processorObj = NetworkObject; var performerObj = SentByPlayer.GameObject; //look up item in active hand slot var clientStorage = SentByPlayer.Script.ItemStorage; var usedSlot = clientStorage.GetActiveHandSlot(); var usedObject = clientStorage.GetActiveHandSlot().ItemObject; var interaction = HandActivate.ByClient(performer, usedObject, usedSlot, Intent); ProcessInteraction(interaction, processorObj); } else if (InteractionType == typeof(InventoryApply)) { LoadMultipleObjects(new uint[] { ProcessorObject, UsedObject, Storage }); var processorObj = NetworkObjects[0]; var usedObj = NetworkObjects[1]; var storageObj = NetworkObjects[2]; ItemSlot targetSlot = null; if (SlotIndex == -1) { targetSlot = ItemSlot.GetNamed(storageObj.GetComponent <ItemStorage>(), NamedSlot); } else { targetSlot = ItemSlot.GetIndexed(storageObj.GetComponent <ItemStorage>(), SlotIndex); } //if used object is null, then empty hand was used ItemSlot fromSlot = null; if (usedObj == null) { fromSlot = SentByPlayer.Script.ItemStorage.GetActiveHandSlot(); } else { fromSlot = usedObj.GetComponent <Pickupable>().ItemSlot; } var interaction = InventoryApply.ByClient(performer, targetSlot, fromSlot, Intent, IsAltUsed); ProcessInteraction(interaction, processorObj); } else if (InteractionType == typeof(TileApply)) { var clientStorage = SentByPlayer.Script.ItemStorage; var usedSlot = clientStorage.GetActiveHandSlot(); var usedObject = clientStorage.GetActiveHandSlot().ItemObject; LoadNetworkObject(ProcessorObject); var processorObj = NetworkObject; processorObj.GetComponent <InteractableTiles>().ServerProcessInteraction(TileInteractionIndex, SentByPlayer.GameObject, TargetVector, processorObj, usedSlot, usedObject, Intent, TileApply.ApplyType.HandApply); } else if (InteractionType == typeof(TileMouseDrop)) { LoadMultipleObjects(new uint[] { UsedObject, ProcessorObject }); var usedObj = NetworkObjects[0]; var processorObj = NetworkObjects[1]; processorObj.GetComponent <InteractableTiles>().ServerProcessInteraction(TileInteractionIndex, SentByPlayer.GameObject, TargetVector, processorObj, null, usedObj, Intent, TileApply.ApplyType.MouseDrop); } }