aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYour Name <you@example.com>2019-01-22 21:21:50 +0900
committerYour Name <you@example.com>2019-01-23 00:27:57 +0900
commita68959d6989db62aaa5967ef9b272e0f28a48913 (patch)
treeccd9e155c618b131c06d7d8f9fb1b240eff74ffa
parent613d4f90fdc559573e3e6433ae70d4074b809706 (diff)
downloadwf-clock-a68959d6989db62aaa5967ef9b272e0f28a48913.tar.gz
update orb vallis weather calculation
-rw-r--r--WarframeClock/Clock.cs22
1 files changed, 8 insertions, 14 deletions
diff --git a/WarframeClock/Clock.cs b/WarframeClock/Clock.cs
index 688781b..956cfaa 100644
--- a/WarframeClock/Clock.cs
+++ b/WarframeClock/Clock.cs
@@ -4,19 +4,13 @@ namespace WarframeClock
{
public static class Clock
{
- public static long CetusExpiry { get; set; } = -1;
+ public static long? CetusExpiry { get; set; }
public static string CetusExpiryString()
{
double currentTime = GetCurrentTime();
- double cetusLen = 8998.8748;
- double cetusDayLen = 8248.9686 - 2249.7187;
- double cetusBegin = 1509371722 + 2249.7187;
-
- if (CetusExpiry >= 0)
- {
- cetusBegin = CetusExpiry / 1000 - cetusLen;
- }
+ double cetusLen = 8998.8748, cetusDayLen = cetusLen * 2 / 3;
+ double cetusBegin = (CetusExpiry ?? 1548159123053) / 1000.0 - cetusLen;
cetusBegin += Math.Floor((currentTime - cetusBegin) / cetusLen) * cetusLen;
if (currentTime < cetusBegin + cetusDayLen)
@@ -28,15 +22,15 @@ namespace WarframeClock
public static string VallisExpiryString()
{
double currentTime = GetCurrentTime();
- double dayStart = 1542131224;
+ double dayStart = 1548148830; // 2019-01-22 09:20:30 +0000
dayStart += Math.Floor((currentTime - dayStart) / 1600) * 1600;
- if (currentTime - dayStart < 400)
- return $"Vallis: ❄️[→☁] {GetReadableTimeSpan(dayStart + 400 - currentTime)}";
+ if (currentTime - dayStart < 467)
+ return $"Vallis: ❄️[→☁] {GetReadableTimeSpan(dayStart + 467 - currentTime)}";
else if (currentTime - dayStart < 800)
- return $"Vallis: ☁[→🌣] {GetReadableTimeSpan(dayStart + 800 - currentTime)}";
+ return $"Vallis: ☁[→☀️] {GetReadableTimeSpan(dayStart + 800 - currentTime)}";
else if (currentTime - dayStart < 1200)
- return $"Vallis: 🌣[→☁] {GetReadableTimeSpan(dayStart + 1200 - currentTime)}";
+ return $"Vallis: ☀️[→☁] {GetReadableTimeSpan(dayStart + 1200 - currentTime)}";
else
return $"Vallis: ☁[→❄️] {GetReadableTimeSpan(dayStart + 1600 - currentTime)}";
}