public ServerPacketHandler() { m_taskPool = new SelfRunningTaskPool(100, "Client task pool"); m_taskPool.Start(); m_taskPoolSecondary = new SelfRunningTaskPool(100, "Secondary Client task pool"); m_taskPoolSecondary.Start(); }
public static void Initialize() { if (isInitialized) { return; } m_taskpool = new SelfRunningTaskPool(500, "Web TaskPool"); m_taskpool.Start(); isInitialized = true; }
public void Initialize() { Instance = this; GCSettings.LatencyMode = GCSettings.IsServerGC ? GCLatencyMode.Batch : GCLatencyMode.Interactive; NLogHelper.DefineLogProfile(true, true); NLogHelper.EnableLogging(); logger.Info("Initializing Database..."); DBAccessor = new DatabaseAccessor(DatabaseConfiguration); DBAccessor.RegisterMappingAssembly(Assembly.GetExecutingAssembly()); DBAccessor.Initialize(); logger.Info("Opening Database..."); DBAccessor.OpenConnection(); DBAccessor.Database.ExecutingCommand += OnExecutingDBCommand; MessageReceiver.Initialize(); ProtocolTypeManager.Initialize(); HandlerManager = ServerPacketHandler.Instance; HandlerManager.RegisterAll(Assembly.GetExecutingAssembly()); ClientManager.Instance.Initialize(CreateClient); ClientManager.Instance.Start("x.x.x.x", 9250); WebServer.Initialize(); IOTaskPool = new SelfRunningTaskPool(50, "Main TaskPool"); IOTaskPool.CallPeriodically((int)TimeSpan.FromSeconds(10).TotalMilliseconds, KeepSQLConnectionAlive); IOTaskPool.CallPeriodically((int)TimeSpan.FromSeconds(10).TotalMilliseconds, WriteBufferLogs); IOTaskPool.Start(); logger.Info("Server listening at port 9250"); logger.Info("WebServer listening at port 9251"); // TeknoServer server = new TeknoServer("test", "test"); }
public FakeClientPacketHandler() { m_taskPool = new SelfRunningTaskPool(100, "Fake client task pool"); m_taskPool.Start(); }
public override void Initialize() { m_arenas = Database.Query <ArenaRecord>(ArenaRelator.FetchQuery).ToDictionary(x => x.Id); m_arenaTaskPool.CallPeriodically(ArenaMatchmakingInterval * 1000, ComputeMatchmaking); m_arenaTaskPool.Start(); }