possible bug in simulator :(

Jun 15, 2013 at 11:12 AM
Hi Nick!

I have tried to implement my own commands into simulator, like RY, FO, these commands have optional fields, dependent on other fields of commands and have faced a problem. During XML read by XML.MessageParser.Parse(msg, XMLMessageFields, kvp, XMLParseResult) simulator tries to parse all the fields from XML into the list and throws an exception (looks like simulator skips XML tags <DependentField> and <DependentValue>):
System.ArgumentOutOfRangeException: Index and length must refer to a location within the string.
Parameter name: length
   at System.String.InternalSubStringWithChecks(Int32 startIndex, Int32 length, Boolean fAlwaysCopy)
   at ThalesSim.Core.Message.XML.MessageParser.Parse(Message msg, MessageFields fields, MessageKeyValuePairs& KVPairs, String& result)
   at ThalesSim.Core.HostCommands.BuildIn.GenerateCVKPair_AS.AcceptMessage(Message msg)
   at ThalesSim.Core.ThalesMain.WCMessageArrived(WorkerClient sender, Byte[]& b, Int32 len)
Disconnecting client.
Calling Terminate()...
Implementor to Nothing
I thank that it is my fault, but made a test with the command implemented into Your release AS (generate CVK pair) and have got the same exception. Simulator tries to receive all the fields including delimiter and optional fields after it. AS I have tested on the final release of simulator.

The command i have sent to simulator is just AS to generate a pair.

Could you please check this issue. I can not find where could be the problem :(

Thank you very much!
Jun 15, 2013 at 11:35 AM
Yeah, and some additional info - HA command (generate TAK) is working well with and without optional fields.