Ejemplo n.º 1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Hello from C#!", Console.LogLevel.Info);
            Console.WriteLine(string.Format("args = [{0}]", string.Join(",", args)), Console.LogLevel.Info);

            Console.AddCommand("test", TestCommand);
            Console.Execute("print t");

            Events.Add <Input.KeyEvent>(KeyCallback);
            Events.Add <TestEvent>(TestEventCallback);

            DiscordEventHandler discordEventHandler = new DiscordEventHandler();

            DiscordRPC.Init("424302031822520320", ref discordEventHandler, true, "480");

            DiscordPresence presence = new DiscordPresence();

            presence.details       = "Jazz weeb";
            presence.state         = ":3c:";
            presence.largeImageKey = "icon-large";
            presence.smallImageKey = "icon-small";

            DiscordRPC.UpdatePresence(ref presence);

            SteamworksClient = new Client(480);
        }
Ejemplo n.º 2
0
        public static void GameStateMessage(string csgoDataJson)
        {
            Console.WriteLine(csgoDataJson);

            var    csgoData = new JavaScriptSerializer().Deserialize <dynamic>(csgoDataJson);
            string steamId  = csgoData["provider"]["steamid"];

            if (!rpcInitialized)
            {
                rpcInitialized = true;
                var eventHandler = new DiscordEventHandler();
                DiscordRPC.Init(discordAppId, ref eventHandler, true, steamId);
                startAt = (int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;

                DiscordAssets.Init(discordAppId);
            }

            DiscordPresence presence = FormatPresence(csgoData);

            DiscordRPC.UpdatePresence(ref presence);
        }