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; namespace GamecraftRPC.Events { class GamePresenceHandler : SimpleEventHandlerEngine { public static readonly string HandlerName = "GamecraftRPCGamePresenceEventHandler"; //private Discord.Discord discordRPC = null; public static int GameStart = 0; public static void OnAdd(Discord.Discord discordRPC) { GameStart = (int)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds; Plugin.SetDiscordActivity(discordRPC, state: "In-Game", details: $"Editing {GameMode.SaveGameDetails.Name}", start: GameStart); } public GamePresenceHandler(Discord.Discord _discordRPC) : base((db) => { OnAdd(_discordRPC); }, (db) => { }, EventType.GameSwitchedTo, HandlerName) { //this.discordRPC = _discordRPC; } } }