/* Copyright 2010 © by YeZZx aka Crunkx */
using System;
using System.Collections.Generic;
using System.Text;
using LoginServer;
using System.IO;
using System.Reflection;
using System.Runtime;
using System.Runtime.CompilerServices;
using System.Security;
using System.Threading;
using MySql.Data.MySqlClient;
namespace LoginServer
{
    class cMain
    {

        public static void WriteLine(string Tag, string Message)
        {
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.Write("[");
            Console.ForegroundColor = ConsoleColor.DarkRed;
            Console.Write(Tag);
            Console.ForegroundColor = ConsoleColor.Yellow;
            Console.Write("] » ");//»
            Console.ForegroundColor = ConsoleColor.DarkRed;
            Console.Write(Message);
            Console.ForegroundColor = ConsoleColor.White;
            Console.WriteLine();
        }

        public static object threadLock = "0"; // Thread Locking Value
        private static cLogSystem LogSystemClass = new cLogSystem();
        public static cConfig.cfgTable Config = new cConfig().ConfigTable;
        public static cDatabase DBClass = new cDatabase();
        public static cServer ServerClass = new cServer();
        public static cServerInfo ServerInfoClass = new cServerInfo();

            static void Main(string[] args)
            {
                ServerClass.SetUpHandlers();
                if (DBClass.Connect())
                {
                    WriteLine("MySQL", "Succesful Connected to Database!");
                    if (ServerClass.startServer())
                    {
                        WriteLine("Login", "Server succesful Startet!");
                        WriteLine("Manager", "Waiting for Connections...");
                    }
                    else
                    {
                        WriteLine("Login","Error Starting Server!");
                        Console.Read();
                        
                    }
                }
                else
                {
                    WriteLine("MySQL", "Error connecting to database!");
                    Console.Read();
                }
                
            }

        }
    }
/* Copyright 2010 © by YeZZx aka Crunkx */