public static void VerifyUser(Packet packet) { using (var dbCon = new MySQLDatabaseConnection(System.Net.IPAddress.Parse("127.0.0.1"), "exceeddb")) { Packet sendPacket; dbCon.Username = "******"; dbCon.Password = "******"; dbCon.Connect(); string command = string.Format("SELECT `username` FROM `adminDB` WHERE `username`='{0}'", packet.Username); bool ver = dbCon.SearchForBoolean(command, null); if (ver) { ConsoleUtils.Print(string.Format("[{0}]'s Request: Logging in to the server [{1}]", packet.ClientIP, packet.Username)); sendPacket = PacketParser.CreatePacketWithToken(ResponseEnum.Confirm, packet.Token); } else { ConsoleUtils.Print(string.Format("[{0}]'s Denied: Logging in with wrong username [{1}]", packet.ClientIP, packet.Username)); sendPacket = PacketParser.CreatePacketWithToken(ResponseEnum.Failure, packet.Token); } packet.Stream.Write(sendPacket.GetBytes(), 0, sendPacket.Length); command = string.Empty; } }