Skip to content

Commit

Permalink
Timestamp fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MeTonaTOR committed Feb 3, 2019
1 parent 8cf788c commit 545ee95
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 22 deletions.
15 changes: 11 additions & 4 deletions GameLauncher/App/Classes/Events/Updater.cs
Expand Up @@ -66,9 +66,16 @@ class LauncherUpdateCheck
try {
if(updater.Code == 0) {
if (updater.Payload.UpdateExists == false) {
text.Text = "Launcher Status - Updated";
status.Image = Properties.Resources.ac_success;
text.ForeColor = Color.FromArgb(0x9fc120);
//if(updater.Payload.LatestVersion.CompareTo(updater.Payload.ClientVersion) > 0) {
text.Text = "Launcher Status - Updated";
status.Image = Properties.Resources.ac_success;
text.ForeColor = Color.FromArgb(0x9fc120);
//} else {
// text.Text = "Launcher Status - Prerelease";
// status.Image = Properties.Resources.ac_warning;
// text.ForeColor = Color.Yellow;
//}
description.Text = "Version : v" + Application.ProductVersion + "build-" + SHA.HashFile(AppDomain.CurrentDomain.FriendlyName).Substring(0, 7);
} else {
text.Text = "Launcher Status - Available";
Expand Down Expand Up @@ -130,7 +137,7 @@ class LauncherUpdateCheck
text.ForeColor = Color.FromArgb(254, 0, 0);
description.Text = "Version : v" + Application.ProductVersion + "build-" + SHA.HashFile(AppDomain.CurrentDomain.FriendlyName).Substring(0, 7);
}
} catch {
} catch(Exception ex) {
if(text.InvokeRequired == true) //checks skip, because we only need to know if we can access ui from actual thread
{
text.Invoke(new Action(delegate ()
Expand Down
26 changes: 19 additions & 7 deletions GameLauncher/App/Classes/RPC/DiscordGamePresence.cs
Expand Up @@ -89,7 +89,6 @@ class DiscordGamePresence {
SmallImageText = "Treasure Hunt - Day: " + TEDay,
SmallImageKey = "gamemode_treasure"
};
//_presence.Timestamps = Timestamps. RPCstartTimestamp; TODO: repair
MainScreen.discordRpcClient.SetPresence(_presence);

Console.WriteLine(serverreply);
Expand Down Expand Up @@ -154,7 +153,12 @@ class DiscordGamePresence {
SmallImageText = "In-Freeroam",
SmallImageKey = "gamemode_freeroam"
};
//_presence.startTimestamp = RPCstartTimestamp; TODO: repair

_presence.Timestamps = new Timestamps() {
Start = null,
End = null
};

MainScreen.discordRpcClient.SetPresence(_presence);

eventTerminatedManually = true;
Expand All @@ -174,7 +178,6 @@ class DiscordGamePresence {
SmallImageText = EventList.getEventName(Convert.ToInt32(EventID)),
SmallImageKey = EventList.getEventType(Convert.ToInt32(EventID))
};
//_presence.startTimestamp = RPCstartTimestamp; TODO: repair
MainScreen.discordRpcClient.SetPresence(_presence);

eventTerminatedManually = false;
Expand All @@ -196,7 +199,12 @@ class DiscordGamePresence {
_presence.Assets.LargeImageText = PersonaName + " - Level: " + PersonaLevel;
_presence.Assets.LargeImageKey = PersonaAvatarId;
_presence.Assets.SmallImageKey = "gamemode_freeroam";
//_presence.startTimestamp = RPCstartTimestamp; TODO: repair

_presence.Timestamps = new Timestamps() {
Start = null,
End = null
};

MainScreen.discordRpcClient.SetPresence(_presence);
}

Expand All @@ -213,7 +221,7 @@ class DiscordGamePresence {
SmallImageText = EventList.getEventName(EventID),
SmallImageKey = EventList.getEventType(EventID)
};
//_presence.startTimestamp = RPCstartTimestamp; TODO: repair

MainScreen.discordRpcClient.SetPresence(_presence);

eventTerminatedManually = false;
Expand All @@ -228,7 +236,6 @@ class DiscordGamePresence {
SmallImageText = EventList.getEventName(EventID),
SmallImageKey = EventList.getEventType(EventID)
};
//_presence.startTimestamp = RPCstartTimestamp; TODO: repair
MainScreen.discordRpcClient.SetPresence(_presence);

eventTerminatedManually = false;
Expand All @@ -243,7 +250,12 @@ class DiscordGamePresence {
SmallImageText = EventList.getEventName(EventID),
SmallImageKey = EventList.getEventType(EventID)
};
//_presence.startTimestamp = Self.getTimestamp(true); TODO: repair

_presence.Timestamps = new Timestamps() {
Start = DateTime.UtcNow,
End = null
};

MainScreen.discordRpcClient.SetPresence(_presence);
}

Expand Down
3 changes: 1 addition & 2 deletions GameLauncher/App/Classes/Self.cs
Expand Up @@ -10,8 +10,7 @@

namespace GameLauncherReborn {
class Self {
//public static string mainserver = "http://launcher.worldunited.gg";
public static string mainserver = "http://37.233.101.12";
public static string mainserver = "http://launcher.worldunited.gg";

public static string[] serverlisturl = new string[] {
mainserver + "/serverlist.json",
Expand Down
8 changes: 2 additions & 6 deletions GameLauncher/App/MainScreen.cs
Expand Up @@ -158,12 +158,8 @@ private void moveWindow_MouseMove(object sender, MouseEventArgs e)

discordRpcClient = new DiscordRpcClient(Self.DiscordRPCID);

//handlers.readyCallback = Discord_Ready; //Discord, please, fix that... (already reported on DiscordRPC Issues Page)

//discordRpcClient.OnReady += (sender, e) =>
//{

//};
discordRpcClient.OnReady += (sender, e) => {
};

discordRpcClient.OnError += (sender, e) =>
{
Expand Down
6 changes: 3 additions & 3 deletions GameLauncher/Properties/AssemblyInfo.cs
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("MTNTR")]
[assembly: AssemblyProduct("GameLauncher")]
[assembly: AssemblyCopyright("OpenSource")]
[assembly: AssemblyCopyright("WorldUnited")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// Możesz określić wszystkie wartości lub użyć domyślnych numerów kompilacji i poprawki
// przy użyciu symbolu „*”, tak jak pokazano poniżej:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.2.2")]
[assembly: AssemblyFileVersion("2.0.2.2")]
[assembly: AssemblyVersion("2.0.2.3")]
[assembly: AssemblyFileVersion("2.0.2.3")]

0 comments on commit 545ee95

Please sign in to comment.