Skip to content

Lock Expire Feature

Yitong "Frank" Wu edited this page Jan 15, 2017 · 3 revisions

DO NOT TURN ON THIS FEATURE UNLESS YOU READ THIS THOROUGHLY! LOOK INTO THE DRAWBACK SECTION!

Lock expire is a feature that will be introduced in LockettePro 3.0.0.

Dependency
ProtocolLib is strongly recommended, but not required. If the feature is enabled without ProtocolLib, the plugin will work correctly, but signs' [Private] line will be ugly.

How to Use
In order to enable this feature, you need to set lock-expire to true in config.yml. You should also change relevant config according to your wish.

How this works
Upon sign is created, the sign's first line is usually [Private]. While this feature is enable, the line will become "[Private]#created:<unix time>". This will allow the plugin to track when a sign is created. Whenever someone tries to access a lock, if "current time - created time > lock expire time", the lock will become ineffective.

Possible Drawback and Fix
It is not possible to tell when a sign is created if the special [Private] line does not exists. It is also not possible to tell whether the actual creator of the sign has the no-expire permission "lockettepro.noexpire" at anytime without possible impact. The no-expire info is stored while signs are created. Therefore, an admin's old sign carried from LockettePro 3.0.0- will possibly be unlocked by unauthorized user. In order to counter this issue, you can:

  1. Set lock-force-expire-time-unix to 0. This value means all locks without a created time will be unlocked after that unix time. If set to 0, locks without created time will remain locked.
  2. Use command /lockettepro fixsign . This will properly add current time to all signs within this range.