public bool InitializeLoginServer() { Log.WriteExt(@"#color$gre .-'''-. __ .----------. _____ "); Log.WriteExt(@"#color$gre ' _ \ ...-' |`. / /..-'''-. / / "); Log.WriteExt(@"#color$gre . / /` '. \| | | / ______.' \.-'''\ \ / / "); Log.WriteExt(@"#color$gre .'| . | \ '.... | | / /_ | | / / "); Log.WriteExt(@"#color$gre .' | | ' | ' -| | | / '''--. __/ / / / "); Log.WriteExt(@"#color$gre < | \ \ / / | | | '___ `. |_ '. / / __ "); Log.WriteExt(@"#color$gre | | ____`. ` ..' / ...' `--' `'. | `. \ / / | | "); Log.WriteExt(@"#color$gre | | \ .' '-...-'` | |`. ) | \ '. / ' | | "); Log.WriteExt(@"#color$gre | |/ . ` --------\ |......-' / , | / '----| |---. "); Log.WriteExt(@"#color$gre | /\ \ `---------' \ _..'` | |/ | | | "); Log.WriteExt(@"#color$gre | | \ \ '------''' / ,''----------| |---' "); Log.WriteExt(@"#color$gre ' \ \ \ -....--' / | | "); Log.WriteExt(@"#color$gre '------' '---' `.. __..-' /____\ "); Log.WriteLine("Loading Version Tables..."); if (!DbAgent.LoadVersionList(ref m_CurrentVersion, false)) { Log.WriteExt("#color$red\t\t[ FAIL ]"); Log.WriteLine("Press Any Key....."); Console.ReadKey(); Environment.Exit(0); } if (!DbAgent.LoadServers(ref m_Servers, true)) { Log.WriteLine("Loading Version Tables..."); Log.WriteExt("#color$red\t\t[ FAIL ]"); Log.WriteLine("Press Any Key....."); Console.ReadKey(); Environment.Exit(0); } if (!DbAgent.LoadServerList(ref m_ServerList, false)) { Log.WriteLine("Loading Version Tables..."); Log.WriteExt("#color$red\t\t[ FAIL ]"); Log.WriteLine("Press Any Key....."); Console.ReadKey(); Environment.Exit(0); } Log.WriteLine("Login Server Started Version : " + m_CurrentVersion.OrderByDescending(i => i.sVersion).FirstOrDefault().sVersion); return(true); }
private void HandleLogin() { Packet result = new Packet((byte)LogonOpcodes.LS_LOGIN_REQ); string Account = pkt.ReadString().TrimEnd(); string Password = pkt.ReadString().TrimEnd(); LoginErrorCode status = DbAgent.LoginReq(Account, Password); result.Append((byte)status); if (status == LoginErrorCode.AUTH_SUCCESS) { result.Append((UInt16)(DbAgent.GetPremiumTime(Account) / 30)); result.Append(Account); } SendPacket(result, client); }