Compare commits
2 commits
Author | SHA1 | Date | |
---|---|---|---|
364cc5cbfb | |||
83229c70d9 |
2 changed files with 19 additions and 14 deletions
|
@ -3,7 +3,7 @@
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net472</TargetFramework>
|
<TargetFramework>net472</TargetFramework>
|
||||||
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
<Version>1.1.0</Version>
|
<Version>1.2.0</Version>
|
||||||
<Authors>Me</Authors>
|
<Authors>Me</Authors>
|
||||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||||
<PackageProjectUrl>https://git.exmods.org/???/???</PackageProjectUrl>
|
<PackageProjectUrl>https://git.exmods.org/???/???</PackageProjectUrl>
|
||||||
|
|
|
@ -11,11 +11,11 @@ using Discord;
|
||||||
|
|
||||||
namespace GamecraftRPC
|
namespace GamecraftRPC
|
||||||
{
|
{
|
||||||
public class Plugin : IPlugin // the Illusion Plugin Architecture (IPA) will ignore classes that don't implement IPlugin'
|
public class Plugin : IEnhancedPlugin // the Illusion Plugin Architecture (IPA) will ignore classes that don't implement IPlugin'
|
||||||
{
|
{
|
||||||
public string Name { get; } = Assembly.GetExecutingAssembly().GetName().Name;
|
public override string Name { get; } = Assembly.GetExecutingAssembly().GetName().Name;
|
||||||
|
|
||||||
public string Version { get; } =
|
public override string Version { get; } =
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
Assembly.GetExecutingAssembly().GetName().Version.ToString() + "alpha";
|
Assembly.GetExecutingAssembly().GetName().Version.ToString() + "alpha";
|
||||||
#else
|
#else
|
||||||
|
@ -39,7 +39,7 @@ namespace GamecraftRPC
|
||||||
internal static Discord.Discord DiscordRPC;
|
internal static Discord.Discord DiscordRPC;
|
||||||
|
|
||||||
// called when Gamecraft shuts down
|
// called when Gamecraft shuts down
|
||||||
public void OnApplicationQuit()
|
public override void OnApplicationQuit()
|
||||||
{
|
{
|
||||||
// Shutdown this mod
|
// Shutdown this mod
|
||||||
if (DiscordRPC != null)
|
if (DiscordRPC != null)
|
||||||
|
@ -53,7 +53,7 @@ namespace GamecraftRPC
|
||||||
}
|
}
|
||||||
|
|
||||||
// called when Gamecraft starts up
|
// called when Gamecraft starts up
|
||||||
public void OnApplicationStart()
|
public override void OnApplicationStart()
|
||||||
{
|
{
|
||||||
// Initialize the Gamecraft modding API first
|
// Initialize the Gamecraft modding API first
|
||||||
GamecraftModdingAPI.Main.Init();
|
GamecraftModdingAPI.Main.Init();
|
||||||
|
@ -238,15 +238,20 @@ namespace GamecraftRPC
|
||||||
GamecraftModdingAPI.Utility.Logging.MetaLog($"{Name} has started up");
|
GamecraftModdingAPI.Utility.Logging.MetaLog($"{Name} has started up");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnFixedUpdate() { } // called once per physics update
|
public override void OnUpdate() // called once per rendered frame (frame update)
|
||||||
|
|
||||||
public void OnLevelWasInitialized(int level) { } // called after a level is initialized
|
|
||||||
|
|
||||||
public void OnLevelWasLoaded(int level) { } // called after a level is loaded
|
|
||||||
|
|
||||||
public void OnUpdate() // called once per rendered frame (frame update)
|
|
||||||
{
|
{
|
||||||
if (DiscordRPC != null ) DiscordRPC.RunCallbacks();
|
if (DiscordRPC != null)
|
||||||
|
{
|
||||||
|
try
|
||||||
|
{
|
||||||
|
DiscordRPC.RunCallbacks();
|
||||||
|
}
|
||||||
|
catch (ResultException e)
|
||||||
|
{
|
||||||
|
GamecraftModdingAPI.Utility.Logging.LogWarning($"Discord integration has been disabled due to the exception " + e);
|
||||||
|
DiscordRPC = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SetDiscordActivity(string state = null, string details = null, long start = 0, long end = 0, string largeImg = "gamecraft-logo-g", string largeTxt = "Gamecraft", string smallImg = "exmods-logo-xm2", string smallTxt = null, string partyId = null, int partyCurrentSize = 0, int partyMaxSize = 0, string matchSecret = null, string joinSecret = null, string spectateSecret = null, bool instance = true, string debug = "")
|
public static void SetDiscordActivity(string state = null, string details = null, long start = 0, long end = 0, string largeImg = "gamecraft-logo-g", string largeTxt = "Gamecraft", string smallImg = "exmods-logo-xm2", string smallTxt = null, string partyId = null, int partyCurrentSize = 0, int partyMaxSize = 0, string matchSecret = null, string joinSecret = null, string spectateSecret = null, bool instance = true, string debug = "")
|
||||||
|
|
Loading…
Add table
Reference in a new issue