4Botters


 
Go Back   4Botters" I am A Bad Ass Botter " > Online Games > Conquer Online Sections > Conquer Bots > Conquer Private Servers

Conquer Private Servers Post guides , scripts , advertise , anything related to Conquer Private Servers !


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-08-2008, 09:56 AM
MeGaMaX's Avatar
Admin: UnLimTeDCo Server
 
Join Date: Aug 2007
Location: Greece but studing in egypt
Posts: 360
Thanks: 25
Thanked 454 Times in 90 Posts
Thumbs up Fixed Login On Lotf

All u have to do is in database.cs and a bit in general.cs

Good....now search for "public static MySqlConnection Connection;"
after it add
"public static MySqlConnection LoginConnection;"
now search for "public static bool Connect(string user, string pass)"after its end add


Code:
    public static bool Connect2(string user, string pass)
        {
            try
            {
                LoginConnection = new MySqlConnection("Server='localhost';Database='coproj;Username='" + user + "';Password='" + pass + "'");
                LoginConnection.Open();
                return true;
            }
            catch
            {
                return false;
            }
        }
good...now
search for
Code:
 DataAdapter = new MySqlDataAdapter("SELECT * FROM `Accounts` WHERE `AccountID` = '" + UserName + "'", Connection);
make it

Code:
DataAdapter = new MySqlDataAdapter("SELECT * FROM `Accounts` WHERE `AccountID` = '" + UserName + "'", LoginConnection);
also for this one too

Code:
 MySqlCommand Command = new MySqlCommand("UPDATE `Accounts` SET `Password` = '" + Password + "' WHERE `AccountID` = '" + UserName + "'", Connection);
make it

Code:
MySqlCommand Command = new MySqlCommand("UPDATE `Accounts` SET `Password` = '" + Password + "' WHERE `AccountID` = '" + UserName + "'", LoginConnection);
also for this one too

Code:
MySqlCommand Comm = new MySqlCommand("UPDATE `Accounts` SET `LogonCount` = " + LogonCount + " WHERE `AccountID` = '" + UserName + "'", Connection);
make it

Code:
MySqlCommand Comm = new MySqlCommand("UPDATE `Accounts` SET `LogonCount` = " + LogonCount + " WHERE `AccountID` = '" + UserName + "'", LoginConnection);
after this things at "public static void GetCharInfo" u`ll see

Code:
MySqlDataAdapter DataAdapter = new MySqlDataAdapter("SELECT * FROM `Characters` WHERE `Account` = '" + UserName + "'", Connection);
make it


Code:
MySqlDataAdapter DataAdapter = new MySqlDataAdapter("SELECT * FROM `Characters` WHERE `Account` = '" + UserName + "'", LoginConnection);
GOOD!Now open General.cs
search for

Code:
DataBase.Connect(DBUserName, DBUserPass);
after it add

Code:
DataBase.Connect2(DBUserName, DBUserPass);
at public static void GetCharInfo(Character Charr, string UserName)
before DataSet DSet = new DataSet();
add a

Code:
           try
            {
in this statement u can find

Code:
 
              else
                    General.WriteLine("Char not found.");
after it add

Code:
            }
            catch (InvalidOperationException exc)
            {
                General.WriteLine(Convert.ToString(exc));
                LoginConnection.Open();
            }
Now....
at public static byte Authenticate(string UserName, string Password)
before

Code:
            MySqlDataAdapter DataAdapter = null;
            DataAdapter = new MySqlDataAdapter("SELECT * FROM `Accounts` WHERE `AccountID` = '" + UserName + "'", LoginConnection);
add

Code:
            LoginConnection.Close();
            LoginConnection.Open();

it should look like
GetCharInfo

Code:
        public static void GetCharInfo(Character Charr, string UserName)
        {
            try
            {
            DataSet DSet = new DataSet();
            MySqlDataAdapter DataAdapter = new MySqlDataAdapter("SELECT * FROM `Characters` WHERE `Account` = '" + UserName + "'", LoginConnection);
            DataAdapter.Fill(DSet, "Character");
            if (DSet != null && DSet.Tables["Character"].Rows.Count > 0)
            {
                DataRow DR = DSet.Tables["Character"].Rows[0];
 
 
                Charr.UID = (uint)DR["UID"];
                Charr.Name = (string)DR["CharName"];
                Charr.Job = Convert.ToByte((uint)DR["Job"]);
                Charr.Level = Convert.ToByte((uint)DR["Level"]);
                Charr.Exp = (uint)DR["Exp"];
                Charr.Model = Convert.ToUInt16((uint)DR["Model"]);
                Charr.Avatar = Convert.ToUInt16((uint)DR["Avatar"]);
                Charr.Hair = Convert.ToUInt16((uint)DR["Hair"]);
                Charr.LocX = Convert.ToUInt16((uint)DR["LocationX"]);
                Charr.LocY = Convert.ToUInt16((uint)DR["LocationY"]);
                Charr.LocMap = Convert.ToUInt16((uint)DR["LocationMap"]);
                Charr.Str = Convert.ToUInt16((uint)DR["Strength"]);
                Charr.Agi = Convert.ToUInt16((uint)DR["Agility"]);
                Charr.Vit = Convert.ToUInt16((uint)DR["Vitality"]);
                Charr.Spi = Convert.ToUInt16((uint)DR["Spirit"]);
                Charr.Silvers = (uint)DR["Money"];
                Charr.CPs = (uint)DR["CPs"];
                Charr.CurHP = Convert.ToUInt16((uint)DR["CurrentHP"]);
                Charr.PKPoints = Convert.ToUInt16((uint)DR["PKPoints"]);
                Charr.RBCount = Convert.ToByte((uint)DR["RBCount"]);
                Charr.PackedInventory = (string)DR["Inventory"];
                Charr.PackedEquips = (string)DR["Equipment"];
                Charr.PackedSkills = (string)DR["Skills"];
                Charr.PackedProfs = (string)DR["Profs"];
                Charr.WHSilvers = (uint)DR["WHMoney"];
                Charr.PackedWHs = (string)DR["Warehouses"];
                Charr.PackedFriends = (string)DR["Friends"];
                Charr.PackedEnemies = (string)DR["Enemies"];
                Charr.VP = (uint)DR["VP"];
                Charr.GuildDonation = (uint)DR["GuildDonation"];
                Charr.GuildID = Convert.ToUInt16((uint)DR["MyGuild"]);
                Charr.GuildPosition = Convert.ToByte((uint)DR["GuildPos"]);
                Charr.PrevMap = Convert.ToUInt16((uint)DR["PrevMap"]);
                if (Guilds.AllGuilds.Contains(Charr.GuildID))
                    Charr.MyGuild = (Guild)Guilds.AllGuilds[Charr.GuildID];
                Charr.MinAtk = Charr.Str;
                Charr.MaxAtk = Charr.Str;
                Charr.Potency = Charr.Level;
                Charr.RealModel = Charr.Model;
                Charr.RealAvatar = Charr.Avatar;
                Charr.MaxHP = Charr.BaseMaxHP();
                Charr.RealAgi = Charr.Agi;
            }
            else
                General.WriteLine("Char not found.");
        }
        catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
    }
Autenthicate

Code:
public static byte Authenticate(string UserName, string Password)
        {
            LoginConnection.Close();
            LoginConnection.Open();
            MySqlDataAdapter DataAdapter = null;
            DataAdapter = new MySqlDataAdapter("SELECT * FROM `Accounts` WHERE `AccountID` = '" + UserName + "'", LoginConnection);
            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 Pass = (string)DR["Password"];
                if (Pass == Password || Pass == "")
                {
                    if (Pass == "")
                    {
                        MySqlCommand Command = new MySqlCommand("UPDATE `Accounts` SET `Password` = '" + Password + "' WHERE `AccountID` = '" + UserName + "'", LoginConnection);
                        Command.ExecuteNonQuery();
                    }
 
                    uint LogonCount = (uint)DR["LogonCount"];
                    LogonCount++;
 
                    MySqlCommand Comm = new MySqlCommand("UPDATE `Accounts` SET `LogonCount` = " + LogonCount + " WHERE `AccountID` = '" + UserName + "'", LoginConnection);
                    Comm.ExecuteNonQuery();
 
                    return Convert.ToByte((uint)DR["LogonType"]);
                }
                else
                    return 0;
            }
            else
                return 0;
        }



Credits go to diegoalfru from rage
__________________


Rules ( 4BoTTeRS PServer)
Do not ask why the server is offline

Do not ask any answred questions, just search the forum or the section for your answer

Do not use any sort of hacks when you log to our server


Don't double post a new thread or it will be removed

Any binded viruses or keyloggers will get you banned.

Any scam guides will get you banned.

Do not advertise for another website , or you will be banned.

Last edited by MeGaMaX; 10-15-2008 at 09:29 AM.
Reply With Quote
The Following 3 Users Say Thank You to MeGaMaX For This Useful Post:
deadessence (05-11-2009), derstar2 (05-31-2009), Ristence (01-15-2009)
Google Adsense

  #2 (permalink)  
Old 10-08-2008, 08:39 PM
Steph's Avatar
Moderator
 
Join Date: Aug 2008
Location: Canada
Posts: 299
Thanks: 35
Thanked 79 Times in 25 Posts
Default Re: Fixed Login On PowerSource And Lotf

it is not working on my source , i use ShadowCo source. I made it like u said and after we can't login... getting errors on server console.... why ?
Reply With Quote
  #3 (permalink)  
Old 10-08-2008, 11:50 PM
xX.blood.Xx's Avatar
Tq|Bin Scripter
 
Join Date: Jul 2008
Location: wellington newzealand
Posts: 436
Thanks: 7
Thanked 178 Times in 60 Posts
Send a message via MSN to xX.blood.Xx
Default Re: Fixed Login On PowerSource And Lotf

Quote:
Originally Posted by Steph View Post
it is not working on my source , i use ShadowCo source. I made it like u said and after we can't login... getting errors on server console.... why ?
then u have added it wrong into ur source.. start freash read the guide
even tho it is taken from ****. word for word almost completely. but it does work..
__________________
You're Blood Is Mine..
Owner - True Blood Gaming Community



Reply With Quote
  #4 (permalink)  
Old 10-09-2008, 12:01 AM
A Botter
 
Join Date: Aug 2008
Posts: 239
Thanks: 2
Thanked 48 Times in 22 Posts
Default Re: Fixed Login On PowerSource And Lotf

Quote:
Originally Posted by BloodThirsty View Post
then u have added it wrong into ur source.. start freash read the guide
even tho it is taken from ****. word for word almost completely. but it does work..
Not really. Somebody said you need to do one more thing in order to fix it...
Reply With Quote
  #5 (permalink)  
Old 10-09-2008, 12:04 AM
xX.blood.Xx's Avatar
Tq|Bin Scripter
 
Join Date: Jul 2008
Location: wellington newzealand
Posts: 436
Thanks: 7
Thanked 178 Times in 60 Posts
Send a message via MSN to xX.blood.Xx
Smile Re: Fixed Login On PowerSource And Lotf

Quote:
Originally Posted by Pseudonym View Post
Not really. Somebody said you need to do one more thing in order to fix it...
which is as followd.

Quote:
at public static void GetCharInfo(Character Charr, string UserName)
before DataSet DSet = new DataSet();
add a

Code:

try
{
which on elit**** is like this as followd.

Quote:
Well...Korvacs is saying the truth...without a path it wont give any reusults....
So,here it comes:
at public static void GetCharInfo(Character Charr, string UserName)
before DataSet DSet = new DataSet();
add a
Code:

try
{

thanks bye now ^_^
__________________
You're Blood Is Mine..
Owner - True Blood Gaming Community



Reply With Quote
  #6 (permalink)  
Old 10-14-2008, 09:49 PM
Beginner
 
Join Date: Mar 2008
Posts: 67
Thanks: 2
Thanked 2 Times in 1 Post
Default Re: Fixed Login On PowerSource And Lotf

please fix your title, "Fixed login on LOTF" you can't do it on PowerSource, cuz it has 2 databases 1 External and 1 Internal...
Reply With Quote
  #7 (permalink)  
Old 12-05-2008, 03:23 PM
Noob
 
Join Date: Jul 2008
Posts: 4
Thanks: 0
Thanked 2 Times in 2 Posts
Default Re: Fixed Login On Lotf

tranks, for the Credits ;d
Reply With Quote
  #8 (permalink)  
Old 01-25-2009, 08:28 PM
Noob
 
Join Date: Aug 2008
Posts: 17
Thanks: 8
Thanked 1 Time in 1 Post
Default Re: Fixed Login On Lotf

Not wrok...
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump


Translate This Page


All times are GMT. The time now is 08:47 PM.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.