public void Enqueue(long id, DSType dsType, int pvpServiceID) { Log <DSEntityMakerSystem> .Logger.InfoFormat("Enqueue Make PVP Entity. DSType : [{0}] ServiceID : [{1}]", dsType.ToString(), pvpServiceID); this.DSEntityMakerList.AddLast(new DSEntityMakerQueue(id, dsType, pvpServiceID)); this.Process(); }
public void Enqueue(long id, DSType dsType) { Log <DSEntityMakerSystem> .Logger.InfoFormat("Enqueue Make DS Entity. DSType : [{0}]", dsType.ToString()); this.DSEntityMakerList.AddLast(new DSEntityMakerQueue(id, dsType)); this.Process(); }
public IntellisenseItem(string text, DSType type) : this() { this.Text = text; this.Type = type; SetPicture(); }
private DSType GetNextDSType(bool giantRaidMachine) { if (0 < this.GiantRaidMachineCount && this.DSMachineCount.TryGetValue(DSType.GiantRaid) < this.GiantRaidMachineCount && giantRaidMachine) { this.DSMachineCount.AddOrIncrease(DSType.GiantRaid, 1); return(DSType.GiantRaid); } if (0 < this.PvpMachineCount && this.DSMachineCount.TryGetValue(DSType.Pvp) < this.PvpMachineCount) { this.DSMachineCount.AddOrIncrease(DSType.Pvp, 1); return(DSType.Pvp); } if (0 < this.IsolateNormalRaidMachineCount && this.DSMachineCount.TryGetValue(DSType.IsolateNormalRaid) < this.IsolateNormalRaidMachineCount) { this.DSMachineCount.AddOrIncrease(DSType.IsolateNormalRaid, 1); return(DSType.IsolateNormalRaid); } if (0 < this.NormalRaidMachineCount && this.DSMachineCount.TryGetValue(DSType.NormalRaid) < this.NormalRaidMachineCount) { this.DSMachineCount.AddOrIncrease(DSType.NormalRaid, 1); return(DSType.NormalRaid); } if (0 < this.DevMachineCount && this.DSMachineCount.TryGetValue(DSType.Dev_All) < this.DevMachineCount) { this.DSMachineCount.AddOrIncrease(DSType.Dev_All, 1); return(DSType.Dev_All); } int num = this.DSMachineCount.Values.Sum(); DSType dstype = this.DSTypeForLeftOvers[num % this.DSTypeForLeftOvers.Count]; this.DSMachineCount.AddOrIncrease(dstype, 1); return(dstype); }
private void UnuseResource(DSType dsType) { Log <DSServiceInfo> .Logger.WarnFormat("UnUseResource ServiceID : [{0}], DSType : [{1}]", this.ServiceID, dsType.ToString()); this.Resource += this.GetResorcePoint(dsType); Log <DSServiceInfo> .Logger.WarnFormat("RemainResource : [{0}]", this.Resource); }
public string ProfileInformationShort() { return(string.Format("{0} {1} Version: {2} Timer0: {3} - {4} VCount: {5} VFrame: {6} GxStat: {7}", DSType.ToString().Replace('_', ' '), MAC_Address.ToString("X"), Language + " " + Version, Timer0Min.ToString("X"), Timer0Max.ToString("X"), VCount.ToString("X"), VFrame.ToString("X"), GxStat.ToString("X"))); }
public int UseEntityAndGetDSID(DSType dsType) { KeyValuePair <int, DSEntityInfo> keyValuePair = (from x in this.EntityInfoDic where x.Value.State == DSEntityState.UnUsed && x.Value.DSType == dsType select x).First <KeyValuePair <int, DSEntityInfo> >(); keyValuePair.Value.State = DSEntityState.Used; return(keyValuePair.Key); }
public string ProfileInformation() { return (string.Format( "{0} {1} Version: {2} ID: {3} SID: {4} Timer0: {5} - {6} VCount: {7} VFrame: {8} GxStat: {9} Keypresses: {10}", DSType.ToString().Replace('_', ' '), MAC_Address.ToString("X"), Language + " " + Version, ID, SID, Timer0Min.ToString("X"), Timer0Max.ToString("X"), VCount.ToString("X"), VFrame.ToString("X"), GxStat.ToString("X"), KeyString) + (SkipLR ? " (Skip L\\R)" : "")); }
public void Dequeue(long id, DSType dsType) { DSEntityMakerQueue dsentityMakerQueue = (from x in this.DSEntityMakerList where x.ID == id && x.DSType == dsType select x).FirstOrDefault <DSEntityMakerQueue>(); if (dsentityMakerQueue != null) { this.DSEntityMakerList.Remove(dsentityMakerQueue); Log <DSEntityMakerSystem> .Logger.InfoFormat("Remove Entity Maker Queue : {0}", dsType); } }
public int UseResourceAndGetDSID(DSType dsType) { this.UseResource(dsType); KeyValuePair <int, DSEntityInfo> keyValuePair = (from x in this.EntityInfoDic where x.Value.State == DSEntityState.UnUsed && x.Value.DSType == DSType.None select x).First <KeyValuePair <int, DSEntityInfo> >(); keyValuePair.Value.Update(DSEntityState.Used, dsType); Log <DSEntityMakerSystem> .Logger.InfoFormat("Update DS Entity [{0}] [{1}] [Used]", keyValuePair.Key, dsType); return(keyValuePair.Key); }
static public DataSrc factory(DSType t, RX_CB cb) //工厂方法 { switch (t) { case DSType.uart: return(new DataSrc_uart(cb)); case DSType.udp: return(new DataSrc_udp(cb)); } return(null); }
public DSInfo GetWaitingDS(DSType dsType) { Random random = new Random(); DSInfo[] array = (from x in this.DSMap.Values where this.DSShipMap.TryGetValue(x.DSID) == null && x.DSType == dsType select x).ToArray <DSInfo>(); if (array.Length < 1) { return(null); } return(array[random.Next(0, array.Length)]); }
private int GetResorcePoint(DSType dsType) { switch (dsType) { case DSType.GiantRaid: return(DSServiceInfo.DSGiantRaidResorcePoint); case DSType.NormalRaid: case DSType.IsolateNormalRaid: return(DSServiceInfo.DSNormalRaidResorcePoint); case DSType.Pvp: return(DSServiceInfo.DSPvpResorcePoint); } return(0); }
public bool HasUnuseEntity(DSType dsType) { int num = this.GetResorcePoint(dsType) - this.Resource; foreach (KeyValuePair <int, DSEntityInfo> keyValuePair in this.EntityInfoDic) { if (keyValuePair.Value.State == DSEntityState.UnUsed) { num -= this.GetResorcePoint(keyValuePair.Value.DSType); if (num <= 0) { return(true); } } } return(false); }
private int RegisterDSEntity(int serviceID, int start, int count, DSType dsType) { foreach (int num in Enumerable.Range(start, count)) { DSInfo value = new DSInfo(num, serviceID, dsType); if (dsType != DSType.Pvp) { this.DSMap.Add(num, value); } else { this.PvpDSMap.Add(num, value); } } Log <DSWaitingSystem> .Logger.WarnFormat("Register DSInfo : {0} ~ {1}", start, start + count - 1); return(start + count); }
public DSType RegisterDSService(int serviceID, int coreCount, bool giantRaidMachine, out int idStart, out int processCount) { idStart = this.DSMap.Count + this.PvpDSMap.Count; DSType nextDSType = this.GetNextDSType(giantRaidMachine); switch (nextDSType) { case DSType.GiantRaid: processCount = this.GetProcessCount(this.GiantRaidProcessFormula, coreCount); this.RegisterDSEntity(serviceID, idStart, processCount, DSType.GiantRaid); return(nextDSType); case DSType.NormalRaid: processCount = this.GetProcessCount(this.NormalRaidProcessFormula, coreCount); this.RegisterDSEntity(serviceID, idStart, processCount, DSType.NormalRaid); return(nextDSType); case DSType.Pvp: processCount = this.GetProcessCount(this.PvpProcessFormula, coreCount); this.RegisterDSEntity(serviceID, idStart, processCount, DSType.Pvp); DSService.Instance.UpdatePvpDS(); return(nextDSType); case DSType.IsolateNormalRaid: processCount = this.GetProcessCount(this.NormalRaidProcessFormula, coreCount); this.RegisterDSEntity(serviceID, idStart, processCount, DSType.IsolateNormalRaid); return(nextDSType); } int num = idStart; processCount = this.GetProcessCount(this.PvpProcessFormula, coreCount); num = this.RegisterDSEntity(serviceID, num, processCount, DSType.Pvp); processCount = this.GetProcessCount(this.GiantRaidProcessFormula, coreCount); num = this.RegisterDSEntity(serviceID, num, processCount, DSType.GiantRaid); processCount = this.GetProcessCount(this.NormalRaidProcessFormula, coreCount); num = this.RegisterDSEntity(serviceID, num, processCount, DSType.NormalRaid); processCount = this.GetProcessCount(this.NormalRaidProcessFormula, coreCount); num = this.RegisterDSEntity(serviceID, num, processCount, DSType.IsolateNormalRaid); processCount = num - idStart; DSService.Instance.UpdatePvpDS(); return(nextDSType); }
public List <int> GetDestroyCadidateEntity(DSType dsType) { List <int> list = new List <int>(); int num = this.GetResorcePoint(dsType); foreach (KeyValuePair <int, DSEntityInfo> keyValuePair in this.EntityInfoDic) { if (keyValuePair.Value.State == DSEntityState.UnUsed) { num -= this.GetResorcePoint(keyValuePair.Value.DSType); list.Add(keyValuePair.Key); keyValuePair.Value.State = DSEntityState.Reserved; if (num <= 0) { return(list); } } } return(null); }
public override IEnumerable <object> Run() { if (this.service.DSWaitingSystem != null) { base.Finished = true; int idStart; int processCount; DSType dsType = this.service.DSWaitingSystem.DSStorage.RegisterDSService(base.Operation.ServiceID, base.Operation.CoreCount, base.Operation.GiantRaidMachine, out idStart, out processCount); yield return(idStart); yield return(processCount); yield return(dsType); } else { base.Finished = true; yield return(new FailMessage("[RegisterDSEntityProcessor] service.DSWaitingSystem")); } yield break; }
public static ulong EncryptSeed(DateTime dateTime, ulong MACaddress, Version version, Language language, DSType dstype, bool softReset, uint VCount, uint Timer0, uint GxStat, uint VFrame, uint buttonMashed) { var array = new uint[80]; uint[] h = {0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0}; array[5] = Reorder((VCount << 16) + Timer0); array[6] = (uint) (MACaddress & 0xFFFF); if (softReset) array[6] = array[6] ^ 0x01000000; array[7] = (uint) ((MACaddress >> 16) ^ (VFrame << 24) ^ GxStat); array[8] = seedDate(dateTime); array[9] = seedTime(dateTime, dstype); array[12] = buttonMashed; array[13] = 0x80000000; array[15] = 0x000001A0; // Get the version-unique part of the message Array.Copy(Nazos.Nazo(version, language, dstype), array, 5); uint a = h[0]; uint b = h[1]; uint c = h[2]; uint d = h[3]; uint e = h[4]; uint f = 0; uint k = 0; for (int i = 0; i < 80; i++) { if (i < 20) { f = (b & c) | ((~b) & d); k = 0x5A827999; } else if (i < 40 && i >= 20) { f = b ^ c ^ d; k = 0x6ED9EBA1; } else if (i >= 40 && i < 60) { f = (b & c) | (b & d) | (c & d); k = 0x8F1BBCDC; } else if (i >= 60) { f = b ^ c ^ d; k = 0xCA62C1D6; } if (i > 15) array[i] = RotateLeft(array[i - 3] ^ array[i - 8] ^ array[i - 14] ^ array[i - 16], 1); uint temp = RotateLeft(a, 5) + f + e + k + array[i]; e = d; d = c; c = RotateRight(b, 2); b = a; a = temp; } // SHA-1 calculates all the h[x], but we only need the first two for seeds h[0] += a; h[1] += b; ulong part1 = Reorder(h[0]); ulong part2 = Reorder(h[1]); ulong seed = 0x6C078965*part1; seed = seed + ((0x6C078965*part2) << 32); seed = seed + ((0x5D588B65*part1) << 32); seed = seed + 0x269EC3; return seed; }
public static uint seedHour(int hour, DSType dstype) { // All DSes return the hour in this dec->hex conversion // However, DSes prior to the 3DS add 0x40 past 12:00 PM if (dstype == DSType.DS_3DS) { switch (hour) { case 10: return 0x10000000; case 11: return 0x11000000; case 12: return 0x12000000; case 13: return 0x13000000; case 14: return 0x14000000; case 15: return 0x15000000; case 16: return 0x16000000; case 17: return 0x17000000; case 18: return 0x18000000; case 19: return 0x19000000; case 20: return 0x20000000; case 21: return 0x21000000; case 22: return 0x22000000; case 23: return 0x23000000; default: return (uint) hour << 24; } } switch (hour) { case 10: return 0x10000000; case 11: return 0x11000000; case 12: return 0x52000000; case 13: return 0x53000000; case 14: return 0x54000000; case 15: return 0x55000000; case 16: return 0x56000000; case 17: return 0x57000000; case 18: return 0x58000000; case 19: return 0x59000000; case 20: return 0x60000000; case 21: return 0x61000000; case 22: return 0x62000000; case 23: return 0x63000000; default: return (uint) hour << 24; } }
public static uint seedTime(DateTime dateTime, DSType dstype) { return seedSecond(dateTime.Second) | seedMinute(dateTime.Minute) | seedHour(dateTime.Hour, dstype); }
/// <summary> /// Returns an array containing the game-version specific portion of the SHA-1 seed encryption message. /// </summary> /// <returns>an array of size 5 with the correct nazo data, null for games without data</returns> public static uint[] Nazo(Version version, Language language, DSType dsType) { switch (language) { case Language.English: switch (version) { case Version.Black: return dsType == DSType.DS_Lite ? englishBlack : englishBlackDSi; case Version.White: return dsType == DSType.DS_Lite ? englishWhite : englishWhiteDSi; case Version.Black2: return dsType == DSType.DS_Lite ? englishBlack2 : englishBlack2DSi; case Version.White2: return dsType == DSType.DS_Lite ? englishWhite2 : englishWhite2DSi; } break; case Language.Japanese: switch (version) { case Version.Black: return dsType == DSType.DS_Lite ? japaneseBlack : japaneseBlackDSi; case Version.White: return dsType == DSType.DS_Lite ? japaneseWhite : japaneseWhiteDSi; case Version.Black2: return dsType == DSType.DS_Lite ? japaneseBlack2 : japaneseBlack2DSi; case Version.White2: return dsType == DSType.DS_Lite ? japaneseWhite2 : japaneseWhite2DSi; } break; case Language.German: switch (version) { case Version.Black: return dsType == DSType.DS_Lite ? germanBlack : germanBlackDSi; case Version.White: return dsType == DSType.DS_Lite ? germanWhite : germanWhiteDSi; case Version.Black2: return dsType == DSType.DS_Lite ? germanBlack2 : germanBlack2DSi; case Version.White2: return dsType == DSType.DS_Lite ? germanWhite2 : germanWhite2DSi; } break; case Language.Spanish: switch (version) { case Version.Black: return dsType == DSType.DS_Lite ? spanishBlack : spanishBlackDSi; case Version.White: return dsType == DSType.DS_Lite ? spanishWhite : spanishWhiteDSi; case Version.Black2: return dsType == DSType.DS_Lite ? spanishBlack2 : spanishBlack2DSi; case Version.White2: return dsType == DSType.DS_Lite ? spanishWhite2 : spanishWhite2DSi; } break; case Language.French: switch (version) { case Version.Black: return dsType == DSType.DS_Lite ? frenchBlack : frenchBlackDSi; case Version.White: return dsType == DSType.DS_Lite ? frenchWhite : frenchWhiteDSi; case Version.Black2: return dsType == DSType.DS_Lite ? frenchBlack2 : frenchBlack2DSi; case Version.White2: return dsType == DSType.DS_Lite ? frenchWhite2 : frenchWhite2DSi; } break; case Language.Italian: switch (version) { case Version.Black: return dsType == DSType.DS_Lite ? italianBlack : italianBlackDSi; case Version.White: return dsType == DSType.DS_Lite ? italianWhite : italianWhiteDSi; case Version.Black2: return dsType == DSType.DS_Lite ? italianBlack2 : italianBlack2DSi; case Version.White2: return dsType == DSType.DS_Lite ? italianWhite2 : italianWhite2DSi; } break; case Language.Korean: switch (version) { case Version.Black: return dsType == DSType.DS_Lite ? koreanBlack : null; case Version.White: return dsType == DSType.DS_Lite ? koreanWhite : null; case Version.Black2: return null; case Version.White2: return dsType == DSType.DS_Lite ? koreanWhite2 : koreanWhite2DSi; } break; } return null; }
private void GenerateSearchJob(DateTime testTime, int[] minIVs, int[] maxIVs, uint VCountMin, uint VCountMax, uint Timer0Min, uint Timer0Max, uint GxStatMin, uint GxStatMax, uint VFrameMin, uint VFrameMax, int secondsMin, int secondsMax, Version version, Language language, DSType dstype, int[] button, bool softReset, bool roamer, bool minMaxGxStat) { // offset the start by 2 for BW2 int offset = version == Version.Black2 || version == Version.White2 ? 2 : 0; uint buttonMashed = Functions.buttonMashed(button); var array = new uint[80]; uint[] h = {0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0}; array[6] = (uint) (MAC_address & 0xFFFF); if (softReset) { array[6] = array[6] ^ 0x01000000; } var upperMAC = (uint) (MAC_address >> 16); // Get the version-unique part of the message Array.Copy(Nazos.Nazo(version, language, dstype), array, 5); array[10] = 0x00000000; array[11] = 0x00000000; array[12] = buttonMashed; array[13] = 0x80000000; array[14] = 0x00000000; array[15] = 0x000001A0; array[8] = Functions.seedDate(testTime); var GxStatList = new List<uint> {GxStatMin}; // build the GxStat ranges if (GxStatMin != GxStatMax) if (!minMaxGxStat) GxStatList.Add(GxStatMax); else for (uint i = GxStatMin + 1; i <= GxStatMax; ++i) GxStatList.Add(i); for (int cntSeconds = secondsMin; cntSeconds <= secondsMax; cntSeconds++) { array[9] = Functions.seedTime(testTime, dstype); for (uint cntVCount = VCountMin; cntVCount <= VCountMax; cntVCount++) { for (uint cntTimer0 = Timer0Min; cntTimer0 <= Timer0Max; cntTimer0++) { array[5] = cntVCount*0x10000 + cntTimer0; array[5] = Functions.Reorder(array[5]); foreach (uint GxStat in GxStatList) { for (uint cntVFrame = VFrameMin; cntVFrame <= VFrameMax; cntVFrame++) { uint a = h[0]; uint b = h[1]; uint c = h[2]; uint d = h[3]; uint e = h[4]; uint f = 0; uint k = 0; array[7] = (upperMAC ^ (cntVFrame*0x1000000) ^ GxStat); for (int i = 0; i < 80; i++) { if (i < 20) { f = (b & c) | ((~b) & d); k = 0x5A827999; } if (i < 40 && i >= 20) { f = b ^ c ^ d; k = 0x6ED9EBA1; } if (i < 60 && i >= 40) { f = (b & c) | (b & d) | (c & d); k = 0x8F1BBCDC; } if (i >= 60) { f = b ^ c ^ d; k = 0xCA62C1D6; } if (i > 15) { array[i] = Functions.RotateLeft( array[i - 3] ^ array[i - 8] ^ array[i - 14] ^ array[i - 16], 1); } uint temp = Functions.RotateLeft(a, 5) + f + e + k + array[i]; e = d; d = c; c = Functions.RotateRight(b, 2); b = a; a = temp; } uint part1 = Functions.Reorder(h[0] + a); uint part2 = Functions.Reorder(h[1] + b); ulong seed2 = (ulong) part1*0x6C078965; uint seed1 = part2*0x6C078965 + (uint) (seed2 >> 32); seed1 = seed1 + (part1*0x5D588B65); seed2 = (uint) (seed2 & 0xFFFFFFFF) + 0x269EC3; ulong seed = (ulong) (seed1*0x100000000) + seed2; var tempSeed = (uint) (seed >> 32); progressSearched++; if (!findDirectSeed) { var IVArray = new int[6]; MersenneTwisterFast mt; if (roamer) { mt = new MersenneTwisterFast(tempSeed, 7); mt.Nextuint(); IVArray[0] = (int) (mt.Nextuint() >> 27); IVArray[1] = (int) (mt.Nextuint() >> 27); IVArray[2] = (int) (mt.Nextuint() >> 27); IVArray[4] = (int) (mt.Nextuint() >> 27); IVArray[5] = (int) (mt.Nextuint() >> 27); IVArray[3] = (int) (mt.Nextuint() >> 27); } else { //advance for BW2 mt = new MersenneTwisterFast(tempSeed, 6 + offset); for (int i = 0; i < offset; ++i) mt.Nextuint(); IVArray[0] = (int) (mt.Nextuint() >> 27); IVArray[1] = (int) (mt.Nextuint() >> 27); IVArray[2] = (int) (mt.Nextuint() >> 27); IVArray[3] = (int) (mt.Nextuint() >> 27); IVArray[4] = (int) (mt.Nextuint() >> 27); IVArray[5] = (int) (mt.Nextuint() >> 27); } if ((IVArray[0] >= minIVs[0] && IVArray[0] <= maxIVs[0]) && (IVArray[1] >= minIVs[1] && IVArray[1] <= maxIVs[1]) && (IVArray[2] >= minIVs[2] && IVArray[2] <= maxIVs[2]) && (IVArray[3] >= minIVs[3] && IVArray[3] <= maxIVs[3]) && (IVArray[4] >= minIVs[4] && IVArray[4] <= maxIVs[4]) && (IVArray[5] >= minIVs[5] && IVArray[5] <= maxIVs[5])) { var dsParameterFound = new DSParameterCapture { ActualSeconds = testTime.Second, VCount = cntVCount, Timer0 = cntTimer0, GxStat = GxStat, VFrame = cntVFrame, Seed = seed }; dsParameters.Add(dsParameterFound); refreshQueue = true; progressFound++; } } else { if (checkBoxHalfSeed.Checked) { if (tempSeed == (int) directSeed) { var dsParameterFound = new DSParameterCapture { ActualSeconds = testTime.Second, VCount = cntVCount, Timer0 = cntTimer0, GxStat = GxStat, VFrame = cntVFrame, Seed = seed }; dsParameters.Add(dsParameterFound); refreshQueue = true; progressFound++; } } else { if (seed == directSeed) { var dsParameterFound = new DSParameterCapture { ActualSeconds = testTime.Second, VCount = cntVCount, Timer0 = cntTimer0, GxStat = GxStat, VFrame = cntVFrame, Seed = seed }; dsParameters.Add(dsParameterFound); refreshQueue = true; progressFound++; } } } } } } } testTime = testTime.AddSeconds(1); } }
public DSEntityMakerQueue(long id, DSType dsType, int pvpServiceID) { this.ID = id; this.DSType = dsType; this.PVPServiceID = pvpServiceID; }
private void GenerateSearchJob(DateTime testTime, int[] minIVs, int[] maxIVs, uint VCountMin, uint VCountMax, uint Timer0Min, uint Timer0Max, uint GxStatMin, uint GxStatMax, uint VFrameMin, uint VFrameMax, int secondsMin, int secondsMax, Version version, Language language, DSType dstype, int[] button, bool softReset, bool roamer, bool minMaxGxStat) { // offset the start by 2 for BW2 int offset = version == Version.Black2 || version == Version.White2 ? 2 : 0; uint buttonMashed = Functions.buttonMashed(button); var array = new uint[80]; uint[] h = { 0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0 }; array[6] = (uint)(MAC_address & 0xFFFF); if (softReset) { array[6] = array[6] ^ 0x01000000; } var upperMAC = (uint)(MAC_address >> 16); // Get the version-unique part of the message Array.Copy(Nazos.Nazo(version, language, dstype), array, 5); array[10] = 0x00000000; array[11] = 0x00000000; array[12] = buttonMashed; array[13] = 0x80000000; array[14] = 0x00000000; array[15] = 0x000001A0; array[8] = Functions.seedDate(testTime); var GxStatList = new List <uint> { GxStatMin }; // build the GxStat ranges if (GxStatMin != GxStatMax) { if (!minMaxGxStat) { GxStatList.Add(GxStatMax); } else { for (uint i = GxStatMin + 1; i <= GxStatMax; ++i) { GxStatList.Add(i); } } } for (int cntSeconds = secondsMin; cntSeconds <= secondsMax; cntSeconds++) { array[9] = Functions.seedTime(testTime, dstype); for (uint cntVCount = VCountMin; cntVCount <= VCountMax; cntVCount++) { for (uint cntTimer0 = Timer0Min; cntTimer0 <= Timer0Max; cntTimer0++) { array[5] = cntVCount * 0x10000 + cntTimer0; array[5] = Functions.Reorder(array[5]); foreach (uint GxStat in GxStatList) { for (uint cntVFrame = VFrameMin; cntVFrame <= VFrameMax; cntVFrame++) { uint a = h[0]; uint b = h[1]; uint c = h[2]; uint d = h[3]; uint e = h[4]; uint f = 0; uint k = 0; array[7] = (upperMAC ^ (cntVFrame * 0x1000000) ^ GxStat); for (int i = 0; i < 80; i++) { if (i < 20) { f = (b & c) | ((~b) & d); k = 0x5A827999; } if (i < 40 && i >= 20) { f = b ^ c ^ d; k = 0x6ED9EBA1; } if (i < 60 && i >= 40) { f = (b & c) | (b & d) | (c & d); k = 0x8F1BBCDC; } if (i >= 60) { f = b ^ c ^ d; k = 0xCA62C1D6; } if (i > 15) { array[i] = Functions.RotateLeft( array[i - 3] ^ array[i - 8] ^ array[i - 14] ^ array[i - 16], 1); } uint temp = Functions.RotateLeft(a, 5) + f + e + k + array[i]; e = d; d = c; c = Functions.RotateRight(b, 2); b = a; a = temp; } uint part1 = Functions.Reorder(h[0] + a); uint part2 = Functions.Reorder(h[1] + b); ulong seed2 = (ulong)part1 * 0x6C078965; uint seed1 = part2 * 0x6C078965 + (uint)(seed2 >> 32); seed1 = seed1 + (part1 * 0x5D588B65); seed2 = (uint)(seed2 & 0xFFFFFFFF) + 0x269EC3; ulong seed = (ulong)(seed1 * 0x100000000) + seed2; var tempSeed = (uint)(seed >> 32); progressSearched++; if (!findDirectSeed) { var IVArray = new int[6]; MersenneTwisterFast mt; if (roamer) { mt = new MersenneTwisterFast(tempSeed, 7); mt.Nextuint(); IVArray[0] = (int)(mt.Nextuint() >> 27); IVArray[1] = (int)(mt.Nextuint() >> 27); IVArray[2] = (int)(mt.Nextuint() >> 27); IVArray[4] = (int)(mt.Nextuint() >> 27); IVArray[5] = (int)(mt.Nextuint() >> 27); IVArray[3] = (int)(mt.Nextuint() >> 27); } else { //advance for BW2 mt = new MersenneTwisterFast(tempSeed, 6 + offset); for (int i = 0; i < offset; ++i) { mt.Nextuint(); } IVArray[0] = (int)(mt.Nextuint() >> 27); IVArray[1] = (int)(mt.Nextuint() >> 27); IVArray[2] = (int)(mt.Nextuint() >> 27); IVArray[3] = (int)(mt.Nextuint() >> 27); IVArray[4] = (int)(mt.Nextuint() >> 27); IVArray[5] = (int)(mt.Nextuint() >> 27); } if ((IVArray[0] >= minIVs[0] && IVArray[0] <= maxIVs[0]) && (IVArray[1] >= minIVs[1] && IVArray[1] <= maxIVs[1]) && (IVArray[2] >= minIVs[2] && IVArray[2] <= maxIVs[2]) && (IVArray[3] >= minIVs[3] && IVArray[3] <= maxIVs[3]) && (IVArray[4] >= minIVs[4] && IVArray[4] <= maxIVs[4]) && (IVArray[5] >= minIVs[5] && IVArray[5] <= maxIVs[5])) { var dsParameterFound = new DSParameterCapture { ActualSeconds = testTime.Second, VCount = cntVCount, Timer0 = cntTimer0, GxStat = GxStat, VFrame = cntVFrame, Seed = seed }; dsParameters.Add(dsParameterFound); refreshQueue = true; progressFound++; } } else { if (checkBoxHalfSeed.Checked) { if (tempSeed == (int)directSeed) { var dsParameterFound = new DSParameterCapture { ActualSeconds = testTime.Second, VCount = cntVCount, Timer0 = cntTimer0, GxStat = GxStat, VFrame = cntVFrame, Seed = seed }; dsParameters.Add(dsParameterFound); refreshQueue = true; progressFound++; } } else { if (seed == directSeed) { var dsParameterFound = new DSParameterCapture { ActualSeconds = testTime.Second, VCount = cntVCount, Timer0 = cntTimer0, GxStat = GxStat, VFrame = cntVFrame, Seed = seed }; dsParameters.Add(dsParameterFound); refreshQueue = true; progressFound++; } } } } } } } testTime = testTime.AddSeconds(1); } }
public void Update(DSEntityState state, DSType dsType) { this.State = state; this.DSType = dsType; }
public IntellisenseItem(string text, DSType type, string tooltip) : this(text, type) { this.ToolTip = tooltip; }
public RequestMakeDSEntity(long id, DSType dsType) { this.ID = id; this.DSType = dsType; }
public RequestMakeDSEntity(long id, DSType dsType, int pvpServiceID) { this.ID = id; this.DSType = dsType; this.PVPServiceID = pvpServiceID; }
private void searchGenV(DateTime date, bool entireMonth, bool useSeed, ulong shinySeed, int seedFrame, bool usePID, uint pid, bool useID, uint id, bool useSID, uint sid, bool calcMinFrame, bool existingFile, ulong mAC, Version version, Language language, DSType dstype, bool softRest, uint vCount, uint timer0, uint gxStat, uint vFrame) { int dayMin, dayMax; uint shinyUpper = 0; bool xOR2 = false, starter = false; var rng = new BWRng(0); resultsCount = 0; int[] buttons = {0}; isSearching = true; if (useSeed) { rng.Seed = shinySeed; for (int i = 0; i < seedFrame; i++) { rng.Next(); } shinyUpper = (uint) (rng.Seed >> 32); xOR2 = Convert.ToBoolean((shinyUpper >> 31) ^ (shinyUpper & 1)); } if (entireMonth) { dayMin = 1; dayMax = DateTime.DaysInMonth(date.Year, date.Month); } else dayMin = dayMax = date.Day; long total = 86400*(dayMax - dayMin + 1); for (int day = dayMin; day <= dayMax; day++) { for (int hour = 0; hour < 24; hour++) { for (int minute = 0; minute < 60; minute++) { for (int second = 0; second < 60; second++) { var dTime = new DateTime(date.Year, date.Month, day, hour, minute, second); for (int button = 0; button < 13; button++) { buttons[0] = button; ulong seed = Functions.EncryptSeed(dTime, mAC, version, language, dstype, softRest, vCount, timer0, gxStat, vFrame, Functions.buttonMashed(buttons)); rng.Seed = seed; ulong oSeed = seed; if (calcMinFrame) { minFrame = (int) Functions.initialPIDRNG_ID(seed, existingFile, version); } for (int frame = 0; frame < minFrame; frame++) { rng.Next(); } for (int frame = minFrame; frame <= maxFrame; frame++) { rng.Next(); seed = rng.Seed; var upper = (uint) (((seed >> 32)*0xFFFFFFFF) >> 32); uint tid = (upper & 0xFFFF); uint tsid = (upper >> 16); if (useSeed) { bool xOR1 = Convert.ToBoolean((tid + tsid) & 1); if (xOR1 ^ xOR2) { pid = shinyUpper ^ 0x80010000; starter = false; } else { pid = shinyUpper ^ 0x00010000; starter = true; } pid = ((pid >> 16) ^ (pid << 16 >> 16)); } if ((!useID || (tid == id)) && (!useSID || (tsid == sid))) { if (useSeed && (tid ^ tsid ^ pid) >= 8) continue; if (usePID && !Functions.Shiny(pid, (ushort) tid, (ushort) tsid)) continue; var iDSeed = new IDListBW { Seed = oSeed, Date = dTime.ToShortDateString(), Time = dTime.ToString("HH:mm:ss"), InitialFrame = minFrame, Frame = frame, ID = tid, SID = tsid, Starter = starter.ToString(), Button = Functions.buttonStrings[button] }; resultsListBW.Add(iDSeed); refresh = true; if (resultsCount++ >= MAX_RESULTS) { lblAction.Text = "Search stopped - results max reached. Narrow your search for better results."; isSearching = false; return; } } } } } } lblAction.Text = ((((day - dayMin)*24 + hour + 1)*3600)/(float) total*100) + "%"; } } isSearching = false; lblAction.Text = "Done. - Awaiting Command"; }
public bool HasEntity(DSType dsType) { return((from x in this.EntityInfoDic where x.Value.State == DSEntityState.UnUsed && x.Value.DSType == dsType select x).Count <KeyValuePair <int, DSEntityInfo> >() > 0); }
private void searchGenVHit(DateTime date, int hour, int minute, int minSec, int maxSec, int minframe, int maxframe, uint id, ulong mAC, Version version, Language language, DSType dstype, bool softReset, uint vCount, uint timer0, uint gxStat, uint vFrame) { var rng = new BWRng(0); int[] buttons = {0}; isSearching = true; for (int sec = minSec; sec <= maxSec; sec++) { var dTime = new DateTime(date.Year, date.Month, date.Day, hour, minute, sec); for (int button = 0; button < 13; button++) { buttons[0] = button; ulong seed = Functions.EncryptSeed(dTime, mAC, version, language, dstype, softReset, vCount, timer0, gxStat, vFrame, Functions.buttonMashed(buttons)); rng.Seed = seed; ulong oSeed = seed; for (int frame = 0; frame < minframe; frame++) { rng.Next(); } for (int frame = minframe; frame <= maxframe; frame++) { rng.Next(); seed = rng.Seed; var upper = (uint) (((seed >> 32)*0xFFFFFFFF) >> 32); uint tid = (upper & 0xFFFF); uint sid = (upper >> 16); if (tid == id) { var iDSeed = new IDListBW { Seed = oSeed, Date = dTime.ToShortDateString(), Time = dTime.ToString("HH:mm:ss"), Frame = frame, InitialFrame = (int) Functions.initialPIDRNG_ID(oSeed, false, version), ID = tid, SID = sid, Starter = "N/A", Button = Functions.buttonStrings[button] }; resultsListBW.Add(iDSeed); refresh = true; } } } } isSearching = false; lblAction.Text = "Done. - Awaiting Command"; }
private void Search(DateTime date, uint vcountMin, uint vcountMax, uint timer0Min, uint timer0Max, uint vframeMin, uint vframeMax, uint gxstatMin, uint gxstatMax, bool minmaxgxstat, int secondsMin, int secondsMax, bool softreset, Version version, Language language, DSType dstype, bool memorylink, ulong macaddress, uint buttons, uint[] pattern) { var array = new uint[80]; array[6] = (uint)(macaddress & 0xFFFF); if (softreset) { array[6] = array[6] ^ 0x01000000; } Array.Copy(Nazos.Nazo(version, language, dstype), array, 5); array[10] = 0x00000000; array[11] = 0x00000000; array[13] = 0x80000000; array[14] = 0x00000000; array[15] = 0x000001A0; array[12] = buttons; string yearMonth = String.Format("{0:00}", date.Year % 2000) + String.Format("{0:00}", date.Month); string dateString = String.Format("{0:00}", (int)date.DayOfWeek); dateString = String.Format("{0:00}", date.Day) + dateString; dateString = yearMonth + dateString; array[8] = uint.Parse(dateString, NumberStyles.HexNumber); array[9] = 0x0; //uint[] alpha = Functions.alphaSHA1(array, 8); var upperMAC = (uint)(macaddress >> 16); for (uint vcount = vcountMin; vcount <= vcountMax; ++vcount) { for (uint timer0 = timer0Min; timer0 <= timer0Max; ++timer0) { array[5] = (vcount << 16) + timer0; array[5] = Functions.Reorder(array[5]); for (uint vframe = vframeMin; vframe <= vframeMax; ++vframe) { for (uint gxstat = gxstatMin; gxstat <= gxstatMax; ++gxstat) { array[7] = (upperMAC ^ (vframe * 0x1000000) ^ gxstat); uint[] alpha = Functions.alphaSHA1(array); array[16] = Functions.RotateLeft(array[13] ^ array[8] ^ array[2] ^ array[0], 1); array[18] = Functions.RotateLeft(array[15] ^ array[10] ^ array[4] ^ array[2], 1); array[19] = Functions.RotateLeft(array[16] ^ array[11] ^ array[5] ^ array[3], 1); array[21] = Functions.RotateLeft(array[18] ^ array[13] ^ array[7] ^ array[5], 1); array[22] = Functions.RotateLeft(array[19] ^ array[14] ^ array[8] ^ array[6], 1); array[24] = Functions.RotateLeft(array[21] ^ array[16] ^ array[10] ^ array[8], 1); array[27] = Functions.RotateLeft(array[24] ^ array[19] ^ array[13] ^ array[11], 1); for (int second = secondsMin; second <= secondsMax; ++second) { array[9] = Functions.seedSecond(second) | Functions.seedMinute(date.Minute) | Functions.seedHour(date.Hour, dstype); ulong seed = Functions.EncryptSeed(array, alpha, 9); // it appears to have the same initial seed as in the main game // pressing Unova link does the same probability table calls uint initial = Functions.initialPIDRNG(seed, version, memorylink); var rng = new BWRng(seed); for (uint i = 0; i < initial; ++i) { rng.GetNext64BitNumber(); } bool found = true; for (uint i = 0; i < pattern.Length; ++i) { if (pattern[i] != rng.GetNext32BitNumber(8)) { found = false; break; } // there's another RNG call here unreleated to the spinner rng.GetNext64BitNumber(); } progressSearched++; if (found) { var parameter = new DSParameterCapture { ActualSeconds = second, GxStat = gxstat, Seed = seed, Timer0 = timer0, VCount = vcount, VFrame = vframe }; dsParameters.Add(parameter); refreshQueue = true; progressFound++; } } if (minmaxgxstat && gxstatMax > gxstatMin) { gxstat = gxstatMax - 1; } } } } } }
private void Search(DateTime date, uint vcountMin, uint vcountMax, uint timer0Min, uint timer0Max, uint vframeMin, uint vframeMax, uint gxstatMin, uint gxstatMax, bool minmaxgxstat, int secondsMin, int secondsMax, bool softreset, Version version, Language language, DSType dstype, bool memorylink, ulong macaddress, uint buttons, uint[] pattern) { var array = new uint[80]; array[6] = (uint) (macaddress & 0xFFFF); if (softreset) { array[6] = array[6] ^ 0x01000000; } Array.Copy(Nazos.Nazo(version, language, dstype), array, 5); array[10] = 0x00000000; array[11] = 0x00000000; array[13] = 0x80000000; array[14] = 0x00000000; array[15] = 0x000001A0; array[12] = buttons; string yearMonth = String.Format("{0:00}", date.Year%2000) + String.Format("{0:00}", date.Month); string dateString = String.Format("{0:00}", (int) date.DayOfWeek); dateString = String.Format("{0:00}", date.Day) + dateString; dateString = yearMonth + dateString; array[8] = uint.Parse(dateString, NumberStyles.HexNumber); array[9] = 0x0; //uint[] alpha = Functions.alphaSHA1(array, 8); var upperMAC = (uint) (macaddress >> 16); for (uint vcount = vcountMin; vcount <= vcountMax; ++vcount) { for (uint timer0 = timer0Min; timer0 <= timer0Max; ++timer0) { array[5] = (vcount << 16) + timer0; array[5] = Functions.Reorder(array[5]); for (uint vframe = vframeMin; vframe <= vframeMax; ++vframe) { for (uint gxstat = gxstatMin; gxstat <= gxstatMax; ++gxstat) { array[7] = (upperMAC ^ (vframe*0x1000000) ^ gxstat); uint[] alpha = Functions.alphaSHA1(array, 8); array[16] = Functions.RotateLeft(array[13] ^ array[8] ^ array[2] ^ array[0], 1); array[18] = Functions.RotateLeft(array[15] ^ array[10] ^ array[4] ^ array[2], 1); array[19] = Functions.RotateLeft(array[16] ^ array[11] ^ array[5] ^ array[3], 1); array[21] = Functions.RotateLeft(array[18] ^ array[13] ^ array[7] ^ array[5], 1); array[22] = Functions.RotateLeft(array[19] ^ array[14] ^ array[8] ^ array[6], 1); array[24] = Functions.RotateLeft(array[21] ^ array[16] ^ array[10] ^ array[8], 1); array[27] = Functions.RotateLeft(array[24] ^ array[19] ^ array[13] ^ array[11], 1); for (int second = secondsMin; second <= secondsMax; ++second) { array[9] = Functions.seedSecond(second) | Functions.seedMinute(date.Minute) | Functions.seedHour(date.Hour, dstype); ulong seed = Functions.EncryptSeed(array, alpha, 9); // it appears to have the same initial seed as in the main game // pressing Unova link does the same probability table calls uint initial = Functions.initialPIDRNG(seed, version, memorylink); var rng = new BWRng(seed); for (uint i = 0; i < initial; ++i) rng.GetNext64BitNumber(); bool found = true; for (uint i = 0; i < pattern.Length; ++i) { if (pattern[i] != rng.GetNext32BitNumber(8)) { found = false; break; } // there's another RNG call here unreleated to the spinner rng.GetNext64BitNumber(); } progressSearched++; if (found) { var parameter = new DSParameterCapture { ActualSeconds = second, GxStat = gxstat, Seed = seed, Timer0 = timer0, VCount = vcount, VFrame = vframe }; dsParameters.Add(parameter); refreshQueue = true; progressFound++; } } if (minmaxgxstat && gxstatMax > gxstatMin) gxstat = gxstatMax - 1; } } } } }
public DSEntityMakerQueue(long id, DSType dsType) { this.ID = id; this.DSType = dsType; this.PVPServiceID = 0; }
public void Process() { List <DSEntityMakerQueue> dSEntityMakerQueues = new List <DSEntityMakerQueue>(); Dictionary <int, int> nums = new Dictionary <int, int>(); foreach (DSEntityMakerQueue dSEntityMakerList in this.DSEntityMakerList) { int serviceID = 0; int num = -1; DSType dSType = dSEntityMakerList.DSType; DSServiceInfo dSServiceInfo = null; bool flag = false; List <DSServiceInfo> list = ( from x in this.DSServiceInfoDic.Values where x.HasEntity(dSType) select x).ToList <DSServiceInfo>(); List <DSServiceInfo> dSServiceInfos = ( from x in this.DSServiceInfoDic.Values where x.CheckResource(dSType) select x).ToList <DSServiceInfo>(); List <DSServiceInfo> list1 = ( from x in this.DSServiceInfoDic.Values where x.HasUnuseEntity(dSType) select x).ToList <DSServiceInfo>(); if (( from x in this.DSServiceInfoDic where x.Value.useFlag select x).Count <KeyValuePair <int, DSServiceInfo> >() == this.DSServiceInfoDic.Count) { foreach (KeyValuePair <int, DSServiceInfo> dSServiceInfoDic in this.DSServiceInfoDic) { dSServiceInfoDic.Value.useFlag = false; } } if (list.Count > 0) { dSServiceInfo = ( from x in list orderby x.Resource descending select x).First <DSServiceInfo>(); serviceID = dSServiceInfo.ServiceID; Log <DSEntityMakerSystem> .Logger.InfoFormat("Find DS Entity!! ServiceID : [{0}]", serviceID); num = dSServiceInfo.UseEntityAndGetDSID(dSType); } else if (dSServiceInfos.Count <= 0) { if (list1.Count <= 0) { continue; } dSServiceInfo = ( from x in list1 orderby x.Resource descending select x).First <DSServiceInfo>(); List <int> .Enumerator enumerator = dSServiceInfo.GetDestroyCadidateEntity(dSType).GetEnumerator(); try { while (enumerator.MoveNext()) { int current = enumerator.Current; nums.Add(current, dSServiceInfo.ServiceID); Log <DSEntityMakerSystem> .Logger.InfoFormat("Delete Entity ServiceID : [{0}] EntityID : [{1}]", serviceID, current); } continue; } finally { ((IDisposable)enumerator).Dispose(); } } else { dSServiceInfo = (( from x in dSServiceInfos where !x.useFlag select x).Count <DSServiceInfo>() <= 0 ? ( from x in dSServiceInfos orderby x.Resource descending select x).First <DSServiceInfo>() : ( from x in dSServiceInfos where !x.useFlag orderby x.Resource descending select x).First <DSServiceInfo>()); serviceID = dSServiceInfo.ServiceID; Log <DSEntityMakerSystem> .Logger.InfoFormat("Find DS Service!! ServiceID : [{0}]", serviceID); num = dSServiceInfo.UseResourceAndGetDSID(dSType); flag = true; } this.Parent.DSWaitingSystem.DSStorage.DSMap.Add(num, new DSInfo(num, serviceID, dSType)); dSEntityMakerQueues.Add(dSEntityMakerList); if (flag) { MakeDSEntity makeDSEntity = new MakeDSEntity(num); makeDSEntity.OnComplete += new Action <Operation>((Operation _) => { if (dSEntityMakerList.DSType != DSType.Pvp) { this.Parent.DSWaitingSystem.ProcessAll(); return; } UpdatePvpDSInfo updatePvpDSInfo = new UpdatePvpDSInfo(num, new DSInfo(num, serviceID, dSType)); this.Parent.RequestOperation(dSEntityMakerList.PVPServiceID, updatePvpDSInfo); this.DSServiceInfoDic[serviceID].EntityInfoDic[num].TargetPvpServiceID = dSEntityMakerList.PVPServiceID; }); this.Parent.RequestOperation(serviceID, makeDSEntity); } else if (dSEntityMakerList.DSType != DSType.Pvp) { this.Parent.DSWaitingSystem.ProcessAll(); } else { UpdatePvpDSInfo updatePvpDSInfo1 = new UpdatePvpDSInfo(num, new DSInfo(num, serviceID, dSType)); this.Parent.RequestOperation(dSEntityMakerList.PVPServiceID, updatePvpDSInfo1); this.DSServiceInfoDic[serviceID].EntityInfoDic[num].TargetPvpServiceID = dSEntityMakerList.PVPServiceID; } } foreach (KeyValuePair <int, int> keyValuePair in nums) { DSLog.AddLog(keyValuePair.Key, "", (long)-1, -1, "RemoveDSEntity", ""); RemoveDSEntity removeDSEntity = new RemoveDSEntity(keyValuePair.Key); this.Parent.RequestOperation(keyValuePair.Value, removeDSEntity); } foreach (DSEntityMakerQueue dSEntityMakerQueue in dSEntityMakerQueues) { this.DSEntityMakerList.Remove(dSEntityMakerQueue); } }
/// <summary> /// Returns an array containing the game-version specific portion of the SHA-1 seed encryption message. /// </summary> /// <returns>an array of size 5 with the correct nazo data, null for games without data</returns> public static uint[] Nazo(Version version, Language language, DSType dsType) { switch (language) { case Language.English: switch (version) { case Version.Black: return(dsType == DSType.DS_Lite ? englishBlack : englishBlackDSi); case Version.White: return(dsType == DSType.DS_Lite ? englishWhite : englishWhiteDSi); case Version.Black2: return(dsType == DSType.DS_Lite ? englishBlack2 : englishBlack2DSi); case Version.White2: return(dsType == DSType.DS_Lite ? englishWhite2 : englishWhite2DSi); } break; case Language.Japanese: switch (version) { case Version.Black: return(dsType == DSType.DS_Lite ? japaneseBlack : japaneseBlackDSi); case Version.White: return(dsType == DSType.DS_Lite ? japaneseWhite : japaneseWhiteDSi); case Version.Black2: return(dsType == DSType.DS_Lite ? japaneseBlack2 : japaneseBlack2DSi); case Version.White2: return(dsType == DSType.DS_Lite ? japaneseWhite2 : japaneseWhite2DSi); } break; case Language.German: switch (version) { case Version.Black: return(dsType == DSType.DS_Lite ? germanBlack : germanBlackDSi); case Version.White: return(dsType == DSType.DS_Lite ? germanWhite : germanWhiteDSi); case Version.Black2: return(dsType == DSType.DS_Lite ? germanBlack2 : germanBlack2DSi); case Version.White2: return(dsType == DSType.DS_Lite ? germanWhite2 : germanWhite2DSi); } break; case Language.Spanish: switch (version) { case Version.Black: return(dsType == DSType.DS_Lite ? spanishBlack : spanishBlackDSi); case Version.White: return(dsType == DSType.DS_Lite ? spanishWhite : spanishWhiteDSi); case Version.Black2: return(dsType == DSType.DS_Lite ? spanishBlack2 : spanishBlack2DSi); case Version.White2: return(dsType == DSType.DS_Lite ? spanishWhite2 : spanishWhite2DSi); } break; case Language.French: switch (version) { case Version.Black: return(dsType == DSType.DS_Lite ? frenchBlack : frenchBlackDSi); case Version.White: return(dsType == DSType.DS_Lite ? frenchWhite : frenchWhiteDSi); case Version.Black2: return(dsType == DSType.DS_Lite ? frenchBlack2 : frenchBlack2DSi); case Version.White2: return(dsType == DSType.DS_Lite ? frenchWhite2 : frenchWhite2DSi); } break; case Language.Italian: switch (version) { case Version.Black: return(dsType == DSType.DS_Lite ? italianBlack : italianBlackDSi); case Version.White: return(dsType == DSType.DS_Lite ? italianWhite : italianWhiteDSi); case Version.Black2: return(dsType == DSType.DS_Lite ? italianBlack2 : italianBlack2DSi); case Version.White2: return(dsType == DSType.DS_Lite ? italianWhite2 : italianWhite2DSi); } break; case Language.Korean: switch (version) { case Version.Black: return(dsType == DSType.DS_Lite ? koreanBlack : null); case Version.White: return(dsType == DSType.DS_Lite ? koreanWhite : null); case Version.Black2: return(null); case Version.White2: return(dsType == DSType.DS_Lite ? koreanWhite2 : koreanWhite2DSi); } break; } return(null); }
public bool CheckResource(DSType dsType) { return(this.Resource - this.GetResorcePoint(dsType) >= 0); }