package com.alterdekim.hearthhack.component.processor.client.request;

import com.alterdekim.Protocol;
import com.alterdekim.hearthhack.component.TcpConnection;
import com.alterdekim.hearthhack.component.processor.client.request.generic.GeneralGenericParser;
import com.alterdekim.hearthhack.util.BattleNetPacket;
import com.alterdekim.hearthhack.util.ClientRequestBody;

public class NetCacheObject extends ClientRequestParser {

    private final GeneralGenericParser parser;

    public NetCacheObject() {
        this.parser = new GeneralGenericParser();
    }

    @Override
    public void parse(BattleNetPacket packet, ClientRequestBody body, TcpConnection conn) throws Exception {
        this.parser.parseGenericRequest(
                packet.getHeader().getToken(),
                Protocol.UtilGenericRequest.parseFrom(body.getBody()),
                conn
        );
    }

    @Override
    public int getId() {
        return 201;
    }
}
