You last visited: Today at 18:24
Advertisement
Help with this Plz
Discussion on Help with this Plz within the CO2 Private Server forum part of the Conquer Online 2 category.
03/27/2009, 18:21
#1
elite*gold: 0
Join Date: Feb 2009
Posts: 47
Received Thanks: 2
Help with this Plz
Ok the Code below is my SaveChar some reason it keeps Crashing the server think someone can help me with this? Command.ExecuteNonQuery();<<<<<IS line 318 in my Database.cs makes it crash
public static void SaveChar(Character Charr)
{
try
{
Reader.Close();
Charr.PackInventory();
Charr.PackEquips();
Charr.PackSkills();
Charr.PackProfs();
Charr.PackWarehouses();
Charr.PackEnemies();
Charr.PackFriends();
MySqlCommand Command = new MySqlCommand("UPDATE `Characters` SET `CharName` = '" + Charr.Name + "',`DoubleExp` = '" + Charr.DExp2 + "', `Level` = " + Charr.Level + ",`Exp` = " + Charr.Exp.ToString() + /*"', `OfflineTG` = " + Charr.OfflineTG +*/ ",`GuildDonation` = " + Charr.GuildDonation + ",`Strength` = " + Charr.Str + ",`Agility` = " + Charr.Agi + ",`Vitality` = " + Charr.Vit + ",`Spirit` = " + Charr.Spi + ",`Job` = " + Charr.Job + ",`Model` = " + Charr.RealModel + ",`Money` = " + Charr.Silvers + ",`CPs` = " + Charr.CPs + ",`CurrentHP` = " + Charr.CurHP + ",`StatPoints` = " + Charr.StatP + ",`MyGuild` = " + Charr.GuildID + ",`GuildPos` = " + Charr.GuildPosition + ",`LocationMap` = " + Charr.LocMap + ",`LocationX` = " + Charr.LocX + ",`LocationY` = " + Charr.LocY + ",`Hair` = " + Charr.Hair + ",`Equipment` = '" + Charr.PackedEquips + "',`Inventory` = '" + Charr.PackedInventory + "',`PKPoints` = " + Charr.PKPoints + ",`PrevMap` = " + Charr.PrevMap + ", `Skills` = '" + Charr.PackedSkills + "', `Profs` = '" + Charr.PackedProfs + "',`RBCount` = " + Charr.RBCount + ",`Avatar` = " + Charr.Avatar + ",`WHMoney` = " + Charr.WHSilvers + ",`VP` = " + Charr.VP + ",`Warehouses` = '" + Charr.PackedWHs + "',`Friends` = '" + Charr.PackedFriends + "',`Enemies` = '" + Charr.PackedEnemies + "',`QuestMob` = '" + Charr.QuestMob + "',`QuestKO` = " + Charr.QuestKO + ",`CurrentMP` = " + Charr.CurMP + ",`PrevJob` = " + Charr.PrevJob + ",`LuckyTime` = '" + Charr.LuckyTime + "' WHERE `Account` = '" + Charr.MyClient.Account + "';", Database.Connection);
Command.ExecuteNonQuery();<<<<<IS line 318 in my Database.cs makes it crash
}
catch (Exception Exc)
{
General.WriteLine(Convert.ToString(Exc));
if (World.SaveAllChars())
{
General.WriteLine("Connection to mysql server reinitiated");
}
else
{
General.WriteLine("Connection Error, server restarting! " + DateTime.Now);
General.ServerRestart();
}
}
}
03/27/2009, 18:29
#2
elite*gold: 20
Join Date: Apr 2006
Posts: 1,341
Received Thanks: 886
If you want help with this, you'll have to post the exact error that is being thrown, and not just the line it is on.
With this error it is possible to determine what the actual problem is.
Thanks,
Andy
03/27/2009, 18:37
#3
elite*gold: 0
Join Date: Mar 2008
Posts: 303
Received Thanks: 39
Becouse Is LOFT I Will Help You:
The Problem Is In DataBase.cs
At line:
Code:
MySqlCommand Command = new MySqlCommand("UPDATE `Characters` SET `CharName` = '" + Charr.Name + "',`DoubleExp` = '" + Charr.DExp2 + "', `Level` = " + Charr.Level + ",`Exp` = " + Charr.Exp.ToString() + /*"', `OfflineTG` = " + Charr.OfflineTG +*/ ",`GuildDonation` = " + Charr.GuildDonation + ",`Strength` = " + Charr.Str + ",`Agility` = " + Charr.Agi + ",`Vitality` = " + Charr.Vit + ",`Spirit` = " + Charr.Spi + ",`Job` = " + Charr.Job + ",`Model` = " + Charr.RealModel + ",`Money` = " + Charr.Silvers + ",`CPs` = " + Charr.CPs + ",`CurrentHP` = " + Charr.CurHP + ",`StatPoints` = " + Charr.StatP + ",`MyGuild` = " + Charr.GuildID + ",`GuildPos` = " + Charr.GuildPosition + ",`LocationMap` = " + Charr.LocMap + ",`LocationX` = " + Charr.LocX + ",`LocationY` = " + Charr.LocY + ",`Hair` = " + Charr.Hair + ",`Equipment` = '" + Charr.PackedEquips + "',`Inventory` = '" + Charr.PackedInventory + "',`PKPoints` = " + Charr.PKPoints + ",`PrevMap` = " + Charr.PrevMap + ", `Skills` = '" + Charr.PackedSkills + "', `Profs` = '" + Charr.PackedProfs + "',`RBCount` = " + Charr.RBCount + ",`Avatar` = " + Charr.Avatar + ",`WHMoney` = " + Charr.WHSilvers + ",`VP` = " + Charr.VP + ",`Warehouses` = '" + Charr.PackedWHs + "',`Friends` = '" + Charr.PackedFriends + "',`Enemies` = '" + Charr.PackedEnemies + "',`QuestMob` = '" + Charr.QuestMob + "',`QuestKO` = " + Charr.QuestKO + ",`CurrentMP` = " + Charr.CurMP + ",`PrevJob` = " + Charr.PrevJob + ",`LuckyTime` = '" + Charr.LuckyTime + "' WHERE `Account` = '" + Charr.MyClient.Account + "';", Database.Connection);
Command.ExecuteNonQuery();
Now why you are gething this problem?
Becouse the server want to Save your Character but the DB (From MySQL) dont contain 1 (or more) from this Tables.
All times are GMT +2. The time now is 18:25 .