forked from aly/qstbak
muffin v7.5.11
This commit is contained in:
parent
addf2d530f
commit
3102923ce2
522 changed files with 41082 additions and 211592 deletions
|
|
@ -40,118 +40,53 @@ public sealed class WeatherHelper
|
|||
public Weather? GetWeatherAtTime(uint territoryId, long unixSeconds)
|
||||
{
|
||||
TerritoryType? rowOrDefault = _dataManager.GetExcelSheet<TerritoryType>().GetRowOrDefault(territoryId);
|
||||
int num = (rowOrDefault.HasValue ? 1395957685 : 1395957681);
|
||||
while (true)
|
||||
if (!rowOrDefault.HasValue)
|
||||
{
|
||||
int num2 = num;
|
||||
int num3 = 1395957685;
|
||||
int num4 = num2;
|
||||
int num5 = num4 + num3;
|
||||
int num6 = num4 & num3;
|
||||
switch (num5 - (num6 + num6))
|
||||
{
|
||||
case 1:
|
||||
{
|
||||
WeatherRate value = rowOrDefault.Value.WeatherRate.Value;
|
||||
uint target = CalculateTarget(unixSeconds);
|
||||
return ResolveWeather(value, target);
|
||||
}
|
||||
case 0:
|
||||
num = (rowOrDefault.Value.WeatherRate.IsValid ? 1395957684 : 1395957687);
|
||||
break;
|
||||
case 4:
|
||||
return null;
|
||||
case 3:
|
||||
num = 1395957681;
|
||||
break;
|
||||
case 2:
|
||||
return null;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
if (!rowOrDefault.Value.WeatherRate.IsValid)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
WeatherRate value = rowOrDefault.Value.WeatherRate.Value;
|
||||
uint target = CalculateTarget(unixSeconds);
|
||||
return ResolveWeather(value, target);
|
||||
}
|
||||
|
||||
internal static uint CalculateTarget(long unixSeconds)
|
||||
{
|
||||
long num = unixSeconds / 175;
|
||||
long num2 = 8L;
|
||||
long num3 = num;
|
||||
long num4 = num3 ^ num2;
|
||||
long num5 = num3 & num2;
|
||||
uint num6 = (uint)((num4 + (num5 + num5) - num % 8) % 24);
|
||||
int num7 = (int)(unixSeconds / 4200) * 100;
|
||||
int num8 = (int)num6;
|
||||
int num9 = num7;
|
||||
int num10 = num9 ^ num8;
|
||||
int num11 = num9 & num8;
|
||||
uint num12 = (uint)(num10 + (num11 + num11));
|
||||
uint num13 = num12 << 11;
|
||||
num8 = (int)num12;
|
||||
num9 = (int)num13;
|
||||
int num14 = num9 + num8;
|
||||
int num15 = num9 & num8;
|
||||
uint num16 = (uint)(num14 - (num15 + num15));
|
||||
uint num17 = num16 >> 8;
|
||||
num8 = (int)num16;
|
||||
num9 = (int)num17;
|
||||
return (uint)((num9 | num8) - (num9 & num8)) % 100u;
|
||||
uint num2 = (uint)((num + 8 - num % 8) % 24);
|
||||
uint num3 = (uint)((int)(unixSeconds / 4200) * 100) + num2;
|
||||
uint num4 = (num3 << 11) ^ num3;
|
||||
return ((num4 >> 8) ^ num4) % 100;
|
||||
}
|
||||
|
||||
private static Weather? ResolveWeather(WeatherRate weatherRate, uint target)
|
||||
{
|
||||
Weather? result = null;
|
||||
int num = 0;
|
||||
int num2 = 0;
|
||||
int num3 = -1371049026;
|
||||
RowRef<Weather> rowRef = default(RowRef<Weather>);
|
||||
while (true)
|
||||
for (int i = 0; i < weatherRate.Rate.Count; i++)
|
||||
{
|
||||
int num4 = num3;
|
||||
int num5 = -1371049029;
|
||||
int num6 = num4;
|
||||
int num7 = num6 + num5;
|
||||
int num8 = num6 & num5;
|
||||
switch (num7 - (num8 + num8))
|
||||
if (weatherRate.Rate[i] <= 0)
|
||||
{
|
||||
case 0:
|
||||
return rowRef.Value;
|
||||
case 4:
|
||||
num3 = (rowRef.IsValid ? (-1371049029) : (-1371049027));
|
||||
break;
|
||||
case 2:
|
||||
result = rowRef.Value;
|
||||
num3 = -1371049030;
|
||||
break;
|
||||
case 6:
|
||||
return null;
|
||||
case 7:
|
||||
rowRef = weatherRate.Weather[num2];
|
||||
num3 = ((!rowRef.IsValid) ? (-1371049030) : (-1371049031));
|
||||
break;
|
||||
case 9:
|
||||
num3 = ((weatherRate.Rate[num2] <= 0) ? (-1371049039) : (-1371049028));
|
||||
break;
|
||||
case 8:
|
||||
num3 = -1371049026;
|
||||
break;
|
||||
case 1:
|
||||
num += weatherRate.Rate[num2];
|
||||
num3 = ((target >= num) ? (-1371049039) : (-1371049025));
|
||||
break;
|
||||
case 10:
|
||||
{
|
||||
int num9 = num2;
|
||||
num5 = 1;
|
||||
num6 = num9;
|
||||
num2 = (num6 | num5) + (num6 & num5);
|
||||
num3 = -1371049026;
|
||||
break;
|
||||
continue;
|
||||
}
|
||||
case 3:
|
||||
return result;
|
||||
case 5:
|
||||
num3 = ((num2 < weatherRate.Rate.Count) ? (-1371049038) : (-1371049032));
|
||||
break;
|
||||
RowRef<Weather> rowRef = weatherRate.Weather[i];
|
||||
if (rowRef.IsValid)
|
||||
{
|
||||
result = rowRef.Value;
|
||||
}
|
||||
num += weatherRate.Rate[i];
|
||||
if (target < num)
|
||||
{
|
||||
if (!rowRef.IsValid)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
return rowRef.Value;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue