Skip to content

Commit

Permalink
Merge pull request #11 from ElaXan/rpc
Browse files Browse the repository at this point in the history
Add support enable/disable Rich Presence (Discord)
  • Loading branch information
akbaryahya authored Dec 22, 2023
2 parents d847055 + de42030 commit a977d6f
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 5 deletions.
1 change: 1 addition & 0 deletions Json/Profile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public class Game
public class Extra
{
public bool Akebi = false;
public bool RPC = false;
}

//public int patch_metode = 1; // 1=NO PATCH, 2=RSA ()this should not be necessary because it is controlled by game server
Expand Down
16 changes: 15 additions & 1 deletion Main.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 25 additions & 2 deletions Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Diagnostics;
using System.Net.NetworkInformation;
using System.Reflection;
using YuukiPS_Launcher.Extra;
using YuukiPS_Launcher.Json;
using YuukiPS_Launcher.Json.GameClient;
using YuukiPS_Launcher.Yuuki;
Expand Down Expand Up @@ -68,7 +69,14 @@ private void Main_Load(object sender, EventArgs e)
LoadProfile(configdata.profile_default);

// Extra
discord.Ready();
if (Enable_RPC.Checked)
{
Console.WriteLine("Discord RPC enable");
discord.Ready();
} else
{
Console.WriteLine("Discord RPC disable");
}

notbootyet = false;
}
Expand Down Expand Up @@ -169,6 +177,7 @@ public void LoadProfile(string load_profile = "")
GetServerHost.Text = default_profile.server.url;
// Extra
Extra_Cheat.Checked = default_profile.game.extra.Akebi;
Enable_RPC.Checked = default_profile.game.extra.RPC;

// Get Data Game
if (!CheckVersionGame(default_profile.game.type))
Expand Down Expand Up @@ -198,6 +207,7 @@ public void SaveProfile(string name_save = "Default")

// Extra
tmp_profile.game.extra.Akebi = Extra_Cheat.Checked;
tmp_profile.game.extra.RPC = Enable_RPC.Checked;

// Nama Profile
tmp_profile.name = name_save;
Expand Down Expand Up @@ -312,7 +322,7 @@ public void DoStart()
}
else
{
if(get_version != null && get_version.nosupport != "")
if (get_version != null && get_version.nosupport != "")
{
MessageBox.Show(get_version.nosupport, "Game version not supported");
Process.Start(new ProcessStartInfo(API.WEB_LINK) { UseShellExecute = true });
Expand Down Expand Up @@ -1767,5 +1777,18 @@ private void Extra_Cheat_CheckedChanged(object sender, EventArgs e)
{

}

private void Extra_Enable_RPC_CheckedChanged(object sender, EventArgs e)
{
if (Enable_RPC.Checked)
{
Console.WriteLine("Enable RPC");
discord.Ready();
} else
{
Console.WriteLine("Disable RPC. This may take a few seconds");
discord.Stop();
}
}
}
}
4 changes: 2 additions & 2 deletions YuukiPS Launcher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

<ApplicationManifest>Properties\app.manifest</ApplicationManifest>

<AssemblyVersion>2023.11.10.0714</AssemblyVersion>
<FileVersion>2023.11.10.0714</FileVersion>
<AssemblyVersion>2023.12.21.1933</AssemblyVersion>
<FileVersion>2023.11.10.1933</FileVersion>

<EnableWindowsTargeting>true</EnableWindowsTargeting>
<AssemblyName>YuukiPS</AssemblyName>
Expand Down

0 comments on commit a977d6f

Please sign in to comment.