コード例 #1
0
        static public bool SendToEGO(HistoryEntry he, out bool newRecord)
        {
            newRecord = false;

            EGOClass ego = new EGOClass();

            if (he.Commander != null)
            {
                ego.commanderName = he.Commander.EdsmName;
                if (string.IsNullOrEmpty(ego.commanderName))
                {
                    ego.commanderName = he.Commander.Name;
                }
            }

            JournalEntry je = he.journalEntry;

            if (je == null)
            {
                je = JournalEntry.Get(he.Journalid);
            }

            JObject msg = null;

            if (je.EventTypeID == JournalTypeEnum.Scan)
            {
                msg = ego.CreateEGOMessage(je as JournalScan, he.System.Name, he.System.X, he.System.Y, he.System.Z);
            }

            if (msg != null)
            {
                if (ego.PostMessage(msg, out newRecord))
                {
                    he.SetEGOSync();
                    return(true);
                }
            }

            return(false);
        }