Esempio n. 1
0
 // Updates player song Track and count
 private void UpdatePresenceTrackNumber(bool displayTrackNumber)
 {
     if (displayTrackNumber)
     {
         int trackNo    = 0;
         int trackCount = 0;
         try
         {
             trackNo    = int.Parse(metaDataDelegates["TrackNo"]());
             trackCount = int.Parse(metaDataDelegates["TrackCount"]());
         }
         catch (Exception) { } // Swallow exception
         if (trackNo > 0 && trackCount >= trackNo)
         {
             presence.Party = new Party()
             {
                 ID   = Secrets.CreateSecret(new Random()),
                 Size = trackNo,
                 Max  = trackCount
             };
         }
         else
         {
             presence.Party = null;
         }
     }
     else
     {
         presence.Party = null;
     }
 }
Esempio n. 2
0
        static void Main(string[] args)
        {
            custom();
            var handle = GetConsoleWindow();

            // Show
            ShowWindow(handle, SW_SHOW);
            Console.WriteLine(@"Starting custom Presence.");

            for (int i = 0; i < args.Length; i++)
            {
                switch (args[i])
                {
                case "-pipe":
                    _discordPipe = int.Parse(args[++i]);
                    break;
                }
            }

            presence.Party = new Party()
            {
                ID   = Secrets.CreateSecret(new Random()),
                Max  = 1337,
                Size = 847
            };
            mainPresence();
        }