1
1
using System . Diagnostics ;
2
+ using System . Globalization ;
3
+ using LibVLCSharp . Shared ;
2
4
using Microsoft . Web . WebView2 . WinForms ;
3
5
using Microsoft . Win32 ;
4
6
using Newtonsoft . Json ;
7
+ using StellaModLauncher . Forms . Errors ;
5
8
using StellaModLauncher . Forms . Other ;
6
9
using StellaModLauncher . Models ;
7
10
using StellaModLauncher . Properties ;
@@ -169,12 +172,14 @@ private async void Main_Shown(object sender, EventArgs e)
169
172
} ) ;
170
173
171
174
172
- // Is the user a Stella Mod Plus subscriber?
173
- Stages . UpdateStage ( 3 , "Checking Stella Mod Plus subscription ..." ) ;
175
+ // Get device ID
176
+ Stages . UpdateStage ( 3 , "Generating device ID ..." ) ;
174
177
Secret . GetDeviceId ( ) ;
178
+ Program . SefinWebClient . DefaultRequestHeaders . Add ( "X-Device-ID" , Secret . _deviceId ) ;
175
179
176
- string ? registrySecret = Secret . GetTokenFromRegistry ( ) ;
177
180
181
+ // Is the user a Stella Mod Plus subscriber?
182
+ string ? registrySecret = Secret . GetTokenFromRegistry ( ) ;
178
183
Stages . UpdateStage ( 4 , "Verifying Stella Mod Plus subscription..." ) ;
179
184
if ( registrySecret != null )
180
185
{
@@ -267,9 +272,46 @@ private async void Main_Shown(object sender, EventArgs e)
267
272
268
273
269
274
// Check if all required files exists
270
- Stages . UpdateStage ( 5 , "Verifying required files..." ) ;
275
+ Stages . UpdateStage ( 5 , "Verifying required data and files..." ) ;
271
276
await Files . ScanAsync ( ) . ConfigureAwait ( true ) ;
272
277
278
+ // Block the software in Russia
279
+ if ( MachineInfo . GetSystemRegion ( ) == "RU" )
280
+ {
281
+ Music . PlaySound ( "winxp" , "battery-critical" ) ;
282
+ new RussianCunt { Icon = Program . Ico } . ShowDialog ( ) ;
283
+ // Environment.Exit(999222999);
284
+ }
285
+
286
+ // Telemetry
287
+ // Telemetry.Opened();
288
+
289
+ // Check InjectType
290
+ string injectMode = Program . Settings . ReadString ( "Injection" , "Method" , "exe" ) ;
291
+ switch ( injectMode )
292
+ {
293
+ case "exe" :
294
+ Run . InjectType = "exe" ;
295
+ break ;
296
+ case "cmd" when Secret . IsStellaPlusSubscriber :
297
+ Run . InjectType = "cmd" ;
298
+ break ;
299
+ default :
300
+ {
301
+ Run . InjectType = "exe" ;
302
+ Program . Settings . WriteString ( "Injection" , "Method" , "exe" ) ;
303
+ Program . Settings . Save ( ) ;
304
+
305
+ if ( ! Secret . IsStellaPlusSubscriber )
306
+ {
307
+ Utils . UpdateStatusLabel ( "Batch file usage in Genshin Stella Mod is exclusive to Stella Mod Plus subscribers." , Utils . StatusType . Error ) ;
308
+ Program . Logger . Error ( "To utilize batch files, a subscription to Stella Mod Plus is required." ) ;
309
+ }
310
+
311
+ break ;
312
+ }
313
+ }
314
+
273
315
274
316
// Delete setup file from Temp directory
275
317
Stages . UpdateStage ( 6 , "Checking the installation file after the update..." ) ;
@@ -287,12 +329,23 @@ private async void Main_Shown(object sender, EventArgs e)
287
329
288
330
Program . Logger . Debug ( FileVersionInfo . GetVersionInfo ( Run . GsmPath ) . ProductVersion ) ;
289
331
332
+
290
333
// Discord RPC
291
334
Stages . UpdateStage ( 9 , "Initializing Discord RPC..." ) ;
292
335
Discord . InitRpc ( ) ;
293
336
294
- // Telemetry
295
- // Telemetry.Opened();
337
+
338
+ // Check for updates
339
+ Stages . UpdateStage ( 10 , "Checking for updates..." ) ;
340
+ int found = await CheckForUpdates . Analyze ( ) . ConfigureAwait ( true ) ;
341
+ switch ( found )
342
+ {
343
+ case 2 :
344
+ return ;
345
+ case 666 :
346
+ WindowState = FormWindowState . Minimized ;
347
+ return ;
348
+ }
296
349
297
350
// Updated?
298
351
int updatedLauncher = Program . Settings . ReadInt ( "Updates" , "UpdateAvailable" , 0 ) ;
@@ -310,38 +363,6 @@ private async void Main_Shown(object sender, EventArgs e)
310
363
}
311
364
312
365
313
- // Check InjectType
314
- string injectMode = Program . Settings . ReadString ( "Injection" , "Method" , "exe" ) ;
315
- switch ( injectMode )
316
- {
317
- case "exe" :
318
- Run . InjectType = "exe" ;
319
- break ;
320
- case "cmd" when Secret . IsStellaPlusSubscriber :
321
- Run . InjectType = "cmd" ;
322
- break ;
323
- default :
324
- {
325
- Run . InjectType = "exe" ;
326
- Program . Settings . WriteString ( "Injection" , "Method" , "exe" ) ;
327
- Program . Settings . Save ( ) ;
328
-
329
- if ( ! Secret . IsStellaPlusSubscriber )
330
- {
331
- Utils . UpdateStatusLabel ( "Batch file usage in Genshin Stella Mod is exclusive to Stella Mod Plus subscribers." , Utils . StatusType . Error ) ;
332
- Program . Logger . Error ( "To utilize batch files, a subscription to Stella Mod Plus is required." ) ;
333
- }
334
-
335
- break ;
336
- }
337
- }
338
-
339
-
340
- // Check for updates
341
- Stages . UpdateStage ( 10 , "Checking for updates..." ) ;
342
- int found = await CheckForUpdates . Analyze ( ) . ConfigureAwait ( true ) ;
343
- if ( found == 2 ) return ;
344
-
345
366
Stages . UpdateStage ( 11 , "Checking Genshin Stella Mod.exe and ReShade.ini..." ) ;
346
367
347
368
// Check Genshin Stella Mod.exe
@@ -574,17 +595,21 @@ private void W_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
574
595
575
596
if ( MachineInfo . GetSystemRegion ( ) == "PL" )
576
597
{
577
- WebView2Shake viewer = new ( ) { DesktopLocation = DesktopLocation , Icon = Program . Ico } ;
578
- viewer . Navigate ( "https://www.youtube.com/embed/2F2DdXUNyaQ?autoplay=1" ) ;
579
- viewer . Show ( ) ;
598
+ string path = Path . Combine ( Program . AppPath , "data" , "videos" , "legends-never-die.mp4" ) ;
599
+ bool isExists = Utils . CheckFileExists ( path ) ;
600
+
601
+ if ( isExists )
602
+ {
603
+ VideoShake viewer = new ( ) { DesktopLocation = DesktopLocation , Icon = Program . Ico } ;
604
+ viewer . Navigate ( path , FromType . FromPath ) ;
605
+ viewer . Show ( ) ;
606
+ }
580
607
581
- MessageBox . Show ( @"Pamiętaj by nie grać w lola, gdyż to grzech ciężki. " , @"kurwa" ) ;
608
+ MessageBox . Show ( @"Pamiętaj by nie grać w lola, gdyż to grzech ciężki" , @"kurwa" ) ;
582
609
}
583
610
else
584
611
{
585
- WebView2Shake viewer = new ( ) { DesktopLocation = DesktopLocation , Icon = Program . Ico } ;
586
- viewer . Navigate ( "https://www.youtube.com/embed/L3ky4gZU5gY?autoplay=1" ) ;
587
- viewer . Show ( ) ;
612
+ new WebView2Window { WindowState = FormWindowState . Maximized , Url = $ "https://www.youtube.com/embed/rQg2qngyIZM?autoplay=1" } . Show ( ) ;
588
613
}
589
614
}
590
615
0 commit comments