public bool Refresh(string cmdr, EDDDLLInterfaces.EDDDLLIF.JournalEntry je) { if (AssemblyMainType != null) { if (AssemblyMainType.GetType().GetMethod("EDDRefresh") != null) { AssemblyMainType.EDDRefresh(cmdr, je); } } else if (pDll != IntPtr.Zero) { IntPtr pAddressOfFunctionToCall = BaseUtils.Win32.UnsafeNativeMethods.GetProcAddress(pDll, "EDDRefresh"); if (pAddressOfFunctionToCall != IntPtr.Zero) { EDDDLLInterfaces.EDDDLLIF.EDDRefresh edf = (EDDDLLInterfaces.EDDDLLIF.EDDRefresh)Marshal.GetDelegateForFunctionPointer( pAddressOfFunctionToCall, typeof(EDDDLLInterfaces.EDDDLLIF.EDDRefresh)); edf(cmdr, je); return(true); } } return(false); }
public bool NewJournalEntry(EDDDLLInterfaces.EDDDLLIF.JournalEntry nje, bool stored) { if (stored && DLLOptions.ContainsIn(EDDDLLInterfaces.EDDDLLIF.FLAG_PLAYLASTFILELOAD) < 0) { return(false); } if (AssemblyMainType != null) { if (AssemblyMainType.GetType().GetMethod("EDDNewJournalEntry") != null) { AssemblyMainType.EDDNewJournalEntry(nje); } } else if (pDll != IntPtr.Zero && pNewJournalEntry != IntPtr.Zero) { EDDDLLInterfaces.EDDDLLIF.EDDNewJournalEntry edf = (EDDDLLInterfaces.EDDDLLIF.EDDNewJournalEntry)Marshal.GetDelegateForFunctionPointer( pNewJournalEntry, typeof(EDDDLLInterfaces.EDDDLLIF.EDDNewJournalEntry)); edf(nje); return(true); } return(false); }
public void NewJournalEntry(EDDDLLInterfaces.EDDDLLIF.JournalEntry nje, bool stored) { foreach (EDDDLLCaller caller in DLLs) { caller.NewJournalEntry(nje, stored); } }
public bool DLLRequestHistory(long index, bool isjid, out EDDDLLInterfaces.EDDDLLIF.JournalEntry f) { HistoryEntry he = isjid ? history.GetByJID(index) : history.GetByEntryNo((int)index); f = EliteDangerousCore.DLL.EDDDLLCallerHE.CreateFromHistoryEntry(history, he); return(he != null); }
public void Refresh(string cmdr, EDDDLLInterfaces.EDDDLLIF.JournalEntry je) { foreach (EDDDLLCaller caller in DLLs) { caller.Refresh(cmdr, je); } }
public bool RequestHistory(long index, bool isjid, out EDDDLLInterfaces.EDDDLLIF.JournalEntry f) { EDDDLLInterfaces.EDDDLLIF.JournalEntry nje = new EDDDLLInterfaces.EDDDLLIF.JournalEntry() { ver = 4, indexno = 19 }; nje.utctime = DateTime.UtcNow.ToString(); nje.name = "EventSummary!"; nje.info = "Info"; nje.detailedinfo = "DI"; nje.materials = new string[2] { "one", "two" }; nje.commodities = new string[2] { "c-one", "c-two" }; nje.currentmissions = new string[2] { "m-one", "m-two" }; nje.systemname = "Sys Fred"; nje.x = 100.1; nje.y = 200.1; nje.z = 300.1; nje.travelleddistance = 1234.5; nje.travelledseconds = 6789; nje.islanded = true; nje.isdocked = true; nje.whereami = "Body"; nje.shiptype = "Anaconda"; nje.gamemode = "Open"; nje.group = "Fred"; nje.credits = 123456789; nje.eventid = "FunEvent"; nje.currentmissions = new string[] { "M1", "M2" }; nje.totalrecords = 2001; nje.jid = 101; nje.json = "{\"timestamp\"=\"10-20\"}"; nje.cmdrname = "Buddy"; nje.cmdrfid = "F19292"; nje.shipident = "Y-1929"; nje.shipname = "Julia"; //nje.beta = true; //nje.horizons = false; //nje.odyssey = true; nje.hullvalue = 200000; nje.modulesvalue = 20000; nje.rebuy = 5000; nje.stored = false; nje.travelstate = "Travelling"; nje.microresources = new string[] { "MR1", "MR2" }; f = nje; richTextBox1.Text += "Request history " + index + " " + isjid + Environment.NewLine; return(true); }
static public EDDDLLInterfaces.EDDDLLIF.JournalEntry CreateFromHistoryEntry(EliteDangerousCore.HistoryList hl, EliteDangerousCore.HistoryEntry he, bool storedflag = false) { if (he == null) { return(new EDDDLLInterfaces.EDDDLLIF.JournalEntry() { ver = 1, indexno = -1 }); } else { EDDDLLInterfaces.EDDDLLIF.JournalEntry je = new EDDDLLInterfaces.EDDDLLIF.JournalEntry() { ver = 2, indexno = he.EntryNumber, utctime = he.EventTimeUTC.ToStringZulu(), name = he.EventSummary, systemname = he.System.Name, x = he.System.X, y = he.System.Y, z = he.System.Z, travelleddistance = he.TravelledDistance, travelledseconds = (long)he.TravelledSeconds.TotalSeconds, islanded = he.IsLanded, isdocked = he.IsDocked, whereami = he.WhereAmI, shiptype = he.ShipType, gamemode = he.GameMode, group = he.Group, credits = he.Credits, eventid = he.journalEntry.EventTypeStr, json = he.journalEntry.GetJsonString(), cmdrname = he.Commander.Name, cmdrfid = he.Commander.FID, shipident = he.ShipInformation?.ShipUserIdent ?? "Unknown", shipname = he.ShipInformation?.ShipUserName ?? "Unknown", hullvalue = he.ShipInformation?.HullValue ?? 0, rebuy = he.ShipInformation?.Rebuy ?? 0, modulesvalue = he.ShipInformation?.ModulesValue ?? 0, stored = storedflag }; he.journalEntry.FillInformation(he.System, out je.info, out je.detailedinfo); je.materials = (from x in hl.MaterialCommoditiesMicroResources.GetMaterialsSorted(he.MaterialCommodity) select x.Details.Name + ":" + x.Count.ToStringInvariant() + ":" + x.Details.FDName).ToArray(); je.commodities = (from x in hl.MaterialCommoditiesMicroResources.GetCommoditiesSorted(he.MaterialCommodity) select x.Details.Name + ":" + x.Count.ToStringInvariant() + ":" + x.Details.FDName).ToArray(); var ml = hl.MissionListAccumulator.GetAllCurrentMissions(he.MissionList, he.EventTimeUTC); je.currentmissions = ml.Select(x => x.DLLInfo()).ToArray(); return(je); } }
private void buttonAJE_Click(object sender, EventArgs e) { EDDDLLInterfaces.EDDDLLIF.JournalEntry nje = new EDDDLLInterfaces.EDDDLLIF.JournalEntry() { ver = 3, indexno = 19 }; nje.utctime = DateTime.UtcNow.ToString(); nje.name = "EventSummary"; nje.info = "Info"; nje.detailedinfo = "DI"; nje.materials = new string[2] { "one", "two" }; nje.commodities = new string[2] { "c-one", "c-two" }; nje.currentmissions = new string[2] { "m-one", "m-two" }; nje.systemname = "Sys Fred"; nje.x = 100.1; nje.y = 200.1; nje.z = 300.1; nje.travelleddistance = 1234.5; nje.travelledseconds = 6789; nje.islanded = true; nje.isdocked = true; nje.whereami = "Body"; nje.shiptype = "Anaconda"; nje.gamemode = "Open"; nje.group = "Fred"; nje.credits = 123456789; nje.eventid = "FunEvent"; nje.totalrecords = 2001; nje.jid = 101; nje.json = "{\"timestamp\"=\"10-20\"}"; nje.cmdrname = "Buddy"; nje.cmdrfid = "F19292"; nje.shipident = "Y-1929"; nje.shipname = "Julia"; nje.hullvalue = 200000; nje.modulesvalue = 20000; nje.rebuy = 5000; nje.stored = false; nje.travelstate = "Travelling"; nje.microresources = new string[] { "MR1", "MR2" }; mgr.ActionJournalEntry("All", nje); richTextBox1.Text += "Action JE" + Environment.NewLine; }
private string lastcmdr = ""; // empty until first refresh, commander otherwise public void EDDRefresh(string cmd, EDDDLLInterfaces.EDDDLLIF.JournalEntry lastje) { System.Diagnostics.Debug.WriteLine("EDMC Refresh {0}", lastcmdr); string filetoadd = lastcmdr == "" ? storedout : currentout; // so, first time, with lastcmdr="", we write to stored. After refresh we write to current lastcmdr = lastje.cmdrname; // now we have performed a first refresh, we record this to screen out duplicate refreshes string f = string.Format("{{\"timestamp\":\"{0}\", \"event\":\"RefreshOver\"}}", DateTime.UtcNow.Truncate(TimeSpan.TicksPerSecond).ToStringZulu()); var s = File.AppendText(filetoadd); s.WriteLine(f); s.Close(); }
public void EDDNewJournalEntry(EDDDLLInterfaces.EDDDLLIF.JournalEntry je) { if (!je.stored || je.cmdrname != lastcmdr) // if not stored, or not the same commander as the one at last refresh { string filetoadd = lastcmdr == "" ? storedout : currentout; // so, first time, with lastcmdr="", we write to stored. After refresh we write to current System.Diagnostics.Debug.WriteLine("EDMC New Journal Entry " + je.utctime + " " + je.name + " -> " + filetoadd); var s = File.AppendText(filetoadd); s.WriteLine(je.json); s.Close(); } else { System.Diagnostics.Debug.WriteLine("Not sending EDMC New Journal Entry " + je.utctime + " " + je.name); } }
// item1 = true if found, item2 = true if caller implements. public Tuple <bool, bool> ActionJournalEntry(string dllname, EDDDLLInterfaces.EDDDLLIF.JournalEntry nje) { if (dllname.Equals("All", StringComparison.InvariantCultureIgnoreCase)) { foreach (EDDDLLCaller caller in DLLs) { caller.ActionJournalEntry(nje); } return(new Tuple <bool, bool>(true, true)); } else { EDDDLLCaller caller = FindCaller(dllname); return(caller != null ? new Tuple <bool, bool>(true, caller.ActionJournalEntry(nje)) : new Tuple <bool, bool>(false, false)); } }
private void buttonRefresh_Click(object sender, EventArgs e) { EDDDLLInterfaces.EDDDLLIF.JournalEntry nje = new EDDDLLInterfaces.EDDDLLIF.JournalEntry() { ver = 3, indexno = 19 }; nje.utctime = "01/02/03"; nje.name = "EventSummary"; nje.info = "Info"; nje.detailedinfo = "DI"; nje.materials = new string[2] { "one", "two" }; nje.commodities = new string[2] { "c-one", "c-two" }; nje.currentmissions = new string[2] { "m-one", "m-two" }; nje.systemname = "Sys Fred"; nje.x = 100.1; nje.y = 200.1; nje.z = 300.1; nje.travelleddistance = 1234.5; nje.travelledseconds = 6789; nje.islanded = true; nje.isdocked = true; nje.whereami = "Body"; nje.shiptype = "Anaconda"; nje.gamemode = "Open"; nje.group = "Fred"; nje.credits = 123456789; nje.totalrecords = 2001; nje.jid = 101; nje.json = "{\"timestamp\"=\"10-20\"}"; nje.travelstate = "Travelling"; nje.microresources = new string[] { "MR1", "MR2" }; mgr.Refresh("Jameson", nje); richTextBox1.Text += "Refresh" + Environment.NewLine; }
// ACTION DLLCALL <dllname>, "JournalEntry", JID public bool ActionJournalEntry(EDDDLLInterfaces.EDDDLLIF.JournalEntry je) { if (AssemblyMainType != null) { if (AssemblyMainType.GetType().GetMethod("EDDActionJournalEntry") != null) { AssemblyMainType.EDDActionJournalEntry(je); } } else if (pDll != IntPtr.Zero && pActionJournalEntry != IntPtr.Zero) { EDDDLLInterfaces.EDDDLLIF.EDDActionJournalEntry edf = (EDDDLLInterfaces.EDDDLLIF.EDDActionJournalEntry)Marshal.GetDelegateForFunctionPointer( pActionJournalEntry, typeof(EDDDLLInterfaces.EDDDLLIF.EDDActionJournalEntry)); edf(je); return(true); } return(false); }
public void EDDRefresh(string cmdname, EDDDLLInterfaces.EDDDLLIF.JournalEntry lastje) { System.Diagnostics.Debug.WriteLine("CSharpDLL Refresh"); }
public void EDDNewJournalEntry(EDDDLLInterfaces.EDDDLLIF.JournalEntry je) { System.Diagnostics.Debug.WriteLine("CSharpDLL New Journal Entry " + je.utctime); System.IO.File.AppendAllText(@"c:\code\csharpdll.txt", "NJE " + je.json + Environment.NewLine); }
public bool DLLRequestHistory(long index, bool isjid, out EDDDLLInterfaces.EDDDLLIF.JournalEntry f) { f = new EDDDLLInterfaces.EDDDLLIF.JournalEntry(); return(false); }
private void buttonNJE_Click(object sender, EventArgs e) { EDDDLLInterfaces.EDDDLLIF.JournalEntry nje = new EDDDLLInterfaces.EDDDLLIF.JournalEntry() { ver = 5, indexno = 19 }; //v1 nje.utctime = DateTime.UtcNow.ToString(); nje.name = "EventSummary"; nje.info = "Info"; nje.detailedinfo = "DI"; nje.materials = new string[2] { "one", "two" }; nje.commodities = new string[2] { "c-one", "c-two" }; nje.currentmissions = new string[2] { "m-one", "m-two" }; nje.systemname = "Sys Fred"; nje.x = 100.1; nje.y = 200.1; nje.z = 300.1; nje.travelleddistance = 1234.5; nje.travelledseconds = 6789; nje.islanded = true; nje.isdocked = true; nje.whereami = "Body"; nje.shiptype = "Anaconda"; nje.gamemode = "Open"; nje.group = "Fred"; nje.credits = 0xCCC12345678; nje.eventid = "FunEvent"; nje.jid = 0xAAA12345678; nje.totalrecords = 2001; //v2 nje.json = "{\"timestamp\"=\"10-20\"}"; nje.cmdrname = "Buddy"; nje.cmdrfid = "F19292"; nje.shipident = "Y-1929"; nje.shipname = "Julia"; nje.hullvalue = 0x12345678; nje.rebuy = 0x1234000; nje.modulesvalue = 0x1234111; nje.stored = true; //v3 nje.travelstate = "Travelling"; nje.microresources = new string[] { "MR1", "MR2", "MR3" }; // v4 nje.horizons = false; nje.odyssey = true; nje.beta = false; //v5 nje.wanted = false; nje.bodyapproached = true; nje.bookeddropship = false; nje.issrv = true; nje.isfighter = false; nje.onfoot = true; nje.bookedtaxi = false; nje.bodyname = "Bodyname"; nje.bodytype = "Bodytype"; nje.stationname = "stationname"; nje.stationtype = "stationtype"; nje.stationfaction = "stationfaction"; nje.shiptypefd = "shiptypefd"; nje.oncrewwithcaptain = "Captain Jack"; nje.shipid = 0xa1a12345678; nje.bodyid = 2020; mgr.NewJournalEntry(nje, false); richTextBox1.Text += "NJE" + Environment.NewLine; }
public void EDDActionJournalEntry(EDDDLLInterfaces.EDDDLLIF.JournalEntry je) { System.Diagnostics.Debug.WriteLine("CSharpDLL EDD Action journal entry"); }