coSXserver problem

08/01/2010 12:39 bogdnlaszlo#1
Good day

So has you saw on title i came with a CoSXserver problem.
I configured/loaded and working fine, but he started to send error messages in server window. Let me show you what im talking about.

- Loading Skills...
[GameServer] Skills loading 44
- Loading Nobility count...
- Loading Items...
Items loading 8426
- Loading PlusInfo...
[GameServer] PlusInfo loading 6168
- Loading Portals...
[GameServer] Portals loading 234
- Loading NPCs...
[GameServer] Npc loading 1287
- Loading QuizQuestions...
[GameServer] QuizQuestion loading 83
- Loading Guilds...
Guilds loading 44
Starting to load DMaps.
Maps loading 27
DMaps loaded successfully in 2000 milliseconds.
- Loading Mobs...
Mobs loaded 13982
- Loading LottoItems...
[GameServer] LoteryItems loading 1314
Loading Complete!

ServerV2 Leveling Server...
-----------------------------------------------------------------------
Server Was Made By lazy-co
Server on Client 5165+
Server use port 9958
-----------------------------------------------------------------------
lazy-co Source : Online
ServerIP 98.249.242.160
Athanous has logged on.
System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(Exceptio nResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKe y key, TValue value, Boo
lean add)
at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
at ConquerSx.Database.GetItems(Character C) in C:\Conquer-Sx\Database.cs:line
1574
at ConquerSx.PacketHandling.Teleport.Handle(GameClien t GC, Byte[] Data) in C:
\Conquer-Sx\PacketHandling\Teleport.cs:line 51
at ConquerSx.PacketHandler.Handle(GameClient GC, Byte[] PData) in C:\Conquer-
Sx\PacketHandler.cs:line 990
MySql.Data.MySqlClient.MySqlException: There is already an open DataReader assoc
iated with this Connection which must be closed first.
at MySql.Data.MySqlClient.MySqlCommand.CheckState()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader( CommandBehavior behavior
)
at MySql.Data.MySqlClient.MySqlCommand.System.Data.ID bCommand.ExecuteReader(C
ommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[]
datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand co
mmand, 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)
at ConquerSx.Database.Authenticate(String User, String Password) in C:\Conque
r-Sx\Database.cs:line 984
MySql.Data.MySqlClient.MySqlException: There is already an open DataReader assoc
iated with this Connection which must be closed first.
at MySql.Data.MySqlClient.MySqlCommand.CheckState()
at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader( CommandBehavior behavior
)
at MySql.Data.MySqlClient.MySqlCommand.System.Data.ID bCommand.ExecuteReader(C
ommandBehavior behavior)
at System.Data.Common.DbDataAdapter.FillInternal(Data Set dataset, DataTable[]
datatables, Int32 startRecord, Int32 maxRecords, String srcTable, IDbCommand co
mmand, 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)
at ConquerSx.Database.Authenticate(String User, String Password) in C:\Conque
r-Sx\Database.cs:line 984



and i honestly dont know how to fix it, thank you for your time. please give me a hand.
Thank you
08/02/2010 00:10 xXxTwiztedKidxXx#2
Ive Got that same problem. It happens when someone else tries to login. from a different IP then the hoster.
08/02/2010 00:26 Korvacs#3
Code:
at ConquerSx.Database.GetItems(Character C) in C:\Conquer-Sx\Database.cs:line
1574
Theres your problem, your adding an item with the same unique id twice, obviously you cant do that, hence your error.
08/02/2010 00:48 xXxTwiztedKidxXx#4
Idk how to fix that but i learned that it works for me when u dont put a badword in the password.
08/02/2010 01:02 Korvacs#5
That honestly cant have anything to do with it >.<
08/02/2010 01:28 xXxTwiztedKidxXx#6
idk it just worked for me...Thats all i was saying.
08/02/2010 06:32 pro4never#7
:O simple explanation... when saving item database check to see if the uid already exists. If it exists, do a random item uid and try again. If it keeps failing then remove the item from server (LOG THE ERROR!!!! If not you will not track down the original cause and your players will be losing items!)


Wipe your item database NOW. It's already happening when you try to log in right? That means correcting codes in the server won't make any difference as the server already has 2 items with the same uid saved to the db.

Note: using sql make sure the uid is a key value (will not allow 2 of the same to be created)... if you are using ini then be super, SUPER careful about what you write to the db... it can cause lots of problems.