|
You last visited: Today at 12:41
Advertisement
[help]
Discussion on [help] within the CO2 Private Server forum part of the Conquer Online 2 category.
09/24/2008, 06:18
|
#1
|
elite*gold: 0
Join Date: Sep 2008
Posts: 92
Received Thanks: 21
|
[help]CHAR DONT SAVE
does not save my char, I get to play the inside and out, when parents get him in the same place
Quote:
public static void SaveAllChars()
{
try
{
foreach (DictionaryEntry DE in AllChars)
{
Character Charr = (Character)DE.Value;
DataBase.SaveChar(Charr);
}
Guilds.SaveAllGuilds();
}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
}
|
and
Quote:
public static void SaveChar(Character Charr)
{
try
{
Charr.PackInventory();
Charr.PackEquips();
Charr.PackSkills();
Charr.PackProfs();
Charr.PackWarehouses();
Charr.PackEnemies();
Charr.PackFriends();
if (DataBase.AllowQuerys)
DataBase.DatabaseQueue.Enqueue(new MySqlCommand("UPDATE `Characters` SET `CharName` = '" + Charr.Name + "', `Level` = " + Charr.Level + ",`Exp` = " + Charr.Exp + ",`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 + " WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection));
}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
}
|
cant help me
|
|
|
09/24/2008, 06:24
|
#2
|
elite*gold: 0
Join Date: Jul 2007
Posts: 255
Received Thanks: 273
|
Go to DataBase.cs
Add in
public static void SaveChar(Character Charr)
{
try
{
Charr.PackInventory();
Charr.PackEquips();
Charr.PackSkills();
Charr.PackProfs();
Charr.PackWarehouses();
Charr.PackEnemies();
Charr.PackFriends();
MySqlCommand Command = new MySqlCommand("UPDATE `Characters` SET `CharName` = '" + Charr.Name + "', `Level` = " + Charr.Level + ",`Exp` = " + Charr.Exp + ",`GuildDonation` = " + Charr.GuildDonation + ",`Strength` = " + Charr.Str + ",`Agility` = " + Charr.Agi + ",`Vitality` = " + Charr.Vit + ",`Spirit` = " + Charr.Spi + ",`Job` = " + Charr.Job + ",`Model` = " + Charr.Model + ",`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 + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
Command.ExecuteNonQuery();
}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
}
and add in
using MySql.Data.MySqlClient;
its fixed Bug
|
|
|
09/24/2008, 06:49
|
#3
|
elite*gold: 0
Join Date: Sep 2008
Posts: 92
Received Thanks: 21
|
Quote:
Originally Posted by felipeboladao
Go to DataBase.cs
Add in
public static void SaveChar(Character Charr)
{
try
{
Charr.PackInventory();
Charr.PackEquips();
Charr.PackSkills();
Charr.PackProfs();
Charr.PackWarehouses();
Charr.PackEnemies();
Charr.PackFriends();
MySqlCommand Command = new MySqlCommand("UPDATE `Characters` SET `CharName` = '" + Charr.Name + "', `Level` = " + Charr.Level + ",`Exp` = " + Charr.Exp + ",`GuildDonation` = " + Charr.GuildDonation + ",`Strength` = " + Charr.Str + ",`Agility` = " + Charr.Agi + ",`Vitality` = " + Charr.Vit + ",`Spirit` = " + Charr.Spi + ",`Job` = " + Charr.Job + ",`Model` = " + Charr.Model + ",`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 + "' WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
Command.ExecuteNonQuery();
}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
}
and add in
using MySql.Data.MySqlClient;
its fixed Bug
|
the char save more fixed? lol ur code is a shit look
Quote:
System.InvalidOperationException: Connection must be valid and open
at MySql.Data.MySqlClient.MySqlCommand.CheckState()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuer y()
at COServer_Project.DataBase.SaveChar(Character Charr) in DataBase.cs:line 1376
|
|
|
|
All times are GMT +2. The time now is 12:41.
|
|