@@ -196,62 +196,6 @@ private void ReinstallInstalled_Unchecked(object sender, RoutedEventArgs e)
196
196
Properties . Settings . Default . Save ( ) ;
197
197
}
198
198
199
- private async void OpenLogsDirButton_Click ( object sender , RoutedEventArgs e )
200
- {
201
- try
202
- {
203
- MainWindow . Instance . MainText = $ "{ Application . Current . FindResource ( "Options:UploadingLog" ) } ...";
204
- await Task . Run ( async ( ) => await UploadLog ( ) ) ;
205
-
206
- Process . Start ( LogURL ) ;
207
- Utils . SetClipboard ( LogURL ) ;
208
- MainWindow . Instance . MainText = ( string ) Application . Current . FindResource ( "Options:LogUrlCopied" ) ;
209
- }
210
- catch ( Exception exception )
211
- {
212
- MainWindow . Instance . MainText = $ "{ Application . Current . FindResource ( "Options:LogUploadFailed" ) } .";
213
-
214
- string title = ( string ) Application . Current . FindResource ( "Options:LogUploadFailed:Title" ) ;
215
- string body = ( string ) Application . Current . FindResource ( "Options:LogUploadFailed:Body" ) ;
216
- MessageBox . Show ( $ "{ body } \n ================= \n " + exception , title ) ;
217
- Utils . OpenFolder ( Path . Combine ( InstallDirectory , "Logs" ) ) ;
218
- }
219
- }
220
-
221
- private async Task UploadLog ( )
222
- {
223
- const string DateFormat = "yyyy-mm-dd HH:mm:ss" ;
224
- DateTime now = DateTime . Now ;
225
- string logPath = Path . GetDirectoryName ( ConfigurationManager . OpenExeConfiguration ( ConfigurationUserLevel . PerUserRoamingAndLocal ) . FilePath ) ;
226
- string Log = Path . Combine ( logPath , "log.log" ) ;
227
- string GameLog = File . ReadAllText ( Path . Combine ( InstallDirectory , "Logs" , "_latest.log" ) ) ;
228
- string Separator = File . Exists ( Log ) ? $ "\n \n =============================================\n ============= Mod Assistant Log =============\n =============================================\n \n " : string . Empty ;
229
- string ModAssistantLog = File . Exists ( Log ) ? File . ReadAllText ( Log ) : string . Empty ;
230
-
231
- var nvc = new List < KeyValuePair < string , string > > ( )
232
- {
233
- new KeyValuePair < string , string > ( "title" , $ "_latest.log ({ now . ToString ( DateFormat ) } )") ,
234
- new KeyValuePair < string , string > ( "expireUnit" , "hour" ) ,
235
- new KeyValuePair < string , string > ( "expireLength" , "5" ) ,
236
- new KeyValuePair < string , string > ( "code" , $ "{ GameLog } { Separator } { ModAssistantLog } ") ,
237
- } ;
238
-
239
- string [ ] items = new string [ nvc . Count ] ;
240
-
241
- for ( int i = 0 ; i < nvc . Count ; i ++ )
242
- {
243
- KeyValuePair < string , string > item = nvc [ i ] ;
244
- items [ i ] = WebUtility . UrlEncode ( item . Key ) + "=" + WebUtility . UrlEncode ( item . Value ) ;
245
- }
246
-
247
- StringContent content = new StringContent ( string . Join ( "&" , items ) , null , "application/x-www-form-urlencoded" ) ;
248
- HttpResponseMessage resp = await Http . HttpClient . PostAsync ( Utils . Constants . TeknikAPIUrl + "Paste" , content ) ;
249
- string body = await resp . Content . ReadAsStringAsync ( ) ;
250
-
251
- Utils . TeknikPasteResponse TeknikResponse = Http . JsonSerializer . Deserialize < Utils . TeknikPasteResponse > ( body ) ;
252
- LogURL = TeknikResponse . result . url ;
253
- }
254
-
255
199
private void OpenAppDataButton_Click ( object sender , RoutedEventArgs e )
256
200
{
257
201
string location = Path . Combine (
0 commit comments