예제 #1
0
        static void  logParser_OnMetaData(GameLogParser source, string metaData)
        {
            GameLogMetaData md = GameLogMetaData.Parse(metaData);

            if (md == null)
            {
                source.ErrorCount++;
                Console.Error.WriteLine(source.GetDefaultErrorText("Unknown metadata: " + metaData));
            }
            if (md.Name == "OnSessionBegin")
            {
                if (!md.Properties.ContainsKey("Repetition") || int.Parse(md.Properties["Repetition"]) == 0)
                {
                    // The very first repetition.
                    if (_cmdLine.SessionResult && _sessionGamesCount > 0)
                    {
                        _sessionResult.Print(_output);
                    }
                    if (_cmdLine.SessionResult)
                    {
                        _sessionResult =
                            CreateGameLogReport(md.Properties.ContainsKey("Name")
                                                    ? md.Properties["Name"]
                                                    : "Unnamed session");
                    }
                    _sessionGamesCount = 0;
                }
            }
        }
예제 #2
0
 void logParser_OnError(GameLogParser source, string error)
 {
     throw new ApplicationException(source.GetDefaultErrorText(error));
 }