<commit_before>﻿using System;
using System.Data;
using MySql.Data.MySqlClient;
using System.Collections.Generic;
using Ninject;
using L2dotNET.Services.Contracts;
using System.Linq;

namespace L2dotNET.Game.tables
{
    sealed class IdFactory
    {
        [Inject]
        public IServerService serverService { get { return GameServer.Kernel.Get<IServerService>(); } }

        private static volatile IdFactory instance;
        private static object syncRoot = new object();

        public int id_min = 0x10000000, id_max = 0x7FFFFFFF;
        private int currentId = 1;

        public static IdFactory Instance
        {
            get
            {
                if (instance == null)
                {
                    lock (syncRoot)
                    {
                        if (instance == null)
                        {
                            instance = new IdFactory();
                        }
                    }
                }

                return instance;
            }
        }

        public IdFactory()
        {

        }

        public int nextId()
        {
            currentId++;
            return currentId;
        }

        public void Initialize()
        {
            currentId = serverService.GetPlayersObjectIdList().Max();

            Console.WriteLine("idfactory: used ids " + currentId);
        }
    }
}<commit_msg>Update IdFactory.cs<commit_after>using System;
using System.Data;
using MySql.Data.MySqlClient;
using System.Collections.Generic;
using Ninject;
using L2dotNET.Services.Contracts;
using System.Linq;

namespace L2dotNET.Game.tables
{
    sealed class IdFactory
    {
        [Inject]
        public IServerService serverService { get { return GameServer.Kernel.Get<IServerService>(); } }

        private static volatile IdFactory instance;
        private static object syncRoot = new object();

        public const int ID_MIN = 0x10000000, ID_MAX = 0x7FFFFFFF;

        private int currentId = 1;

        public static IdFactory Instance
        {
            get
            {
                if (instance == null)
                {
                    lock (syncRoot)
                    {
                        if (instance == null)
                        {
                            instance = new IdFactory();
                        }
                    }
                }

                return instance;
            }
        }

        public IdFactory()
        {

        }

        public int nextId()
        {
            currentId++;
            return currentId;
        }

        public void Initialize()
        {
            currentId = serverService.GetPlayersObjectIdList().DefaultIfEmpty(ID_MIN).Max();

            Console.WriteLine("idfactory: used ids " + currentId);
        }
    }
}
{'fraction_non_alphanumeric': 0.07653969384122464, 'fraction_numerical': 0.009967960128159488, 'mean_word_length': 1.314662273476112, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 4, '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': '5815537', 'n_tokens_mistral': 728, 'n_tokens_neox': 671, 'n_words': 166}