Register for your free account! | Forgot your password?

You last visited: Today at 05:48

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

Advertisement



Help with this Plz

Discussion on Help with this Plz within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #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();
}
}
}
Petetoft99 is offline  
Old 03/27/2009, 18:29   #2
 
andyd123's Avatar
 
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
andyd123 is offline  
Old 03/27/2009, 18:37   #3
 
L1nk1n*P4rK's Avatar
 
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.
L1nk1n*P4rK is offline  
Reply




All times are GMT +1. The time now is 05:48.


Powered by vBulletin®
Copyright ©2000 - 2026, 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 ©2026 elitepvpers All Rights Reserved.