Save accepted ToS to PG
This commit is contained in:
@@ -4,12 +4,19 @@ import client.Client;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.netty.GameViolationException;
|
||||
import net.packet.InPacket;
|
||||
import service.AccountService;
|
||||
import tools.PacketCreator;
|
||||
|
||||
/**
|
||||
* @author kevintjuh93
|
||||
* @author Ponk
|
||||
*/
|
||||
public final class AcceptToSHandler extends AbstractPacketHandler {
|
||||
private final AccountService accountService;
|
||||
|
||||
public AcceptToSHandler(final AccountService accountService) {
|
||||
this.accountService = accountService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean validateState(Client c) {
|
||||
@@ -18,7 +25,7 @@ public final class AcceptToSHandler extends AbstractPacketHandler {
|
||||
|
||||
@Override
|
||||
public void handlePacket(InPacket p, Client c) {
|
||||
if (p.available() == 0 || p.readByte() != 1 || c.acceptToS()) {
|
||||
if (p.available() == 0 || p.readByte() != 1 || !accountService.acceptTos(c.getAccID())) {
|
||||
throw new GameViolationException("ToS not accepted");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user