Skip to content

Commit dd8b335

Browse files
committed
Update
1 parent 6afdb4a commit dd8b335

18 files changed

+870
-89
lines changed

Stella.Launcher/1. Stella Mod Launcher.csproj

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -446,12 +446,15 @@
446446
<PackageReference Include="DeviceId.Windows" Version="6.6.0" />
447447
<PackageReference Include="DeviceId.Windows.Wmi" Version="6.6.0" />
448448
<PackageReference Include="DiscordRichPresence" Version="1.2.1.24" />
449+
<PackageReference Include="LibVLCSharp" Version="3.8.2" />
450+
<PackageReference Include="LibVLCSharp.WinForms" Version="3.8.2" />
449451
<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2365.46" />
450452
<PackageReference Include="NAudio" Version="2.2.1" />
451453
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
452454
<PackageReference Include="NLog" Version="5.2.8" />
453455
<PackageReference Include="System.Management" Version="8.0.0" />
454456
<PackageReference Include="System.Runtime.Caching" Version="8.0.0" />
457+
<PackageReference Include="VideoLAN.LibVLC.Windows" Version="3.0.20" />
455458
</ItemGroup>
456459

457460
<ItemGroup>
@@ -470,7 +473,7 @@
470473
<Compile Update="Forms\Other\Language.cs" />
471474
<Compile Update="Forms\Other\RandomImages.cs" />
472475
<Compile Update="Forms\Other\SupportMe.cs" />
473-
<Compile Update="Forms\Other\WebView2Shake.cs" />
476+
<Compile Update="Forms\Other\VideoShake.cs" />
474477
<Compile Update="Forms\Other\WebView2Window.cs" />
475478
<Compile Update="Forms\Settings.cs" />
476479
<Compile Update="Forms\Tools.cs" />
@@ -537,6 +540,9 @@
537540
<None Update="data\sounds\other\interface-welcome.wav">
538541
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
539542
</None>
543+
<None Update="data\sounds\other\kurwa.wav">
544+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
545+
</None>
540546
<None Update="data\sounds\other\logo-corporate.wav">
541547
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
542548
</None>
@@ -561,6 +567,12 @@
561567
<None Update="data\unlocker\unlocker.config.default.json">
562568
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
563569
</None>
570+
<None Update="data\videos\banned.mov">
571+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
572+
</None>
573+
<None Update="data\videos\legends-never-die.mp4">
574+
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
575+
</None>
564576
<None Update="dependencies\Microsoft.VCLibs.x64.14.00.Desktop.appx">
565577
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
566578
</None>

Stella.Launcher/Forms/Default.cs

Lines changed: 70 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
using System.Diagnostics;
2+
using System.Globalization;
3+
using LibVLCSharp.Shared;
24
using Microsoft.Web.WebView2.WinForms;
35
using Microsoft.Win32;
46
using Newtonsoft.Json;
7+
using StellaModLauncher.Forms.Errors;
58
using StellaModLauncher.Forms.Other;
69
using StellaModLauncher.Models;
710
using StellaModLauncher.Properties;
@@ -169,12 +172,14 @@ private async void Main_Shown(object sender, EventArgs e)
169172
});
170173

171174

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...");
174177
Secret.GetDeviceId();
178+
Program.SefinWebClient.DefaultRequestHeaders.Add("X-Device-ID", Secret._deviceId);
175179

176-
string? registrySecret = Secret.GetTokenFromRegistry();
177180

181+
// Is the user a Stella Mod Plus subscriber?
182+
string? registrySecret = Secret.GetTokenFromRegistry();
178183
Stages.UpdateStage(4, "Verifying Stella Mod Plus subscription...");
179184
if (registrySecret != null)
180185
{
@@ -267,9 +272,46 @@ private async void Main_Shown(object sender, EventArgs e)
267272

268273

269274
// Check if all required files exists
270-
Stages.UpdateStage(5, "Verifying required files...");
275+
Stages.UpdateStage(5, "Verifying required data and files...");
271276
await Files.ScanAsync().ConfigureAwait(true);
272277

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+
273315

274316
// Delete setup file from Temp directory
275317
Stages.UpdateStage(6, "Checking the installation file after the update...");
@@ -287,12 +329,23 @@ private async void Main_Shown(object sender, EventArgs e)
287329

288330
Program.Logger.Debug(FileVersionInfo.GetVersionInfo(Run.GsmPath).ProductVersion);
289331

332+
290333
// Discord RPC
291334
Stages.UpdateStage(9, "Initializing Discord RPC...");
292335
Discord.InitRpc();
293336

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+
}
296349

297350
// Updated?
298351
int updatedLauncher = Program.Settings.ReadInt("Updates", "UpdateAvailable", 0);
@@ -310,38 +363,6 @@ private async void Main_Shown(object sender, EventArgs e)
310363
}
311364

312365

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-
345366
Stages.UpdateStage(11, "Checking Genshin Stella Mod.exe and ReShade.ini...");
346367

347368
// Check Genshin Stella Mod.exe
@@ -574,17 +595,21 @@ private void W_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
574595

575596
if (MachineInfo.GetSystemRegion() == "PL")
576597
{
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+
}
580607

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");
582609
}
583610
else
584611
{
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();
588613
}
589614
}
590615

Stella.Launcher/Forms/Default.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@
673673
<value>Yu Gothic UI, 15.75pt, style=Bold</value>
674674
</data>
675675
<data name="becomeMyPatron_LinkLabel.Location" type="System.Drawing.Point, System.Drawing">
676-
<value>62, 436</value>
676+
<value>63, 436</value>
677677
</data>
678678
<data name="becomeMyPatron_LinkLabel.Size" type="System.Drawing.Size, System.Drawing">
679679
<value>576, 60</value>

Stella.Launcher/Forms/Errors/Banned.Designer.cs

Lines changed: 73 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using LibVLCSharp.Shared;
2+
3+
namespace StellaModLauncher.Forms.Errors;
4+
5+
public partial class Banned : Form
6+
{
7+
private readonly LibVLC _libVlc;
8+
private readonly MediaPlayer _mp;
9+
10+
public Banned()
11+
{
12+
InitializeComponent();
13+
14+
_libVlc = new LibVLC();
15+
_mp = new MediaPlayer(_libVlc);
16+
videoView1.MediaPlayer = _mp;
17+
18+
Program.Logger.Error("You are banned ):");
19+
}
20+
21+
private void Banned_Load(object sender, EventArgs e)
22+
{
23+
string path = Path.Combine(Program.AppPath, "data", "videos", "banned.mov");
24+
if (File.Exists(path))
25+
_mp.Play(new Media(_libVlc, path));
26+
else
27+
Program.Logger.Warn($"File {path} was not found");
28+
}
29+
30+
private void Banned_FormClosing(object sender, FormClosingEventArgs e)
31+
{
32+
Application.Exit();
33+
}
34+
}

0 commit comments

Comments
 (0)