<commit_before>package skadistats.clarity.processor.sendtables;

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.ZeroCopy;
import skadistats.clarity.decoder.Util;
import skadistats.clarity.decoder.s2.S2DTClass;
import skadistats.clarity.decoder.s2.Serializer;
import skadistats.clarity.decoder.s2.SerializerId;
import skadistats.clarity.decoder.s2.field.Field;
import skadistats.clarity.decoder.s2.field.FieldProperties;
import skadistats.clarity.decoder.s2.field.FieldType;
import skadistats.clarity.decoder.s2.field.FixedArrayField;
import skadistats.clarity.decoder.s2.field.FixedSubTableField;
import skadistats.clarity.decoder.s2.field.SimpleField;
import skadistats.clarity.decoder.s2.field.VarArrayField;
import skadistats.clarity.decoder.s2.field.VarSubTableField;
import skadistats.clarity.event.Event;
import skadistats.clarity.event.Insert;
import skadistats.clarity.event.InsertEvent;
import skadistats.clarity.event.Provides;
import skadistats.clarity.model.BuildNumberRange;
import skadistats.clarity.model.DTClass;
import skadistats.clarity.model.EngineId;
import skadistats.clarity.processor.reader.OnMessage;
import skadistats.clarity.processor.runner.Context;
import skadistats.clarity.wire.Packet;
import skadistats.clarity.wire.common.proto.Demo;
import skadistats.clarity.wire.common.proto.NetMessages;
import skadistats.clarity.wire.s2.proto.S2NetMessages;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

@Provides(value =  {OnDTClass.class, OnDTClassesComplete.class}, engine = EngineId.SOURCE2)
public class S2DTClassEmitter {

    private static final Set<String> POINTERS = new HashSet<>();
    static {
        POINTERS.add("CBodyComponent");
        POINTERS.add("CEntityIdentity");
        POINTERS.add("CPhysicsComponent");
        POINTERS.add("CRenderComponent");
        POINTERS.add("CDOTAGamerules");
        POINTERS.add("CDOTAGameManager");
        POINTERS.add("CDOTASpectatorGraphManager");
        POINTERS.add("CPlayerLocalData");
    }

    private static final Map<String, Integer> ITEM_COUNTS = new HashMap<>();
    static {
        ITEM_COUNTS.put("MAX_ITEM_STOCKS", 8);
        ITEM_COUNTS.put("MAX_ABILITY_DRAFT_ABILITIES", 48);
    }

    @Insert
    private Context ctx;
    @Insert
    private DTClasses dtClasses;

    @InsertEvent
    private Event<OnDTClassesComplete> evClassesComplete;
    @InsertEvent
    private Event<OnDTClass> evDtClass;

    private FieldType createFieldType(String type) {
        return new FieldType(type);
    }

    private Field createField(FieldProperties properties) {
        if (properties.getSerializer() != null) {
            if (POINTERS.contains(properties.getType().getBaseType())) {
                return new FixedSubTableField(properties);
            } else {
                return new VarSubTableField(properties);<commit_msg>7.28 hotfix 2: add PhysicsRagdollPose_t as a pointer type<commit_after>package skadistats.clarity.processor.sendtables;

import com.google.protobuf.CodedInputStream;
import com.google.protobuf.ZeroCopy;
import skadistats.clarity.decoder.Util;
import skadistats.clarity.decoder.s2.S2DTClass;
import skadistats.clarity.decoder.s2.Serializer;
import skadistats.clarity.decoder.s2.SerializerId;
import skadistats.clarity.decoder.s2.field.Field;
import skadistats.clarity.decoder.s2.field.FieldProperties;
import skadistats.clarity.decoder.s2.field.FieldType;
import skadistats.clarity.decoder.s2.field.FixedArrayField;
import skadistats.clarity.decoder.s2.field.FixedSubTableField;
import skadistats.clarity.decoder.s2.field.SimpleField;
import skadistats.clarity.decoder.s2.field.VarArrayField;
import skadistats.clarity.decoder.s2.field.VarSubTableField;
import skadistats.clarity.event.Event;
import skadistats.clarity.event.Insert;
import skadistats.clarity.event.InsertEvent;
import skadistats.clarity.event.Provides;
import skadistats.clarity.model.BuildNumberRange;
import skadistats.clarity.model.DTClass;
import skadistats.clarity.model.EngineId;
import skadistats.clarity.processor.reader.OnMessage;
import skadistats.clarity.processor.runner.Context;
import skadistats.clarity.wire.Packet;
import skadistats.clarity.wire.common.proto.Demo;
import skadistats.clarity.wire.common.proto.NetMessages;
import skadistats.clarity.wire.s2.proto.S2NetMessages;

import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

@Provides(value =  {OnDTClass.class, OnDTClassesComplete.class}, engine = EngineId.SOURCE2)
public class S2DTClassEmitter {

    private static final Set<String> POINTERS = new HashSet<>();
    static {
        POINTERS.add("CBodyComponent");
        POINTERS.add("CEntityIdentity");
        POINTERS.add("CPhysicsComponent");
        POINTERS.add("CRenderComponent");
        POINTERS.add("CDOTAGamerules");
        POINTERS.add("CDOTAGameManager");
        POINTERS.add("CDOTASpectatorGraphManager");
        POINTERS.add("CPlayerLocalData");
        POINTERS.add("PhysicsRagdollPose_t");
    }

    private static final Map<String, Integer> ITEM_COUNTS = new HashMap<>();
    static {
        ITEM_COUNTS.put("MAX_ITEM_STOCKS", 8);
        ITEM_COUNTS.put("MAX_ABILITY_DRAFT_ABILITIES", 48);
    }

    @Insert
    private Context ctx;
    @Insert
    private DTClasses dtClasses;

    @InsertEvent
    private Event<OnDTClassesComplete> evClassesComplete;
    @InsertEvent
    private Event<OnDTClass> evDtClass;

    private FieldType createFieldType(String type) {
        return new FieldType(type);
    }

    private Field createField(FieldProperties properties) {
        if (properties.getSerializer() != null) {
            if (POINTERS.contains(properties.getType().getBaseType())) {
                return new FixedSubTableField(properties);
            } else {
                return new VarSubTableField(properties);
{'fraction_non_alphanumeric': 0.10333551340745585, 'fraction_numerical': 0.0068672334859385216, 'mean_word_length': 4.581204379562044, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3875109', 'n_tokens_mistral': 2015, 'n_tokens_neox': 1955, 'n_words': 304}