my server is changing sources from an ini source into a mysql source and i dont want to restart all the accounts.. so i just decided to code something in that will convert the main stuff like equips, levels and cps into the new mysql source.. i have the whole code with no errors but for some reason it wont update.
here is the code
also i added the actual actication code under the Creat char.. so when someone creates the char with the same username it auto gives the stuff.. this is the code i put under the creat char
anyways if u see any problem or know how to fix it id appreciate it.. thank you in advance ^^
here is the code
Code:
public static void Transfer(Client UClient)
{
Ini Transfer = new Ini(System.Windows.Forms.Application.StartupPath + @"\accounts\\" + UClient.Account + ".acc");
string CharName = Transfer.ReadValue("Account", "Charr");
Ini CharInfo = new Ini(System.Windows.Forms.Application.StartupPath + @"\characters\\" + CharName + ".chr");
string equip = CharInfo.ReadValue("Character", "Equipment");
Console.WriteLine("transfer in progress for account id " + UClient.Account + " and for char name " + CharName);
string level1 = CharInfo.ReadValue("Character", "Level");
string cps1 = CharInfo.ReadValue("Character", "CPs");
MySqlCommand Command = new MySqlCommand("UPDATE `Characters` SET `Level` = " + level1 +", `CPs` = " + cps1 + ",`Equipment` = '" + equip, Connection);
Command.ExecuteNonQuery();
}
Code:
if (System.IO.File.Exists(System.Windows.Forms.Application.StartupPath + @"\accounts\\" + UClient.Account + ".acc"))
{
DataBase.Transfer(UClient);
}