LobbyServer.Databases.Load C# (CSharp) Method

Load() public static method

public static Load ( bool first_load = false ) : void
first_load bool
return void
        public static void Load(bool first_load = false)
        {
            AccountTable.Load();
            CharacterTable.Load();
            if(first_load) Reset();
        }

Usage Example

Esempio n. 1
0
        static void Main(string[] args)
        {
            Log.Info("LobbyServer", "Starting...");
            if (!EasyServer.InitLog("Lobby", "Configs/Logs.conf") || !EasyServer.InitConfig("Configs/Lobby.xml", "Lobby") || !EasyServer.InitConfig("Configs/Database.xml", "Database"))
            {
                return;
            }
            if (!EasyServer.Listen <TcpServer>(EasyServer.GetConfValue <int>("Lobby", "LoginServer", "Port"), "LoginServer"))
            {
                return;
            }
            worldListener = new World.Listener(EasyServer.GetConfValue <string>("Lobby", "WorldListener", "IP"), EasyServer.GetConfValue <int>("Lobby", "WorldListener", "Port"));
            Databases.InitDB();
            Databases.Load(true);

            try
            {
                HttpServer.MapHandlers();
                HttpServer server = new HttpServer();
                server.Start();
            }
            catch
            {
                Log.Error("HTTP", "If you want to use HTTP stuff, start this server with Admin rights");
            }

            Log.Succes("LobbyServer", "Server initialisation complete!");
            clients.Clear();
            worlds.Clear();
            Timer aTimer = new Timer(1000);

            aTimer.Elapsed  += OnTimedEvent;
            aTimer.AutoReset = true;
            aTimer.Enabled   = true;
            Log.Enter();
            Console.WriteLine("For available console commands, type /commands");
            Log.Enter();
            bool done = false;

            while (!done)
            {
                string command;
                command = Console.ReadLine();
                ProccessCommand(command);
            }
            EasyServer.StartConsole();
        }
All Usage Examples Of LobbyServer.Databases::Load