Browse Source

Rename to GameSDKcraft with tweaks

tags/v1.0.1
NGnius (Graham) 4 years ago
parent
commit
203b607074
13 changed files with 19 additions and 6 deletions
  1. +1
    -1
      GameSDKcraft.sln
  2. +0
    -0
      GameSDKcraft/CallbackUtility.cs
  3. +0
    -0
      GameSDKcraft/Discord/ActivityManager.cs
  4. +0
    -0
      GameSDKcraft/Discord/Constants.cs
  5. +0
    -0
      GameSDKcraft/Discord/Core.cs
  6. +0
    -0
      GameSDKcraft/Discord/ImageManager.cs
  7. +0
    -0
      GameSDKcraft/Discord/LobbyManager.cs
  8. +0
    -0
      GameSDKcraft/Discord/StorageManager.cs
  9. +0
    -0
      GameSDKcraft/Discord/StoreManager.cs
  10. +0
    -0
      GameSDKcraft/Engines/PlayerCountEngine.cs
  11. +1
    -1
      GameSDKcraft/GameSDKcraft.csproj
  12. +17
    -4
      GameSDKcraft/Plugin.cs
  13. +0
    -0
      GameSDKcraft/PresenceUtility.cs

GamecraftRPC.sln → GameSDKcraft.sln View File

@@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29609.76
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GamecraftRPC", "GamecraftRPC\GamecraftRPC.csproj", "{E0EEA15D-AB3C-4C73-A000-C49B5AE9EA66}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GameSDKcraft", "GameSDKcraft\GameSDKcraft.csproj", "{E0EEA15D-AB3C-4C73-A000-C49B5AE9EA66}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

GamecraftRPC/CallbackUtility.cs → GameSDKcraft/CallbackUtility.cs View File


GamecraftRPC/Discord/ActivityManager.cs → GameSDKcraft/Discord/ActivityManager.cs View File


GamecraftRPC/Discord/Constants.cs → GameSDKcraft/Discord/Constants.cs View File


GamecraftRPC/Discord/Core.cs → GameSDKcraft/Discord/Core.cs View File


GamecraftRPC/Discord/ImageManager.cs → GameSDKcraft/Discord/ImageManager.cs View File


GamecraftRPC/Discord/LobbyManager.cs → GameSDKcraft/Discord/LobbyManager.cs View File


GamecraftRPC/Discord/StorageManager.cs → GameSDKcraft/Discord/StorageManager.cs View File


GamecraftRPC/Discord/StoreManager.cs → GameSDKcraft/Discord/StoreManager.cs View File


GamecraftRPC/Engines/PlayerCountEngine.cs → GameSDKcraft/Engines/PlayerCountEngine.cs View File


GamecraftRPC/GamecraftRPC.csproj → GameSDKcraft/GameSDKcraft.csproj View File

@@ -3,7 +3,7 @@
<PropertyGroup>
<TargetFramework>net472</TargetFramework>
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
<Version>1.0.0</Version>
<Version>1.0.1</Version>
<Authors>Me</Authors>
<PackageLicenseExpression>MIT</PackageLicenseExpression>
<PackageProjectUrl>https://git.exmods.org/???/???</PackageProjectUrl>

GamecraftRPC/Plugin.cs → GameSDKcraft/Plugin.cs View File

@@ -69,7 +69,7 @@ namespace GamecraftRPC
if (isWineDetected)
{
// info for getting this to work through Wine/Proton
GamecraftModdingAPI.Utility.Logging.MetaLog("\n--------------------------------\n\nIt looks like you may be using Wine/Proton, cool!\nPlease install https://github.com/0e4ef622/wine-discord-ipc-bridge to get this to work.\n\n--------------------------------");
GamecraftModdingAPI.Utility.Logging.MetaLog("\n--------------------------------\n\nIt looks like you may be using Wine/Proton, cool!\nPlease install https://github.com/0e4ef622/wine-discord-ipc-bridge to get this to work.\nAlso, please note that multiplayer is broken in Wine/Proton.\n\n--------------------------------");
}

// Initialize this mod
@@ -85,7 +85,8 @@ namespace GamecraftRPC
LobbyManager lm = DiscordRPC.GetLobbyManager();
lm.OnMemberConnect += CallbackUtility.DiscordUserJoin;

SetDiscordActivity(state: $"{UnityEngine.Application.version} ({Version})", details: $"Initializing...", start: (int)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds);
// init Discord game activity status
SetDiscordActivity(state: $"{UnityEngine.Application.version}", details: $"Initializing...");

Game.Edit += CallbackUtility.BuildEnter;
Game.Enter += CallbackUtility.GameEnter;
@@ -136,7 +137,7 @@ namespace GamecraftRPC
{
Game game = Game.CurrentGame();
Client client = new Client();
GamecraftModdingAPI.Utility.Logging.CommandLog($"Gamecraft {client.Version}\nUnity {client.UnityVersion}\n{Name} {Version}\nSDK {DiscordRPC.ToString()}\nGame {game.Name}");
GamecraftModdingAPI.Utility.Logging.CommandLog($"Gamecraft {client.Version}\nUnity {client.UnityVersion}\n{PluginInfo()}\nSDK {DiscordRPC.ToString()}\nGame {game.Name}");
}
else
{
@@ -205,7 +206,7 @@ namespace GamecraftRPC
if (DiscordRPC != null ) DiscordRPC.RunCallbacks();
}

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 = "Exmods", 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 = "")
{
if (DiscordRPC == null) return;

@@ -223,6 +224,7 @@ namespace GamecraftRPC
}
if (!string.IsNullOrEmpty(smallImg))
{
if (smallTxt == null) smallTxt = PluginInfo();
activity.Assets.SmallImage = smallImg;
activity.Assets.SmallText = smallTxt;
}
@@ -263,5 +265,16 @@ namespace GamecraftRPC
GamecraftModdingAPI.Utility.Logging.MetaLog($"Update Activity Result: {result} {debug}");
});
}

internal static string PluginInfo()
{
Version version = Assembly.GetExecutingAssembly().GetName().Version;
#if DEBUG
string v = version.Major + "." + version.Minor + "." + version.Build + "alpha";
#else
string v = version.Major + "." + version.Minor + "." + version.Build;
#endif
return Assembly.GetExecutingAssembly().GetName().Name + " " + v;
}
}
}

GamecraftRPC/PresenceUtility.cs → GameSDKcraft/PresenceUtility.cs View File


Loading…
Cancel
Save