public override bool SharedCanInteract(ICharacter character, IStaticWorldObject worldObject, bool writeToLog) { // don't use the base implementation as it will not work in PvE // (action forbidden if player doesn't have access to the land claim) if (character.GetPublicState <ICharacterPublicState>().IsDead) { return(false); } if (!NewbieProtectionSystem.SharedValidateInteractionIsNotForbidden(character, worldObject, writeToLog)) { return(false); } return(this.SharedIsInsideCharacterInteractionArea(character, worldObject, writeToLog)); }
public virtual bool SharedCanInteract(ICharacter character, TWorldObject worldObject, bool writeToLog) { if (!this.IsInteractableObject) { return(false); } if (character.GetPublicState <ICharacterPublicState>().IsDead || IsServer && !character.ServerIsOnline) { return(false); } if (worldObject is IStaticWorldObject staticWorldObject) { if (PveSystem.SharedIsPve(clientLogErrorIfDataIsNotYetAvailable: false)) { if (!PveSystem.SharedValidateInteractionIsNotForbidden(character, staticWorldObject, writeToLog)) { // action forbidden by PvE system return(false); } } else // PvP servers have newbie protection system { if (!NewbieProtectionSystem.SharedValidateInteractionIsNotForbidden( character, staticWorldObject, writeToLog)) { // action forbidden by newbie protection system return(false); } } } return(this.SharedIsInsideCharacterInteractionArea(character, worldObject, writeToLog)); }
public override bool SharedCanInteract(ICharacter character, IStaticWorldObject worldObject, bool writeToLog) { return(PveSystem.SharedValidateInteractionIsNotForbidden(character, worldObject, writeToLog) && NewbieProtectionSystem.SharedValidateInteractionIsNotForbidden(character, worldObject, writeToLog) && this.SharedIsInsideCharacterInteractionArea(character, worldObject, writeToLog)); }
public virtual bool SharedCanInteract(ICharacter character, TWorldObject worldObject, bool writeToLog) { if (!this.IsInteractableObject) { return(false); } try { this.VerifyGameObject(worldObject); } catch (Exception ex) { Logger.Warning($"Interaction check failed: {ex.GetType().FullName}: {ex.Message}"); return(false); } if (character.GetPublicState <ICharacterPublicState>().IsDead || IsServer && !character.ServerIsOnline || ((IsServer || character.IsCurrentClientCharacter) && PlayerCharacter.GetPrivateState(character).IsDespawned)) { if (writeToLog) { Logger.Warning( $"Character cannot interact with {worldObject} - character is offline/despawned/dead.", character); } return(false); } if (worldObject is IStaticWorldObject staticWorldObject) { if (PveSystem.SharedIsPve(clientLogErrorIfDataIsNotYetAvailable: false)) { if (!PveSystem.SharedValidateInteractionIsNotForbidden(character, staticWorldObject, writeToLog)) { // action forbidden by PvE system return(false); } } else // PvP servers have newbie protection system { if (!NewbieProtectionSystem.SharedValidateInteractionIsNotForbidden( character, staticWorldObject, writeToLog)) { // action forbidden by newbie protection system return(false); } } } return(this.SharedIsInsideCharacterInteractionArea(character, worldObject, writeToLog)); }