Skip to content

Commit

Permalink
Version 0.3.7
Browse files Browse the repository at this point in the history
version 0.3.7
  • Loading branch information
NoobNotFound authored May 31, 2022
2 parents caf7982 + a9c49c8 commit 50b9a75
Show file tree
Hide file tree
Showing 26 changed files with 396 additions and 203 deletions.
9 changes: 0 additions & 9 deletions Client Launcher/Client Launcher.csproj

This file was deleted.

12 changes: 0 additions & 12 deletions Client Launcher/Program.cs

This file was deleted.

2 changes: 1 addition & 1 deletion ClientLauncher/ClientLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

</Project>
4 changes: 4 additions & 0 deletions ClientLauncher/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,10 @@ static void Main(string[] args)
processUtil.OutputReceived += (s, e) => Console.WriteLine(e);
processUtil.StartWithEvents();
proc.WaitForExit();
if (logs == "True")
{
Console.ReadLine();
}
}
static string GetEnviromentVar(string variableName)
{
Expand Down
2 changes: 1 addition & 1 deletion Package/Package.appxmanifest
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<Identity
Name="SeaDevs.Launcher.UWP"
Publisher="CN=SeaDev Team"
Version="0.3.1.0" />
Version="0.3.7.0" />

<Properties>
<DisplayName>SD Launcher</DisplayName>
Expand Down
2 changes: 1 addition & 1 deletion Package/Package.wapproj
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<GenerateAppInstallerFile>True</GenerateAppInstallerFile>
<PackageCertificateThumbprint>DB967EAAD2582A102C63D11D80EB102BA467810C</PackageCertificateThumbprint>
<AppxPackageSigningTimestampDigestAlgorithm>SHA256</AppxPackageSigningTimestampDigestAlgorithm>
<AppxAutoIncrementPackageRevision>True</AppxAutoIncrementPackageRevision>
<AppxAutoIncrementPackageRevision>False</AppxAutoIncrementPackageRevision>
<GenerateTestArtifacts>True</GenerateTestArtifacts>
<AppxBundlePlatforms>x86|x64|arm|arm64</AppxBundlePlatforms>
<AppInstallerUri>C:\</AppInstallerUri>
Expand Down
13 changes: 10 additions & 3 deletions SDLauncher UWP/App.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,19 @@
<winui:XamlControlsResources.MergedDictionaries>
<!-- Other app resources here -->
<ResourceDictionary>
<FontFamily x:Key="Pixel">/Fonts/Pixeboy.ttf#Pixeboy</FontFamily>
<AcrylicBrush x:Key="AcrylicGlass" BackgroundSource="Backdrop"
TintOpacity="0" Windows10version1903:TintLuminosityOpacity="0" TintColor="SkyBlue" FallbackColor="SkyBlue" />
<ResourceDictionary.ThemeDictionaries>
</ResourceDictionary.ThemeDictionaries>
<AcrylicBrush x:Key="AcrylicGlass" BackgroundSource="Backdrop" TintOpacity="0" Windows10version1903:TintLuminosityOpacity="0" TintColor="Black" FallbackColor="Black" />
<TransitionCollection x:Key="BaseSDAnimation">
<EntranceThemeTransition IsStaggeringEnabled="True"/>
</TransitionCollection>
<FontFamily x:Key="Pixel">/Fonts/Pixeboy.ttf#Pixeboy</FontFamily>
<Style x:Key="ChooseButtonSyle" TargetType="Button">
<Setter Property="Background" Value="{ThemeResource ExpanderHeaderBackground}" />
<Setter Property="BorderBrush" Value="{ThemeResource ExpanderHeaderBorderBrush}" />
<Setter Property="BorderThickness" Value="{ThemeResource ExpanderHeaderBorderThickness}" />
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
</Style>
</ResourceDictionary>
<ResourceDictionary Source="/Resources/ExpanderStyle.xaml"/>
</winui:XamlControlsResources.MergedDictionaries>
Expand Down
68 changes: 68 additions & 0 deletions SDLauncher UWP/DataTemplates/ServerTemplate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml.Media.Imaging;
using SDLauncher_UWP.Helpers;

namespace SDLauncher_UWP.DataTemplates
{
public class ServerTemplate : INotifyPropertyChanged
{
public event PropertyChangedEventHandler PropertyChanged = delegate { };
//server
private string server;
public string Server { get => server; private set { server = value; OnPropertyChanged(); UpdateStatus(); } }
//Vers
private string ver;
public string Versions { get => ver; set { ver = value; OnPropertyChanged(); } }
//port
private int port;
public int Port { get => port; private set { port = value; OnPropertyChanged(); UpdateStatus(); } }
//max players
private int maxPlayers;
public int MaxPlayers { get => maxPlayers; private set { maxPlayers = value; OnPropertyChanged(); } }
//online players
private int minPlayers;
public int OnlinePlayers { get => minPlayers; private set { minPlayers = value; OnPropertyChanged(); } }
//favicon
private string favicon;
public string Favicon { get => favicon; private set { favicon = value; OnPropertyChanged(); } }

public ServerTemplate(string server, int port)
{
Server = server;
Port = port;
UpdateStatus();
}

public async void UpdateStatus()
{
try
{
var status = ServerStatusJSONConverter.Convert(await Util.DownloadText("https://api.mcstatus.io/status/java/" + Server.Trim() + ":" + Port.ToString()));
if (status.online)
{
server = status.host;
port = status.port;
MaxPlayers = status.response.players.max;
Versions = status.response.version.name;
OnlinePlayers = status.response.players.online;
OnPropertyChanged();
Favicon = status.response.favicon;
}
}
catch (Exception)
{

}
}
private void OnPropertyChanged([CallerMemberName] string propertyName = null)
{
this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
}
}
}
10 changes: 1 addition & 9 deletions SDLauncher UWP/Dialogs/Login.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
</TransitionCollection>
</Grid.ChildrenTransitions>
<Grid Canvas.ZIndex="10"/>
<Button PointerEntered="Button_PointerEntered" PointerExited="Button_PointerExited" Height="200" Width="160" Padding="0,0,0,0" Tag="{x:Bind Count.ToString(),Mode=OneWay}" Click="LoginFromCache" Margin="5,0,0,5" HorizontalAlignment="Left">
<Button Style="{ThemeResource ChooseButtonSyle}" PointerEntered="Button_PointerEntered" PointerExited="Button_PointerExited" Height="200" Width="160" Padding="0,0,0,0" Tag="{x:Bind Count.ToString(),Mode=OneWay}" Click="LoginFromCache" Margin="5,0,0,5" HorizontalAlignment="Left">
<Button.ContextFlyout>
<MenuFlyout>
<MenuFlyoutItem Tag="{x:Bind Count.ToString(),Mode=OneWay}" Text="Remove" Click="LogOutFromCache"/>
Expand All @@ -112,14 +112,6 @@
<MenuFlyoutItem Tag="{x:Bind Count.ToString(),Mode=OneWay}" Text="Duplicate" Click="itmDouble_Click"/>
</MenuFlyout>
</Button.ContextFlyout>
<Button.Style>
<Style TargetType="Button">
<Setter Property="Background" Value="{ThemeResource ExpanderHeaderBackground}" />
<Setter Property="BorderBrush" Value="{ThemeResource ExpanderHeaderBorderBrush}" />
<Setter Property="BorderThickness" Value="{ThemeResource ExpanderHeaderBorderThickness}" />
<Setter Property="CornerRadius" Value="{ThemeResource ControlCornerRadius}" />
</Style>
</Button.Style>
<Grid>
<CheckBox IsChecked="{x:Bind IsChecked,Mode=OneWay}" Tag="{x:Bind Count.ToString(),Mode=OneWay}" Canvas.ZIndex="3" Click="chkbxSelectAcc_Click" Visibility="{x:Bind IsCheckboxVsible,Mode=OneWay}" Margin="5,-6,0,0" MinWidth="0" VerticalAlignment="Top" HorizontalAlignment="Left"/>
<Grid Margin="10" Padding="20,10">
Expand Down
51 changes: 51 additions & 0 deletions SDLauncher UWP/Dialogs/ServerChooserDialog.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
<ContentDialog
x:Class="SDLauncher_UWP.Dialogs.ServerChooserDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:SDLauncher_UWP.Dialogs"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="Choose or add a server"
Background="{ThemeResource AcrylicInAppFillColorDefaultBrush}"
PrimaryButtonText="Button1"
CloseButtonStyle="{ThemeResource ButtonRevealStyle}"
PrimaryButtonStyle="{ThemeResource ButtonRevealStyle}"
SecondaryButtonStyle="{ThemeResource ButtonRevealStyle}"
SecondaryButtonText="Button2"
CornerRadius="10"
PrimaryButtonClick="ContentDialog_PrimaryButtonClick"
SecondaryButtonClick="ContentDialog_SecondaryButtonClick"
xmlns:data="using:SDLauncher_UWP.DataTemplates">

<Grid>
<FlipView BorderBrush="Black" BorderThickness="1" x:Name="view">
<FlipView.ItemTemplate>
<DataTemplate x:DataType="data:ServerTemplate">
<Button Padding="15,45" Style="{ThemeResource ChooseButtonSyle}">
<Grid>
<StackPanel>
<WebView DefaultBackgroundColor="Transparent" Source="{x:Bind Favicon,Mode=OneWay}" HorizontalAlignment="Center"/>
<TextBlock HorizontalAlignment="Center" Style="{ThemeResource SubtitleTextBlockStyle}" Text="{x:Bind Server,Mode=OneWay}"/>
<WebView DefaultBackgroundColor="Transparent" HorizontalAlignment="Center"/>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<TextBlock>
<Run Text="{x:Bind Server,Mode=OneWay}"/> : <Run Text="{x:Bind Port.ToString(),Mode=OneWay}"/>
</TextBlock>
</StackPanel>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
<FontIcon Glyph="&#xe7fc;" VerticalAlignment="Center"/>
<TextBlock Margin="5,0,0,0" >
<Run Text="{x:Bind OnlinePlayers.ToString(),Mode=OneWay}"/>/
<Run Text="{x:Bind MaxPlayers.ToString(),Mode=OneWay}"/> playing
</TextBlock>
</StackPanel>
<TextBlock HorizontalAlignment="Center" Text="{x:Bind Versions,Mode=OneWay}"/>
</StackPanel>
</Grid>
</Button>
</DataTemplate>
</FlipView.ItemTemplate>
</FlipView>
</Grid>
</ContentDialog>
39 changes: 39 additions & 0 deletions SDLauncher UWP/Dialogs/ServerChooserDialog.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Navigation;
using SDLauncher_UWP.DataTemplates;
using System.Collections.ObjectModel;
// The Content Dialog item template is documented at https://go.microsoft.com/fwlink/?LinkId=234238

namespace SDLauncher_UWP.Dialogs
{
public sealed partial class ServerChooserDialog : ContentDialog
{
public ObservableCollection<ServerTemplate> servers = new ObservableCollection<ServerTemplate>();
public ServerChooserDialog()
{
this.InitializeComponent();
servers.Add(new ServerTemplate("mc.hypixel.net", 25565));
view.ItemsSource = servers;
}

private void ContentDialog_PrimaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
}

private void ContentDialog_SecondaryButtonClick(ContentDialog sender, ContentDialogButtonClickEventArgs args)
{
}
}
}
6 changes: 3 additions & 3 deletions SDLauncher UWP/Helpers/Account.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ public Account(string username, string type, string accesstoken, string uuid, in
{
IsCheckboxVsible = Visibility.Collapsed;
IsChecked = false;
PicList.Add("https://raw.githubusercontent.com/Chaniru22/SDLauncher/main/Pictures/steve.png");
PicList.Add("https://raw.githubusercontent.com/Chaniru22/SDLauncher/main/Pictures/NoobSteve.png");
PicList.Add("https://raw.githubusercontent.com/Chaniru22/SDLauncher/main/Pictures/alex.png");
PicList.Add("https://github.com/SeaDevTeam/SDLauncher/raw/main/Pictures/steve.png");
PicList.Add("https://github.com/SeaDevTeam/SDLauncher/raw/main/Pictures/NoobSteve.png");
PicList.Add("https://github.com/SeaDevTeam/SDLauncher/raw/main/Pictures/alex.png");
if (pic == null)
{
Random r = new Random();
Expand Down
10 changes: 5 additions & 5 deletions SDLauncher UWP/Helpers/OptiFine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -68,22 +68,22 @@ public void DownloadOptiFineVer(string mcver, string modVer, string DisplayVer)
case "1.18.2":
returns = new OptFineVerReturns(modVer, mcver, DisplayVer, OptFineVerReturns.Results.DownloadOptiFineVer);
optver = ": " + mcver;
OptFineDownload("https://raw.githubusercontent.com/Chaniru22/SDLauncher/main/OptiFine-1.18.2.zip", "OptiFine-" + mcver + ".zip", ModType.ver);
OptFineDownload("https://github.com/SeaDevTeam/SDLauncher/raw/main/OptiFine-1.18.2.zip", "OptiFine-" + mcver + ".zip", ModType.ver);
break;
case "1.18.1":
returns = new OptFineVerReturns(modVer, mcver, DisplayVer, OptFineVerReturns.Results.DownloadOptiFineVer);
optver = ": " + mcver;
OptFineDownload("https://raw.githubusercontent.com/Chaniru22/SDLauncher/main/OptiFine-1.18.1.zip", "OptiFine-" + mcver + ".zip", ModType.ver);
OptFineDownload("https://github.com/SeaDevTeam/SDLauncher/raw/main/OptiFine-1.18.1.zip", "OptiFine-" + mcver + ".zip", ModType.ver);
break;
case "1.17.1":
returns = new OptFineVerReturns(modVer, mcver, DisplayVer, OptFineVerReturns.Results.DownloadOptiFineVer);
optver = ": " + mcver;
OptFineDownload("https://raw.githubusercontent.com/Chaniru22/SDLauncher/main/OptiFine-1.17.1.zip", "OptiFine-" + mcver + ".zip", ModType.ver);
OptFineDownload("https://github.com/SeaDevTeam/SDLauncher/raw/main/OptiFine-1.17.1.zip", "OptiFine-" + mcver + ".zip", ModType.ver);
break;
case "1.16.5":
returns = new OptFineVerReturns(modVer, mcver, DisplayVer, OptFineVerReturns.Results.DownloadOptiFineVer);
optver = ": " + mcver;
OptFineDownload("https://raw.githubusercontent.com/Chaniru22/SDLauncher/main/OptiFine-1.16.5.zip", "OptiFine-" + mcver + ".zip", ModType.ver);
OptFineDownload("https://github.com/SeaDevTeam/SDLauncher/raw/main/OptiFine-1.16.5.zip", "OptiFine-" + mcver + ".zip", ModType.ver);
break;
}
}
Expand Down Expand Up @@ -129,7 +129,7 @@ public async Task<OptFineVerReturns> CheckOptiFine(string mcver, string modVer,
await MessageBox.Show("Information", "This will download main OptiFine library, Please click again " + DisplayVer + " (after download and extract the main OptiFine) to install optifine of that version !", MessageBoxButtons.Ok);
optver = " Lib";
returns = new OptFineVerReturns(modVer, mcver, "Version", OptFineVerReturns.Results.DownloadOptiFineLib);
OptFineDownload("https://raw.githubusercontent.com/Chaniru22/SDLauncher/main/optifine.zip", "OptiFine.zip", ModType.lib);
OptFineDownload("https://github.com/SeaDevTeam/SDLauncher/raw/main/optifine.zip", "OptiFine.zip", ModType.lib);
UIChangedReqested(true, new EventArgs());
return returns;
}
Expand Down
66 changes: 66 additions & 0 deletions SDLauncher UWP/Helpers/ServerStatusInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace SDLauncher_UWP.Helpers
{
public static class ServerStatusJSONConverter
{
public static ServerStatusInfo.Root Convert(string json)
{
return JsonConvert.DeserializeObject<ServerStatusInfo.Root>(json);
}
}
public class ServerStatusInfo
{

public class Root
{
public bool online { get; set; }
public string host { get; set; }
public int port { get; set; }
public Response response { get; set; }
}

public class Response
{
public Version version { get; set; }
public Players players { get; set; }
public Motd motd { get; set; }
public string favicon { get; set; }
public Srv_Record srv_record { get; set; }
}

public class Version
{
public string name { get; set; }
public int protocol { get; set; }
}

public class Players
{
public int online { get; set; }
public int max { get; set; }
public object[] sample { get; set; }
}

public class Motd
{
public string raw { get; set; }
public string clean { get; set; }
public string html { get; set; }
}

public class Srv_Record
{
public string host { get; set; }
public int port { get; set; }
}

}


}
Loading

0 comments on commit 50b9a75

Please sign in to comment.