Elvas Tower: Error: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. - Elvas Tower

Jump to content

  • 6 Pages +
  • « First
  • 4
  • 5
  • 6
  • You cannot start a new topic
  • You cannot reply to this topic

Error: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary. crash when a train reach a track section Rate Topic: -----

#51 User is offline   disc 

  • Foreman Of Engines
  • Group: Private - Open Rails Developer
  • Posts: 818
  • Joined: 07-October 12
  • Gender:Male
  • Simulator:OpenRails
  • Country:

Posted 26 January 2015 - 12:04 PM

Another problem, but this looks slightly different. However the timetable worked on revision 2813 without problem, but not with 2819

 Run AI : 198  01:00  02:00  03:00  04:00  05:00 

Error: System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.
   at System.ThrowHelper.ThrowKeyNotFoundException()
   at System.Collections.Generic.Dictionary`2.get_Item(TKey key)
   at ORTS.Train.SetDeadlock_locationBased(Int32 thisIndex, TCSubpathRoute thisRoute, TCSubpathRoute otherRoute, Train otherTrain) in e:\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Physics\Train.cs:line 9736
   at ORTS.Train.CheckDeadlock_locationBased(TCSubpathRoute thisRoute, Int32 thisNumber) in e:\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Physics\Train.cs:line 9515
   at ORTS.Train.CheckDeadlock(TCSubpathRoute thisRoute, Int32 thisNumber) in e:\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Physics\Train.cs:line 9275
   at ORTS.AITrain.PostInit() in e:\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\AI\AITrain.cs:line 394
   at ORTS.AI.AddToWorld(AITrain thisTrain) in e:\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\AI\AI.cs:line 563
   at ORTS.AI.AIUpdate(Single elapsedClockSeconds, Boolean preUpdate) in e:\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\AI\AI.cs:line 381
   at ORTS.AI.PrerunAI(Int32 playerTrainOriginalTrain, Train playerTrain, LoaderProcess loader) in e:\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\AI\AI.cs:line 253
   at ORTS.AI..ctor(Simulator simulator, List`1 allTrains, Double ClockTime, Int32 playerTrainOriginalTrain, Train playerTrain, LoaderProcess loader) in e:\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\AI\AI.cs:line 128
   at ORTS.Simulator.StartTimetable(String[] arguments, LoaderProcess loader) in e:\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Simulator\Simulator.cs:line 298
   at ORTS.Processes.GameStateRunActivity.Start(UserSettings settings, String acttype, String[] args) in e:\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Processes\GameStateRunActivity.cs:line 274
   at ORTS.Processes.GameStateRunActivity.<>c__DisplayClass8.<Load>b__3() in e:\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Processes\GameStateRunActivity.cs:line 148
   at ORTS.Processes.GameStateRunActivity.Load() in e:\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Processes\GameStateRunActivity.cs:line 189
   at ORTS.Processes.LoaderProcess.Load() in e:\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Processes\LoaderProcess.cs:line 155
   at ORTS.Processes.LoaderProcess.DoLoad() in e:\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Processes\LoaderProcess.cs:line 136
   at ORTS.Processes.LoaderProcess.LoaderThread() in e:\Documents\Coding\Jenkins\jobs\Open Rails\workspace\Source\RunActivity\Processes\LoaderProcess.cs:line 107
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()


This happens after 5:00 in pre-run. Here is the timetable: Attached File  timetablehossz.zip (47.83K)
Number of downloads: 182

#52 User is offline   roeter 

  • Vice President
  • Group: Status: Elite Member
  • Posts: 2,426
  • Joined: 25-October 11
  • Gender:Male
  • Country:

Posted 27 January 2015 - 01:31 PM

Can you please upload the timetable_or file as UNICODE?
The way it is, path etc. look like this on my system : TTAF6 Nyugati-Vác
Station names are molested accordingly, e.g. Vilmaszállás mh
It is a :sign_thanks: of a job to sort that all out.

Regards,
Rob Roeterdink

#53 User is offline   disc 

  • Foreman Of Engines
  • Group: Private - Open Rails Developer
  • Posts: 818
  • Joined: 07-October 12
  • Gender:Male
  • Simulator:OpenRails
  • Country:

Posted 27 January 2015 - 02:10 PM

View Postroeter, on 27 January 2015 - 01:31 PM, said:

Can you please upload the timetable_or file as UNICODE?
The way it is, path etc. look like this on my system : TTAF6 Nyugati-Vác
Station names are molested accordingly, e.g. Vilmaszállás mh
It is a :sign_thanks: of a job to sort that all out.

Regards,
Rob Roeterdink


It's UTF-8 already. Saved as UTF-8, and total commander's viewer, notepad, notepad++, libreoffice calc all detect and load it as UTF-8. For me those characters appear if i change the encoding to a non UTF encoding, for example ANSI. You trying to open it in MS office? I hear that have problems with UTF encodings.

#54 User is offline   roeter 

  • Vice President
  • Group: Status: Elite Member
  • Posts: 2,426
  • Joined: 25-October 11
  • Gender:Male
  • Country:

Posted 27 January 2015 - 02:35 PM

Perhaps the UTF-8 gets lost when packing into or unpacking from the zip-file, but with whatever program I look at it (including a HEX dump program - and those never lie), it definitely is not UTF-8.

Regards,
Rob Roeterdink

#55 User is offline   disc 

  • Foreman Of Engines
  • Group: Private - Open Rails Developer
  • Posts: 818
  • Joined: 07-October 12
  • Gender:Male
  • Simulator:OpenRails
  • Country:

Posted 27 January 2015 - 02:51 PM

If i download that zip, it's still UTF-8 for all of my applications. How can i save it to be more UTF-8? :sign_thanks:
Have you tried notepad++? That opens anything as should. Maybe you need UTF-8+BOM (which is non standard)?
Try this: Attached File  Alföld6.zip (8.88K)
Number of downloads: 163 i bet this is the problem. It seems at microsoft they still didn't read the specifications of UTF, as BOM(0xEF 0xBB 0xBF in hex) is not needed nor recommended, but still used by microsoft :D

#56 User is offline   roeter 

  • Vice President
  • Group: Status: Elite Member
  • Posts: 2,426
  • Joined: 25-October 11
  • Gender:Male
  • Country:

Posted 27 January 2015 - 03:08 PM

Here is what the HEX editor makes of the file in the zip-file :
Attached Image: zipped.jpg

And here is what it should look like if it is proper UNICODE :
Attached Image: unicoded.jpg

Regards,
Rob Roeterdink

PS. The file is only about 50Kbyte, you should be able to upload it unzipped.

PS2. Finally managed to get the proper file. I needed UNICODE - not UTF8. The only way to get it was to open the file before unzipping, then store it as unicode. Any other sequence translated those special characters to 2 bytes, resulting in the text as shown above.

#57 User is offline   roeter 

  • Vice President
  • Group: Status: Elite Member
  • Posts: 2,426
  • Joined: 25-October 11
  • Gender:Male
  • Country:

Posted 28 January 2015 - 02:27 AM

Another :) family member evicted from the program in version 2822.
Now, let's see where the next one is hiding .... :)

Regards,
Rob Roeterdink

#58 User is offline   gpz 

  • Superintendant
  • Group: Status: Elite Member
  • Posts: 1,772
  • Joined: 27-October 12
  • Gender:Male
  • Location:Budapest
  • Simulator:OpenRails
  • Country:

Posted 28 January 2015 - 05:42 AM

Rob, you are an addict hunter! I am starting to regret those poor little bugs with their family. :)

#59 User is offline   disc 

  • Foreman Of Engines
  • Group: Private - Open Rails Developer
  • Posts: 818
  • Joined: 07-October 12
  • Gender:Male
  • Simulator:OpenRails
  • Country:

Posted 28 January 2015 - 08:28 AM

If i unzip the file, all characters are still the same as they should be. The ascii chars endcoded to 1 byte, specials are encoded to 2 bytes, as should be. The problem is that your application wanted to read the UTF-8 as ASCII, that's why those weird characters appeared, as the 2 byte character was read as two 1byte characters. So i see you wanted UTF-16 encoded unicode, that's what is usually called as unicode, however UTF-8 is unicode too.

Thanks, i will try it if the automatic builds will refresh.

PS: it seems to work, also i removed the $hold for all stations, without crash.

  • 6 Pages +
  • « First
  • 4
  • 5
  • 6
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users