<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TCC.Data;
using TCC.ViewModels;
using Tera.Game;
using Tera.Game.Messages;

namespace TCC.Parsing.Messages
{
    public class S_GET_USER_LIST : ParsedMessage
    {
        short count, offset;
        byte unkh1;
        int unkh2;//, unkh3;
        int maxChar;
        int unkh4;
        short unkh5;
        int unkh6;
        int unkh7;
        int unkh8;

        public List<Character> CharacterList;
        public List<RawChar> RawCharacters;

        public S_GET_USER_LIST(TeraMessageReader reader) : base(reader)
        {
            CharacterList = new List<Character>();
            RawCharacters = new List<RawChar>();
            count = reader.ReadInt16();
            offset = reader.ReadInt16();
            short nextAddr = offset;
            unkh1 = reader.ReadByte();
            unkh2 = reader.ReadInt32();
            maxChar = reader.ReadInt32();
            unkh4 = reader.ReadInt32();
            unkh5 = reader.ReadInt16();
            unkh6 = reader.ReadInt32();
            unkh7 = reader.ReadInt32();
            unkh8 = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                var c = new RawChar();
                reader.BaseStream.Position = nextAddr - 4;
                reader.Skip(2);
                nextAddr = reader.ReadInt16();
                c.unk1 = reader.ReadInt32();
                var nameOffset = reader.ReadInt16();
                c.detailsOffset = reader.ReadInt16();
                c.detailsCount = reader.ReadInt16();
                c.details2offset = reader.ReadInt16();
                c.details2count = reader.ReadInt16();
                c.guildOffset = reader.ReadInt16();
                c.id = reader.ReadUInt32();
                c.gender = reader.ReadInt32();
                c.race = reader.ReadInt32();
                c.charClass = reader.ReadInt32();
                c.level = reader.ReadInt32();
                c.unk2 = reader.ReadInt32();
                c.unk3 = reader.ReadInt32();
                c.loc1 = reader.ReadInt32();
                c.loc2 = reader.ReadInt32();
                c.loc3 = reader.ReadInt32();
                c.lastOnline = reader.ReadInt64();
                c.unk4 = reader.ReadByte();
                c.unk5 = reader.ReadInt32();
                c.unk6 = reader.ReadInt32();
                c.unk7 = reader.ReadInt32();
                c.unk8 = reader.ReadInt32();
                c.earring1 = reader.ReadInt32();
                c.earring2 = reader.ReadInt32();
                c.chest = reader.ReadInt32();
                c.gloves = reader.ReadInt32();
                c.boots = reader.ReadInt32();
                c.unk9 = reader.ReadInt32();
                c.ring1 = reader.ReadInt32();
                c.ring2 = reader.ReadInt32();
                c.innerwear = reader.ReadInt32();
                c.head = reader.ReadInt32();
                c.face = reader.ReadInt32();
                c.appearance = reader.ReadInt64();
                if(reader.Version > 319000) reader.Skip(8); //for KR
                c.unk10 = reader.ReadInt32();
                c.unk11 = reader.ReadInt32();
                c.unk12 = reader.ReadInt32();
                c.unk13 = reader.ReadInt16();
                c.unk14 = reader.ReadInt32();
                c.unk15 = reader.ReadInt32();
                c.unk16 = reader.ReadInt32();
                c.unk17 = reader.ReadInt32();
                c.unk18 = reader.ReadInt32();
                c.unk19 = reader.ReadInt32();
                c.unk20 = reader.ReadInt32();
                c.unk21 = reader.ReadInt32();
                c.unk22 = reader.ReadInt32();
                c.unk23 = reader.ReadInt32();
                c.unk24 = reader.ReadInt32();<commit_msg>fix sGetUserList KR versioning<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TCC.Data;
using TCC.ViewModels;
using Tera.Game;
using Tera.Game.Messages;

namespace TCC.Parsing.Messages
{
    public class S_GET_USER_LIST : ParsedMessage
    {
        short count, offset;
        byte unkh1;
        int unkh2;//, unkh3;
        int maxChar;
        int unkh4;
        short unkh5;
        int unkh6;
        int unkh7;
        int unkh8;

        public List<Character> CharacterList;
        public List<RawChar> RawCharacters;

        public S_GET_USER_LIST(TeraMessageReader reader) : base(reader)
        {
            CharacterList = new List<Character>();
            RawCharacters = new List<RawChar>();
            count = reader.ReadInt16();
            offset = reader.ReadInt16();
            short nextAddr = offset;
            unkh1 = reader.ReadByte();
            unkh2 = reader.ReadInt32();
            maxChar = reader.ReadInt32();
            unkh4 = reader.ReadInt32();
            unkh5 = reader.ReadInt16();
            unkh6 = reader.ReadInt32();
            unkh7 = reader.ReadInt32();
            unkh8 = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                var c = new RawChar();
                reader.BaseStream.Position = nextAddr - 4;
                reader.Skip(2);
                nextAddr = reader.ReadInt16();
                c.unk1 = reader.ReadInt32();
                var nameOffset = reader.ReadInt16();
                c.detailsOffset = reader.ReadInt16();
                c.detailsCount = reader.ReadInt16();
                c.details2offset = reader.ReadInt16();
                c.details2count = reader.ReadInt16();
                c.guildOffset = reader.ReadInt16();
                c.id = reader.ReadUInt32();
                c.gender = reader.ReadInt32();
                c.race = reader.ReadInt32();
                c.charClass = reader.ReadInt32();
                c.level = reader.ReadInt32();
                c.unk2 = reader.ReadInt32();
                c.unk3 = reader.ReadInt32();
                c.loc1 = reader.ReadInt32();
                c.loc2 = reader.ReadInt32();
                c.loc3 = reader.ReadInt32();
                c.lastOnline = reader.ReadInt64();
                c.unk4 = reader.ReadByte();
                c.unk5 = reader.ReadInt32();
                c.unk6 = reader.ReadInt32();
                c.unk7 = reader.ReadInt32();
                c.unk8 = reader.ReadInt32();
                c.earring1 = reader.ReadInt32();
                c.earring2 = reader.ReadInt32();
                c.chest = reader.ReadInt32();
                c.gloves = reader.ReadInt32();
                c.boots = reader.ReadInt32();
                c.unk9 = reader.ReadInt32();
                c.ring1 = reader.ReadInt32();
                c.ring2 = reader.ReadInt32();
                c.innerwear = reader.ReadInt32();
                c.head = reader.ReadInt32();
                c.face = reader.ReadInt32();
                c.appearance = reader.ReadInt64();
                if(reader.Version < 321150) reader.Skip(8); //for KR
                c.unk10 = reader.ReadInt32();
                c.unk11 = reader.ReadInt32();
                c.unk12 = reader.ReadInt32();
                c.unk13 = reader.ReadInt16();
                c.unk14 = reader.ReadInt32();
                c.unk15 = reader.ReadInt32();
                c.unk16 = reader.ReadInt32();
                c.unk17 = reader.ReadInt32();
                c.unk18 = reader.ReadInt32();
                c.unk19 = reader.ReadInt32();
                c.unk20 = reader.ReadInt32();
                c.unk21 = reader.ReadInt32();
                c.unk22 = reader.ReadInt32();
                c.unk23 = reader.ReadInt32();
                c.unk24 = reader.ReadInt32();
{'fraction_non_alphanumeric': 0.11714396786315925, 'fraction_numerical': 0.0495011014642996, 'mean_word_length': 1.4301007556675063, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 12, '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': '6261245', 'n_tokens_mistral': 2451, 'n_tokens_neox': 2168, 'n_words': 410}