//only intended to be used by core if2 classes public static void SendTileApply(TileApply tileApply, InteractableTiles interactableTiles, TileInteraction tileInteraction, int tileInteractionIndex) { //if we are client and the interaction has client prediction, trigger it. //Note that client prediction is not triggered for server player. if (!CustomNetworkManager.IsServer) { Logger.LogTraceFormat("Predicting TileApply interaction {0}", Category.Interaction, tileApply); tileInteraction.ClientPredictInteraction(tileApply); } if (!tileApply.Performer.Equals(PlayerManager.LocalPlayer)) { Logger.LogError("Client attempting to perform an interaction on behalf of another player." + " This is not allowed. Client can only perform an interaction as themselves. Message" + " will not be sent.", Category.NetMessage); return; } var msg = new RequestInteractMessage() { ComponentType = typeof(InteractableTiles), InteractionType = typeof(TileApply), ProcessorObject = interactableTiles.GetComponent <NetworkIdentity>().netId, Intent = tileApply.Intent, TargetVector = tileApply.TargetVector, TileInteractionIndex = tileInteractionIndex }; msg.Send(); }
//only intended to be used by core if2 classes public static void SendTileApply(TileApply tileApply, InteractableTiles interactableTiles, TileInteraction tileInteraction) { //if we are client and the interaction has client prediction, trigger it. //Note that client prediction is not triggered for server player. if (!CustomNetworkManager.IsServer) { Logger.LogTraceFormat("Predicting TileApply interaction {0}", Category.Interaction, tileApply); tileInteraction.ClientPredictInteraction(tileApply); } if (!tileApply.Performer.Equals(PlayerManager.LocalPlayer)) { Logger.LogError("Client attempting to perform an interaction on behalf of another player." + " This is not allowed. Client can only perform an interaction as themselves. Message" + " will not be sent.", Category.Exploits); return; } var msg = new NetMessage() { ComponentType = typeof(InteractableTiles), InteractionType = typeof(TileApply), ProcessorObject = GetNetId(interactableTiles.gameObject), Intent = tileApply.Intent, TargetPosition = tileApply.TargetPosition }; Send(msg); }