This repository has moved! Please check out the latest version at the new location https://git.exmods.org/NGnius/GameSDKcraft
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.

EditPresenceHandler.cs 993B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using GamecraftModdingAPI.Events;
  7. using Svelto.ECS;
  8. using RobocraftX.Common;
  9. namespace GamecraftRPC.Events
  10. {
  11. class EditPresenceHandler : SimpleEventHandlerEngine
  12. {
  13. public static readonly string HandlerName = "GamecraftRPCEditPresenceEventHandler";
  14. //private Discord.Discord discordRPC = null;
  15. public static void OnAdd(Discord.Discord discordRPC)
  16. {
  17. Plugin.SetDiscordActivity(discordRPC, state: "In-Game", details: $"Editing {GameMode.SaveGameDetails.Name}", start: PresenceUtility.LastGameStart, matchSecret: PresenceUtility.GameSecret, joinSecret: PresenceUtility.GameSecret);
  18. }
  19. public EditPresenceHandler(Discord.Discord _discordRPC) : base((db) => { OnAdd(_discordRPC); }, (db) => { }, EventType.BuildSwitchedTo, HandlerName)
  20. {
  21. //this.discordRPC = _discordRPC;
  22. }
  23. }
  24. }