|
You last visited: Today at 13:12
Advertisement
[Help] StatP wont save
Discussion on [Help] StatP wont save within the CO2 Private Server forum part of the Conquer Online 2 category.
11/01/2008, 18:05
|
#1
|
elite*gold: 0
Join Date: Feb 2008
Posts: 240
Received Thanks: 10
|
[Help] StatP wont save
Okay guys I really tired to fix it before i posted but i have no clue what to do now i would appricate your help and give you a thanks after . but there is what i tryed and it failed i no i musta put it in the wrong area but here.
Code:
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.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 + "','StatP' = " + Charr.StatP + " WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
Command.ExecuteNonQuery();
}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc));}
}
You think you could help me? Thanks
|
|
|
11/01/2008, 18:16
|
#2
|
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
|
the fix is too hard for u =))
in database.cs at public static void GetCharInfo(Character Charr, string UserName)
add the line:
Charr.StatP = Convert.ToUInt16((uint)DR["StatPoints"]);
btw i knew in mysql was StatPoints not "StatP"
Code:
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.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 + "','[U]StatP[/U]' = " + Charr.StatP + " WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
Command.ExecuteNonQuery();
}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc));}
}
the real one shoud be :
Code:
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.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 + "','StatPoints' = " + Charr.StatP + " WHERE `Account` = '" + Charr.MyClient.Account + "'", Connection);
Command.ExecuteNonQuery();
}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc));}
}
|
|
|
11/01/2008, 19:08
|
#3
|
elite*gold: 0
Join Date: Feb 2008
Posts: 240
Received Thanks: 10
|
O Ty lemme try it brb like 2 mins
2 mins later
Okay didn't work. Im tlking about how u get rb right. And then u get attibute. And then u put them on strengh and stuff. But it never saves . any ideas? why
and then here's an error i get.
Quote:
DiamondCO Loaded 1026 NPCs.
Loaded 37 Mobs.
DiamondCO Loaded 11147 items.
DiamondCO Loaded 172 Mob Spawns.
Spawned 3471 mobs.
DiamondCO Loading Plus info done.
Successful login for account bangwhore
Successful login for account mjolnid
MySql.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '','StatPoints' = 380 WHERE `Account` = 'bangwhore'' at line 1
at MySql.Data.MySqlClient.PacketReader.CheckForError( )
at MySql.Data.MySqlClient.PacketReader.ReadHeader()
at MySql.Data.MySqlClient.PacketReader.OpenPacket()
at MySql.Data.MySqlClient.NativeDriver.ReadResult(Int 64& affectedRows, Int64& lastInsertId)
at MySql.Data.MySqlClient.CommandResult.ReadNextResul t(Boolean isFirst)
at MySql.Data.MySqlClient.CommandResult..ctor(Driver d, Boolean isBinary)
at MySql.Data.MySqlClient.NativeDriver.SendQuery(Byte[] bytes, Int32 length, Boolean consume)
at MySql.Data.MySqlClient.MySqlCommand.GetNextResultS et(MySqlDataReader reader)
at MySql.Data.MySqlClient.MySqlCommand.Consume()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuer y()
at COServer_Project.DataBase.SaveChar(Character Charr) in C:\Documents and Settings\Owner\Desktop\ShadowCO\COServerProject\Da taBase.cs:line 1229
MySql.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '','StatPoints' = 0 WHERE `Account` = 'mjolnid'' at line 1
at MySql.Data.MySqlClient.PacketReader.CheckForError( )
at MySql.Data.MySqlClient.PacketReader.ReadHeader()
at MySql.Data.MySqlClient.PacketReader.OpenPacket()
at MySql.Data.MySqlClient.NativeDriver.ReadResult(Int 64& affectedRows, Int64& lastInsertId)
at MySql.Data.MySqlClient.CommandResult.ReadNextResul t(Boolean isFirst)
at MySql.Data.MySqlClient.CommandResult..ctor(Driver d, Boolean isBinary)
at MySql.Data.MySqlClient.NativeDriver.SendQuery(Byte[] bytes, Int32 length, Boolean consume)
at MySql.Data.MySqlClient.MySqlCommand.GetNextResultS et(MySqlDataReader reader)
at MySql.Data.MySqlClient.MySqlCommand.Consume()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuer y()
at COServer_Project.DataBase.SaveChar(Character Charr) in C:\Documents and Settings\Owner\Desktop\ShadowCO\COServerProject\Da taBase.cs:line 1229
MySql.Data.MySqlClient.MySqlException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
|
|
|
|
11/01/2008, 19:38
|
#4
|
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
|
no idea
|
|
|
11/01/2008, 19:56
|
#5
|
elite*gold: 0
Join Date: Feb 2008
Posts: 240
Received Thanks: 10
|
Well any one else cause this is really weird -.-
|
|
|
11/01/2008, 21:20
|
#6
|
elite*gold: 0
Join Date: Jun 2005
Posts: 692
Received Thanks: 353
|
Quote:
Originally Posted by Bottingpunk
Well any one else cause this is really weird -.-
|
Is the Attribute Point Distribution packet handled in your server? (client to server)
|
|
|
11/01/2008, 21:50
|
#7
|
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
|
if you're talking about like:
You have 10 AttributePoints / StatP
You set them to str/agi/vit/spi, and relog, and they just changes back to what it was before? If so I know how to fix it,ill help u with that later.
|
|
|
11/01/2008, 22:12
|
#8
|
elite*gold: 0
Join Date: Feb 2008
Posts: 240
Received Thanks: 10
|
Quote:
Originally Posted by EmmeTheCoder
if you're talking about like:
You have 10 AttributePoints / StatP
You set them to str/agi/vit/spi, and relog, and they just changes back to what it was before? If so I know how to fix it,ill help u with that later.
|
Yes that is exactly what it is. And the 10 attibute just got back to the attibute spot and off str and stuff
|
|
|
11/01/2008, 23:58
|
#9
|
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
|
MSN?
|
|
|
11/02/2008, 00:46
|
#10
|
elite*gold: 0
Join Date: Feb 2008
Posts: 240
Received Thanks: 10
|
U already added me
|
|
|
11/02/2008, 01:59
|
#11
|
elite*gold: 0
Join Date: Feb 2008
Posts: 240
Received Thanks: 10
|
Well ty emme for trying still didn't work well any one else wana give it a try
|
|
|
11/02/2008, 07:33
|
#12
|
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
|
Ill try later today,I was in a rush to bed,so tired. Ill talk to you later
|
|
|
Similar Threads
|
sro wont save my skillls in skill bar !!!!
10/04/2009 - SRO Private Server - 9 Replies
help me :P
sro wont save my skillls in skill bar !!!!
|
[Help] Database Wont Save Password
10/02/2008 - CO2 Private Server - 3 Replies
help i got a problem my database wont save password.... so even if they create an acc.... they can log in with any random password at anytime? any way to solve this problem?
|
All times are GMT +2. The time now is 13:12.
|
|