private void GetGame(object sender, InfoReadyEventArgs e) { var pnamestr = new[] { "kujira-1", "kujira-2", "sango-1", "sango-2", "salmon", "niji_loc", "niji_loc", "momiji", "momiji" }; string pname; string log = e.Info; if (null == (pname = pnamestr.FirstOrDefault(log.Contains))) { return; } pname = ", pname:" + pname.PadLeft(9); string pidaddr = log.Substring(log.IndexOf(pname, StringComparison.Ordinal) - 10, 10); PID = Convert.ToInt32(pidaddr, 16); if (log.Contains("niji_loc")) { Write(0x3E14C0, BitConverter.GetBytes(0xE3A01000), PID); } else if (log.Contains("momiji")) { Write(0x3F3424, BitConverter.GetBytes(0xE3A01000), PID); // Ultra Sun // NFC ON: E3A01001 NFC OFF: E3A01000 Write(0x3F3428, BitConverter.GetBytes(0xE3A01000), PID); // Ultra Moon // NFC ON: E3A01001 NFC OFF: E3A01000 } }
private void OnInfoReady(InfoReadyEventArgs e) => InfoReady?.Invoke(this, e);