Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 16:12

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

Advertisement



help pro4ever,arco,immuone help plz or any one

Discussion on help pro4ever,arco,immuone help plz or any one within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2007
Posts: 188
Received Thanks: 8
help pro4ever,arco,immuone help plz or any one

PHP Code:
        public static Main.AuthWorker.AuthInfo Authenticate(string Userstring Password)
        {

            
Main.AuthWorker.AuthInfo Info = new NewestCOServer.Main.AuthWorker.AuthInfo();
            
Info.Account User;
            try
            {
               

                
MySqlDataAdapter DataAdapter null;
                
DataAdapter = new MySqlDataAdapter("SELECT * FROM `Accounts` WHERE `AccountID` = '" User "'"ReadConnection);//read
                
DataSet DSet = new DataSet();

                
DataAdapter.Fill(DSet"Account");

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

                    
string RealAccount = (string)DR["AccountID"];
                    if (
User == RealAccount)
                    {
                        
string RealPassword = (string)DR["Password"];
                        if (
RealPassword == "")
                        {
                            
MySqlCommand cmd = new MySqlCommand("UPDATE `accounts` set `Password` = '" Password "' WHERE `AccountID` = '" RealAccount "'"WriteConnection);//white
                            
cmd.ExecuteNonQuery();
                            
Info.Status = (string)DR["Status"];
                            
Info.Character = (string)DR["Character"];
                            if (
Info.Character == "")
                                
Info.LogonType 2;
                            else
                                
Info.LogonType 1;
                            return 
Info;
                        }

                        if (
RealPassword == Password)
                        {

                            
Info.Status = (string)DR["Status"];
                            
Info.Character = (string)DR["Character"];
                            if (
Info.Character == "")
                                
Info.LogonType 2;
                            else
                                
Info.LogonType 1;
                        }
                        else
                            
Info.LogonType 255;
                    }
                    else
                        
Info.LogonType 255;
                }
            }
            catch (
Exception Exc) { Program.WriteLine(Exc); }
            return 
Info;
        } 
this code of account Authenticate
i get error when server running say DataAdapter must be close and then i cant loging in to my server

plz i want code to close DataAdapter if it open every 1 second

and here pic
koko425 is offline  
Old 09/07/2010, 18:59   #2
 
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,376
Well it's saying that there is already a data reader in progress....

Seeing as you have things like 'tables' I assume this is for sql?

Try using the awesome sql wrapper that immune made. You can find the .dll for it in the elite-coemu project.

Try using that and see if you have better luck. It handles all the details of opening and closing connections to the database and iirc queues requests so that sql cannot become overloaded or clogged up.

past that I can't be of that much use really as I'm not familiar with the database functions you are using and the problems they are susceptible to.
pro4never is offline  
Thanks
1 User
Old 09/07/2010, 23:05   #3
 
elite*gold: 0
Join Date: Sep 2007
Posts: 188
Received Thanks: 8
Quote:
Originally Posted by pro4never View Post
Well it's saying that there is already a data reader in progress....

Seeing as you have things like 'tables' I assume this is for sql?

Try using the awesome sql wrapper that immune made. You can find the .dll for it in the elite-coemu project.

Try using that and see if you have better luck. It handles all the details of opening and closing connections to the database and iirc queues requests so that sql cannot become overloaded or clogged up.

past that I can't be of that much use really as I'm not familiar with the database functions you are using and the problems they are susceptible to.
can you share it if you have or give me link to download it
koko425 is offline  
Old 09/07/2010, 23:25   #4
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,765
Received Thanks: 5,291
It is in his exodus source thread.
Arcо is offline  
Reply




All times are GMT +2. The time now is 16:12.


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.