Beispiel #1
0
        internal void UnpublishMod(UIMouseEvent evt, UIElement listeningElement)
        {
            // TODO: Confimation window or change text to "Ctrl Click to Confirm"
            if (ModLoader.modBrowserPassphrase == string.Empty)
            {
                Main.menuMode = Interface.enterPassphraseMenuID;
                Interface.enterPassphraseMenu.SetGotoMenu(Interface.managePublishedID, Interface.modSourcesID);
                return;
            }
            SoundEngine.PlaySound(12);
            try {
                ServicePointManager.Expect100Continue = false;

                var values = new NameValueCollection
                {
                    { "name", Name },
                    { "steamid64", ModLoader.SteamID64 },
                    { "modloaderversion", BuildInfo.versionedName },
                    { "passphrase", ModLoader.modBrowserPassphrase },
                };
                byte[] result = UploadFile.UploadFiles(UNPUBLISH_URL, null, values);
                string s      = System.Text.Encoding.UTF8.GetString(result, 0, result.Length);
                UIModBrowser.LogModUnpublishInfo(s);
            }
            catch (Exception e) {
                UIModBrowser.LogModBrowserException(e);
            }
        }
Beispiel #2
0
 internal void Unpublish(UIMouseEvent evt, UIElement listeningElement)
 {
     if (ModLoader.modBrowserPassphrase == "")
     {
         Main.menuMode = Interface.enterPassphraseMenuID;
         Interface.enterPassphraseMenu.SetGotoMenu(Interface.managePublishedID);
         return;
     }
     Main.PlaySound(12);
     try {
         ServicePointManager.Expect100Continue = false;
         string url    = "http://javid.ddns.net/tModLoader/unpublishmymod.php";
         var    values = new NameValueCollection
         {
             { "name", this.name },
             { "steamid64", ModLoader.SteamID64 },
             { "modloaderversion", ModLoader.versionedName },
             { "passphrase", ModLoader.modBrowserPassphrase },
         };
         byte[] result = UploadFile.UploadFiles(url, null, values);
         string s      = System.Text.Encoding.UTF8.GetString(result, 0, result.Length);
         UIModBrowser.LogModUnpublishInfo(s);
     }
     catch (Exception e) {
         UIModBrowser.LogModBrowserException(e);
     }
 }