Ejemplo n.º 1
0
    static void Main(string[] args)
    {
        // Set console title.
        Console.Title = "Epic Dragon World - Game Server";

        // Keep start time for later.
        DateTime serverLoadStart = DateTime.Now;

        LogManager.Init();
        Config.Load();
        DatabaseManager.Init();
        WorldManager.Init();

        SkillData.Load();
        ItemData.Load();

        // Post info.
        Util.PrintSection("Info");
        LogManager.Log("Server loaded in " + Math.Round((DateTime.Now - serverLoadStart).TotalSeconds, 2) + " seconds.");

        // Initialize async network listening.
        Task.Run(() => GameClientNetworkListener.Init());

        // Wait.
        Console.CancelKeyPress += (sender, eArgs) =>
        {
            QUIT_EVENT.Set();
            eArgs.Cancel = true;
        };
        QUIT_EVENT.WaitOne();
    }
    static void Main(string[] args)
    {
        // Set console title.
        Console.Title = "Epic Dragon World - Game Server";

        // Keep start time for later.
        DateTime serverLoadStart = DateTime.Now;

        // Create Log directory used by LogManager.
        Directory.CreateDirectory("Log");

        PrintSection("Configs");
        Config.Load();

        PrintSection("Database");
        DatabaseManager.Init();

        // Post info.
        PrintSection("Info");
        LogManager.Log("Server loaded in " + (DateTime.Now - serverLoadStart).TotalSeconds + " seconds.");

        // Initialize async network listening.
        Task.Run(() => GameClientNetworkListener.Init());

        // Wait.
        Console.CancelKeyPress += (sender, eArgs) =>
        {
            quitEvent.Set();
            eArgs.Cancel = true;
        };
        quitEvent.WaitOne();
    }