There are mistakes :D
The prepare() method should be called before the waitSecs(45) method(in handle() method).
In register(L2PcInstance p) method, this line MUST be removed:
state = State.REGISTERING;
The inLHE boolean in L2PcInstance isn't needed, since there are not checks in L2PcInstance, but in my opinion there should have been some.
There should have been checks in Logout and RequestRestart packets.
This:
+ if (!(state == State.INACTIVE))
+ {
+ {
+ while (state == State.REWARDING)
+ {
+ endAndReward();
+ teleport(true);
+ }
+ }
should have been coded in another way. First of all, in while loop there should have been a waitSecs(x)(where x put between 5-15), to avoid possible lags because of multiple checks.
In endAndReward() method there should have been a check if both players are killed and if both are disconnected or 1 of them, to immediately stop the game.
In clear() method, before you set player1 and player2 objects to null, you should set to false the inLHE boolean, since it exists.
Also winner and loser objects are not needed.