Exemple #1
0
        public AuthState(Socket socket)
        {
            // Socket objects
            this.Socket = socket;
            this.Alive  = true;
            buffer      = new byte[2048];

            Cryptographer = new AuthCryptography();
        }
Exemple #2
0
        static void Main(string[] args)
        {
            StartDate     = DateTime.Now;
            Console.Title = "Konquer - AuthServer";

            var    cfgFile  = new IniFile("Config.ini");
            int    Port     = cfgFile.ReadInt32("Server", "AuthPort", 0);
            string host     = cfgFile.ReadString("MySql", "Host"),
                   username = cfgFile.ReadString("MySql", "Username"),
                   password = cfgFile.ReadString("MySql", "Password"),
                   database = cfgFile.ReadString("MySql", "Database");

            var stringBuilder = new MySqlConnectionStringBuilder();

            stringBuilder.Server   = host;
            stringBuilder.UserID   = username;
            stringBuilder.Password = password;
            stringBuilder.Database = database;
            connectionString       = stringBuilder.GetConnectionString(true);

            using (var testConn = new MySqlConnection(connectionString))
            {
                try
                {
                    testConn.Open();
                    Console.WriteLine("Valid connection string.");
                }
                catch (Exception e)
                {
                    Console.WriteLine($"[DBError] {e.Message}.");
                    Console.ReadLine();
                    return;
                }
            }

            Servers.LoadInfo();
            AuthCryptography.PrepareAuthCryptography();
            AuthServer = new Socks(Port, 0);

            while (true)
            {
                HandleCommands();
            }
        }
 public LoginPlayer(NetworkClient client)
 {
     Socket        = client;
     Cryptographer = new AuthCryptography();
     SendBuffer    = new byte[BaseSendBufferSize];
 }