coemu console error???

03/03/2010 17:38 LegalConquer#1
Code:
[GameServer]
System.Collections.Generic.KeyNotFoundException: The given key was not present i
n the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at CoEmu_v2_GameServer.Connections.ClientSocket.DropItems(Int32 howmany) in C
:\Documents and Settings\Administrator\My Documents\5095 source\coemu\CoEmu v2 G
ameServer\Connections\ClientSocket.cs:line 422
   at CoEmu_v2_GameServer.Entities.Character.set_Dead(Boolean value) in C:\Docum
ents and Settings\Administrator\My Documents\5095 source\coemu\CoEmu v2 GameServ
er\Entities\Character.cs:line 44
   at CoEmu_v2_GameServer.Calculations.Calculation.doPlayer(Monster Attacker, Cl
ientSocket ASocket, Int32 Damage, Int32 AType) in C:\Documents and Settings\Admi
nistrator\My Documents\5095 source\coemu\CoEmu v2 GameServer\Calculations\doMons
terPlayer.cs:line 291
   at CoEmu_v2_GameServer.Entities.Monster.AttackMove(Int32 Target, Boolean Firs
t) in C:\Documents and Settings\Administrator\My Documents\5095 source\coemu\CoE
mu v2 GameServer\Entities\Monster.cs:line 934
Anyone know what caused this so i know where to fix ??
03/03/2010 17:46 tanelipe#2
Cause of this problem: The given key was not present in the dictionary.

The error is pretty straightforward, you're missing a key from the dictionary. I'm sure what operations you're trying to process. (Delete/Access). What I'm guessing is that there's line like

PHP Code:
Dictionary.Remove(Key);
or 
Value Dictionary[Key]; 
what you need to do is to have a check before accesing the value such as:
PHP Code:
if(Dictionary.Contains(Key))
    
Dictionary.Remove(Key); 
03/03/2010 17:49 LegalConquer#3
i found the code but the code seems to be doing what you would expect it to do find remove and delete 0.0

Code:
                if (!Nano.ItemFloor.ContainsKey(IG.UID))
                {
                    Database.Database.DeleteItem(Item.UID);
                    Client.Inventory.Remove(Item.UID);
03/03/2010 18:22 tanelipe#4
It never checks whether the item actually exists in the Inventory or not. Add this

PHP Code:
if(Client.Inventoy.Contains(ItemUID))
    
Client.Inventory.Remove(Item.UID); 
However I think it should stop processing what it's doing incase the item isn't on inventory. (I'm not sure what procedure this code is part of so I have no idea how it's supposed to function.)
03/03/2010 18:27 LegalConquer#5
Quote:
Originally Posted by tanelipe View Post
It never checks whether the item actually exists in the Inventory or not. Add this

PHP Code:
if(Client.Inventoy.Contains(ItemUID))
    
Client.Inventory.Remove(Item.UID); 
However I think it should stop processing what it's doing incase the item isn't on inventory. (I'm not sure what procedure this code is part of so I have no idea how it's supposed to function.)
thanks im sure thats more than enough info :P ive only been working with C# and this for under a month so its best to work most of it out my self but i do get stuck :P thanks
07/27/2010 10:50 bogdnlaszlo#6
I have same problem.
where should i find this lines to repair or change ?
07/27/2010 13:30 .Beatz#7
Quote:
Originally Posted by bogdnlaszlo View Post
I have same problem.
where should i find this lines to repair or change ?
If you cant use the search button in C# then please stop trying to make a server.
07/27/2010 14:30 bogdnlaszlo#8
Quote:
Originally Posted by mattyc2580 View Post
If you cant use the search button in C# then please stop trying to make a server.
Thanks for advice but i asked about wich file is
07/27/2010 14:32 Fish*#9
click search "Entire Solution"