OpenPerpetuum / PerpetuumServer

The Open Perpetuum Project's fork of the Perpetuum Standalone Server
https://openperpetuum.com
Other
44 stars 21 forks source link

Boss Announcer unhandled exception #426

Closed MikeJeffers closed 1 year ago

MikeJeffers commented 2 years ago
[02:50:55] ERR 
Exception Found:
Type: System.Collections.Generic.KeyNotFoundException
Message: The given key was not present in the dictionary.
Source: mscorlib
Stacktrace:    at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at Perpetuum.Services.EventServices.EventProcessors.NpcStateAnnouncer.GetNpcName(Int32 def)
   at Perpetuum.Services.EventServices.EventProcessors.NpcStateAnnouncer.BuildChatAnnouncement(NpcStateMessage msg)
   at Perpetuum.Services.EventServices.EventProcessors.NpcStateAnnouncer.HandleMessage(IEventMessage value)
   at Perpetuum.Services.EventServices.EventListenerService.NotifyListeners(IEventMessage message)
   at Perpetuum.Services.EventServices.EventListenerService.Update(TimeSpan time)
   at Perpetuum.Threading.Process.AsyncProcess.<>c__DisplayClass5_0.<Update>b__0()

Are you ready to play everyone's favorite game? Fix. That. Bug! applause

jeffmaley commented 2 years ago

How can I reproduce this error?

MikeJeffers commented 2 years ago

How can I reproduce this error?

I believe it fails when the 0.json localization file does not have the entitydefault name mapped to a localized value (like this https://github.com/OpenPerpetuum/OPDB/blob/development/Patches/Live_26/Server/data/customDictionary/0.json)

It should be easy to mock up by removing the 0.json from your data/customDictionary folder or otherwise manipulating the file in place as you like

jeffmaley commented 2 years ago

I've added some exception handling, but I'm having issues reproducing the error to test. I'll keep poking around.