Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 17:39

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

Advertisement



[Urgent] Attention to anyone using LOFT Source

Discussion on [Urgent] Attention to anyone using LOFT Source within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
THE BAT's Avatar
 
elite*gold: 0
Join Date: Aug 2006
Posts: 63
Received Thanks: 28
[Urgent] Attention to anyone using LOFT Source

The MySQL .NET Connector has a bug, its not happen always, but it happen like 3 or 4 times a day, i search the MySQL Knowledge base and some report that bug too.

look at the errors:

Code:
MySql.Data.MySqlClient.MySqlException: Duplicate entry '' for key 1
   at MySql.Data.MySqlClient.MySqlStream.OpenPacket()
   at MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64& affectedRows, Int64& lastInsertId)
   at MySql.Data.MySqlClient.MySqlDataReader.GetResultSet()
   at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
   at MySql.Data.MySqlClient.MySqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
   at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.FillInternal(DataSet dataset, DataTable[] datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand command, CommandBehavior behavior)
   at System.Data.Common.DbDataAdapter.Fill(DataSet dataSet, String srcTable)
Code:
System.ArgumentException: Column 'UID' does not belong to table Character.
   at System.Data.DataRow.GetDataColumn(String columnName)
   at System.Data.DataRow.get_Item(String columnName)

i suggest if you are planning to release your server to public, move to another database server like SQL Server.

cuz when that problem happen, some character information replace with 0 in the database
THE BAT is offline  
Old 09/22/2008, 00:10   #2
 
© Haydz's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 1,042
Received Thanks: 252
Or a better idea... don't use lotf at all
© Haydz is offline  
Old 09/22/2008, 00:12   #3
 
glupkotrup's Avatar
 
elite*gold: 0
Join Date: May 2007
Posts: 1,195
Received Thanks: 457
Haha... I think 99.99% use the LOTF source
glupkotrup is offline  
Old 09/22/2008, 00:17   #4
 
THE BAT's Avatar
 
elite*gold: 0
Join Date: Aug 2006
Posts: 63
Received Thanks: 28
Quote:
Originally Posted by © Haydz View Post
Or a better idea... don't use lotf at all
lol, nice idea
but i change it alot now, and implemenet alot of things, next i think i will move to SQL Server

LOL
THE BAT is offline  
Old 09/22/2008, 00:24   #5
 
glupkotrup's Avatar
 
elite*gold: 0
Join Date: May 2007
Posts: 1,195
Received Thanks: 457
Haha
glupkotrup is offline  
Old 09/22/2008, 09:03   #6
 
THE BAT's Avatar
 
elite*gold: 0
Join Date: Aug 2006
Posts: 63
Received Thanks: 28
i convert my source to work with MS SQL Server, i used SQL Server Express SP2, and convert my current MySQL database.

i convert the Database class, and the server work more stable and more faster SQL Server

i just let all know
THE BAT is offline  
Old 09/22/2008, 17:10   #7
 
elite*gold: 0
Join Date: Sep 2008
Posts: 92
Received Thanks: 21
post ur
Quote:
public static void GetCharInfo(Character Charr, string UserName)
reborn666 is offline  
Old 09/22/2008, 19:14   #8
 
stephanyd's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 390
Received Thanks: 92
Quote:
Originally Posted by THE BAT View Post
i convert my source to work with MS SQL Server, i used SQL Server Express SP2, and convert my current MySQL database.

i convert the Database class, and the server work more stable and more faster SQL Server

i just let all know
how to convert source to make it work with MS SQL Server ???
stephanyd is offline  
Old 09/22/2008, 20:50   #9
 
© Haydz's Avatar
 
elite*gold: 20
Join Date: Jan 2008
Posts: 1,042
Received Thanks: 252
Quote:
Originally Posted by stephanyd View Post
how to convert source to make it work with MS SQL Server ???
Convert.ToMSSql(object Source);
© Haydz is offline  
Old 09/22/2008, 22:31   #10
 
THE BAT's Avatar
 
elite*gold: 0
Join Date: Aug 2006
Posts: 63
Received Thanks: 28
The server is working very fine from more than 15 hours now, without any problem


Quote:
Originally Posted by reborn666 View Post
post ur
Quote:
public static void GetCharInfo(Character Charr, string UserName)
Here is my old GetCharInfo, i added some changes to it, in trying to stop losing chars, but the problem is with the MySQL .NET Connector, even with the latest version of it (5.2.3)

Code:
       public static void GetCharInfo(Character Charr, string UserName)
        {
            try
            {
                MySqlDataAdapter DataAdapter = null;
                DataSet DSet = new DataSet();                        

                DataAdapter = new MySqlDataAdapter("SELECT * FROM `Characters` WHERE `Account` = '" + UserName + "'", Connection);

                DataAdapter.Fill(DSet, "Character");

                if (DSet != null && DSet.Tables["Character"].Rows.Count > 0)
                {
                    DataRow DR = DSet.Tables["Character"].Rows[0];

                    Charr.UID = (uint)DR["UID"];
                    Charr.Name = (string)DR["CharName"];
                    Charr.Spouse = (string)DR["Spouse"];
                    Charr.Job = Convert.ToByte((uint)DR["Job"]);
                    Charr.Level = Convert.ToByte((uint)DR["Level"]);
                    Charr.Exp = (uint)DR["Exp"];
                    Charr.Model = Convert.ToUInt16((uint)DR["Model"]);
                    Charr.Avatar = Convert.ToUInt16((uint)DR["Avatar"]);
                    Charr.Hair = Convert.ToUInt16((uint)DR["Hair"]);
                    Charr.LocX = Convert.ToUInt16((uint)DR["LocationX"]);
                    Charr.LocY = Convert.ToUInt16((uint)DR["LocationY"]);
                    Charr.LocMap = Convert.ToUInt16((uint)DR["LocationMap"]);
                    Charr.Str = Convert.ToUInt16((uint)DR["Strength"]);
                    Charr.Agi = Convert.ToUInt16((uint)DR["Agility"]);
                    Charr.Vit = Convert.ToUInt16((uint)DR["Vitality"]);
                    Charr.Spi = Convert.ToUInt16((uint)DR["Spirit"]);
                    Charr.Silvers = (uint)DR["Money"];
                    Charr.CPs = (uint)DR["CPs"];
                    Charr.CurHP = Convert.ToUInt16((uint)DR["CurrentHP"]);
                    Charr.CurMP = Convert.ToUInt16((uint)DR["CurrentMP"]);
                    Charr.PKPoints = Convert.ToUInt16((uint)DR["PKPoints"]);
                    Charr.RBCount = Convert.ToByte((uint)DR["RBCount"]);
                    Charr.PackedInventory = (string)DR["Inventory"];
                    Charr.PackedEquips = (string)DR["Equipment"];
                    Charr.PackedSkills = (string)DR["Skills"];
                    Charr.PackedProfs = (string)DR["Profs"];
                    Charr.WHSilvers = (uint)DR["WHMoney"];
                    Charr.PackedWHs = (string)DR["Warehouses"];
                    Charr.PackedFriends = (string)DR["Friends"];
                    Charr.PackedEnemies = (string)DR["Enemies"];
                    Charr.VP = (uint)DR["VP"];
                    Charr.GuildDonation = (uint)DR["GuildDonation"];
                    Charr.GuildID = Convert.ToUInt16((uint)DR["MyGuild"]);
                    Charr.GuildPosition = Convert.ToByte((uint)DR["GuildPos"]);
                    Charr.PrevMap = Convert.ToUInt16((uint)DR["PrevMap"]);
                    if (Guilds.AllGuilds.ContainsKey(Charr.GuildID))
                        Charr.MyGuild = Guilds.AllGuilds[Charr.GuildID];
                    Charr.MinAtk = Charr.Str;
                    Charr.MaxAtk = Charr.Str;
                    Charr.Potency = Charr.Level;
                    Charr.RealModel = Charr.Model;
                    Charr.RealAvatar = Charr.Avatar;
                    Charr.MaxHP = Charr.BaseMaxHP();
                    Charr.MaxMP = Charr.MaxMana();
                    Charr.RealAgi = Charr.Agi;

                    Charr.KO = Convert.ToUInt16((uint)DR["KO"]);
                    Charr.OldKO = Convert.ToUInt16((uint)DR["OldKO"]);
                }
                else
                {
                    General.WriteLine("Char not found.");

                    throw new Exception();
                }
            }
            catch (Exception Exc) 
            {
                Charr = null;
                throw Exc; 
            }
        }
Quote:
Originally Posted by stephanyd View Post
how to convert source to make it work with MS SQL Server ???
i can give your the modified Database class to work with MS SQL Server, if you want
THE BAT is offline  
Old 09/22/2008, 22:50   #11
 
stephanyd's Avatar
 
elite*gold: 0
Join Date: Jun 2007
Posts: 390
Received Thanks: 92
Quote:
Originally Posted by THE BAT View Post
The server is working very fine from more than 15 hours now, without any problem




Here is my old GetCharInfo, i added some changes to it, in trying to stop losing chars, but the problem is with the MySQL .NET Connector, even with the latest version of it (5.2.3)

Code:
       public static void GetCharInfo(Character Charr, string UserName)
        {
            try
            {
                MySqlDataAdapter DataAdapter = null;
                DataSet DSet = new DataSet();                        

                DataAdapter = new MySqlDataAdapter("SELECT * FROM `Characters` WHERE `Account` = '" + UserName + "'", Connection);

                DataAdapter.Fill(DSet, "Character");

                if (DSet != null && DSet.Tables["Character"].Rows.Count > 0)
                {
                    DataRow DR = DSet.Tables["Character"].Rows[0];

                    Charr.UID = (uint)DR["UID"];
                    Charr.Name = (string)DR["CharName"];
                    Charr.Spouse = (string)DR["Spouse"];
                    Charr.Job = Convert.ToByte((uint)DR["Job"]);
                    Charr.Level = Convert.ToByte((uint)DR["Level"]);
                    Charr.Exp = (uint)DR["Exp"];
                    Charr.Model = Convert.ToUInt16((uint)DR["Model"]);
                    Charr.Avatar = Convert.ToUInt16((uint)DR["Avatar"]);
                    Charr.Hair = Convert.ToUInt16((uint)DR["Hair"]);
                    Charr.LocX = Convert.ToUInt16((uint)DR["LocationX"]);
                    Charr.LocY = Convert.ToUInt16((uint)DR["LocationY"]);
                    Charr.LocMap = Convert.ToUInt16((uint)DR["LocationMap"]);
                    Charr.Str = Convert.ToUInt16((uint)DR["Strength"]);
                    Charr.Agi = Convert.ToUInt16((uint)DR["Agility"]);
                    Charr.Vit = Convert.ToUInt16((uint)DR["Vitality"]);
                    Charr.Spi = Convert.ToUInt16((uint)DR["Spirit"]);
                    Charr.Silvers = (uint)DR["Money"];
                    Charr.CPs = (uint)DR["CPs"];
                    Charr.CurHP = Convert.ToUInt16((uint)DR["CurrentHP"]);
                    Charr.CurMP = Convert.ToUInt16((uint)DR["CurrentMP"]);
                    Charr.PKPoints = Convert.ToUInt16((uint)DR["PKPoints"]);
                    Charr.RBCount = Convert.ToByte((uint)DR["RBCount"]);
                    Charr.PackedInventory = (string)DR["Inventory"];
                    Charr.PackedEquips = (string)DR["Equipment"];
                    Charr.PackedSkills = (string)DR["Skills"];
                    Charr.PackedProfs = (string)DR["Profs"];
                    Charr.WHSilvers = (uint)DR["WHMoney"];
                    Charr.PackedWHs = (string)DR["Warehouses"];
                    Charr.PackedFriends = (string)DR["Friends"];
                    Charr.PackedEnemies = (string)DR["Enemies"];
                    Charr.VP = (uint)DR["VP"];
                    Charr.GuildDonation = (uint)DR["GuildDonation"];
                    Charr.GuildID = Convert.ToUInt16((uint)DR["MyGuild"]);
                    Charr.GuildPosition = Convert.ToByte((uint)DR["GuildPos"]);
                    Charr.PrevMap = Convert.ToUInt16((uint)DR["PrevMap"]);
                    if (Guilds.AllGuilds.ContainsKey(Charr.GuildID))
                        Charr.MyGuild = Guilds.AllGuilds[Charr.GuildID];
                    Charr.MinAtk = Charr.Str;
                    Charr.MaxAtk = Charr.Str;
                    Charr.Potency = Charr.Level;
                    Charr.RealModel = Charr.Model;
                    Charr.RealAvatar = Charr.Avatar;
                    Charr.MaxHP = Charr.BaseMaxHP();
                    Charr.MaxMP = Charr.MaxMana();
                    Charr.RealAgi = Charr.Agi;

                    Charr.KO = Convert.ToUInt16((uint)DR["KO"]);
                    Charr.OldKO = Convert.ToUInt16((uint)DR["OldKO"]);
                }
                else
                {
                    General.WriteLine("Char not found.");

                    throw new Exception();
                }
            }
            catch (Exception Exc) 
            {
                Charr = null;
                throw Exc; 
            }
        }


i can give your the modified Database class to work with MS SQL Server, if you want
thanks.. that would be great ..i just installed MS SQL Server express
stephanyd is offline  
Old 09/22/2008, 23:00   #12
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,338
Received Thanks: 490
Hmm may i should do it too...

Do i need the server express thngy?
~Yuki~ is offline  
Old 09/22/2008, 23:07   #13
 
THE BAT's Avatar
 
elite*gold: 0
Join Date: Aug 2006
Posts: 63
Received Thanks: 28
Quote:
Originally Posted by lolmaster123 View Post
Hmm may i should do it too...

Do i need the server express thngy?
yes, you need MS SQL Express, i installed 2005 SP2, cuz may be 2008 not yet stable like 2005.
THE BAT is offline  
Old 09/22/2008, 23:26   #14
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
... It's not that hard to get this to work with mysql, you can get it to work stable and all... It's just the way mysql works in lotf is ****.
tao4229 is offline  
Old 09/23/2008, 00:10   #15
 
THE BAT's Avatar
 
elite*gold: 0
Join Date: Aug 2006
Posts: 63
Received Thanks: 28
Quote:
Originally Posted by tao4229 View Post
... It's not that hard to get this to work with mysql, you can get it to work stable and all... It's just the way mysql works in lotf is ****.
The problem is not in LOTF Database code, you are true the code had one problem, but i fix it, i trace the code, but the problem is in the MySQL .NET Connector, and there are alot of people post it in the mySql forums, the thing is the problem happen randomly
THE BAT is offline  
Reply


Similar Threads Similar Threads
[HeLP]LOFT Source
08/21/2009 - CO2 Private Server - 9 Replies
salvation can someone give me the id of the effect of NPC, and someone can give me the code for revive guard .(LOFT Source.) thx
How to work as a pro on LOFT source!
07/29/2009 - CO2 Private Server - 34 Replies
Hello people! My first time helping you guys,and I think i deserve a thanks after this. Anyways,here it goes. This is what I will teach you through this guide *Setting up the server *Adding accounts *Adding monsters *Adding NPCs *Adding monsterspawns ( Will share an exclusive command that I created ) *Remove monsters *Edit monsters
How to work the LOFT source as a pro!
07/17/2009 - CO2 Private Server - 116 Replies
Hello people! My first time helping you guys,and I think i deserve a thanks after this. Anyways,here it goes. This is what I will teach you through this guide *Setting up the server *Adding accounts *Adding monsters *Adding NPCs *Adding monsterspawns ( Will share an exclusive command that I created ) *Remove monsters *Edit monsters
Need the best loft source
04/20/2009 - CO2 Private Server - 1 Replies
Please i need the best loft source with the all necesary to play who can get me? link etc?
Request the best LOFT source
04/15/2009 - CO2 Private Server - 5 Replies
hey guys i dont know what source to use...i am confused idk whats the best source help me



All times are GMT +1. The time now is 17:39.


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.