Allow timeout of /tpa /tpahere requests

Adds new config setting tpa-accept-cancellation
Test #781
This commit is contained in:
ementalo 2011-12-08 23:43:09 +00:00
parent 52b1017bda
commit 95d5217f58
15 changed files with 52 additions and 0 deletions

View file

@ -27,6 +27,13 @@ public class Commandtpaccept extends EssentialsCommand
throw new Exception(_("noPendingRequest"));
}
long timeout = ess.getSettings().getTpaAcceptCancellation();
if (timeout != 0 && (System.currentTimeMillis() - user.getTeleportRequestTime()) / 1000 > timeout)
{
user.requestTeleport(null, false);
throw new Exception(_("requestTimedOut"));
}
final Trade charge = new Trade(this.getName(), ess);
if (user.isTeleportRequestHere())
{