using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using GamecraftModdingAPI.Events; using Svelto.ECS; using RobocraftX.Common; using Discord; namespace GamecraftRPC.Events { class GamePresenceHandler : SimpleEventHandlerEngine { public static readonly string HandlerName = "GamecraftRPCGamePresenceEventHandler"; //private Discord.Discord discordRPC = null; public static void OnAdd(Discord.Discord discordRPC) { PresenceUtility.LastGameStart = (int)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; Plugin.SetDiscordActivity(discordRPC, state: "In-Game", details: $"Editing {GameMode.SaveGameDetails.Name}", start: PresenceUtility.LastGameStart, partyId: PresenceUtility.PartyId.ToString(), partyCurrentSize: 1, partyMaxSize: 1, debug: "GamePresence-OnAdd"); } public GamePresenceHandler(Discord.Discord _discordRPC) : base((db) => { OnAdd(_discordRPC); }, (db) => { }, EventType.GameSwitchedTo, HandlerName) { //this.discordRPC = _discordRPC; } } }