Register for your free account! | Forgot your password?

You last visited: Today at 19:39

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[help] authenticate

Discussion on [help] authenticate within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2008
Posts: 92
Received Thanks: 21
[help] authenticate

Quote:
public static byte Authenticate(string UserName, string Password)
{
try
{
MySqlDataAdapter DataAdapter = new MySqlDataAdapter();
DataAdapter = new MySqlDataAdapter("SELECT * FROM `Accounts` WHERE `AccountID` = '" + UserName + "'", Connection);
DataSet DSet = new DataSet();

DataAdapter.Fill(DSet, "Account");

if (DSet == null)
return 0;
if (DSet.Tables.Count == 0)
return 0;

if (DSet.Tables["Account"].Rows.Count > 0)
{
DataRow DR = DSet.Tables["Account"].Rows[0];

string Pass = (string)DR["Password"];
if (Pass == Password || Pass == "")
{
if (Pass == "")
{
if (DataBase.AllowQuerys)
DatabaseQueue.Enqueue(new MySqlCommand("UPDATE `Accounts` SET `Password` = '" + Password + "' WHERE `AccountID` = '" + UserName + "'", Connection));
}

uint LogonCount = (uint)DR["LogonCount"];
LogonCount++;

if (DataBase.AllowQuerys)
DatabaseQueue.Enqueue(new MySqlCommand("UPDATE `Accounts` SET `LogonCount` = " + LogonCount + " WHERE `AccountID` = '" + UserName + "'", Connection));

return Convert.ToByte((uint)DR["LogonType"]);
}
else
return 0;
}
else
return 0;
}
catch (Exception Exc) { General.WriteLine(Exc.ToString()); return 0; }
}
the **** console

Quote:
Accoun† £ogada Com Sucesso kayque IP >--> 189.69.66.198
System.InvalidOperationException: Connection must be valid and open
em MySql.Data.MySqlClient.MySqlCommand.CheckState()
em MySql.Data.MySqlClient.MySqlCommand.ExecuteReader( CommandBehavior behavior)
em MySql.Data.MySqlClient.MySqlCommand.System.Data.ID bCommand.ExecuteReader(CommandBehavior behavior)
em System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
em System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
em System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
em UltimateCo.DataBase.Authenticate(String UserName, String Password) na C:\Documents and Settings\LOST\Desktop\FuckCo\UltimateCo\DataBase.c s:linha 1205
if anyone can help me :/
reborn666 is offline  
Old 12/10/2008, 22:26   #2
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
Your mysql connection got dropped?

Not that hard if you can read english x_x


The problem is making it so it doesn't drop your connection.
tao4229 is offline  
Old 12/10/2008, 23:42   #3
 
elite*gold: 0
Join Date: Sep 2008
Posts: 92
Received Thanks: 21
@tao
you can help me fix this error?
reborn666 is offline  
Reply


Similar Threads Similar Threads
Problem with public static byte Authenticate
06/10/2010 - CO2 Private Server - 1 Replies
database.cs line 1498 public static byte Authenticate(string UserName, string Password) { try { MySqlDataAdapter DataAdapter = new MySqlDataAdapter("SELECT * FROM `Accounts` WHERE `AccountID` = '" + UserName + "'", Connection); DataSet DSet = new DataSet(); DataAdapter.Fill(DSet, "Account");
[Help]Authenticate
02/08/2010 - CO2 Private Server - 0 Replies
trying to get the 5165 to use mysql but i cant get the auth to work theres alot of stuff in the source already to deal with auth and i'm not that good at C# can someone help me add me if ya want [email protected]
[Help] Authenticate error in console
08/13/2009 - CO2 Private Server - 2 Replies
http://i783.photobucket.com/albums/yy117/archangel co08/imagembr7.jpg Can someone help me with this errors cause when this error comes out the character cant log in anymore when they got dc or they want to log in. Can someone help me with this errors... Thanks.



All times are GMT +2. The time now is 19:39.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.