Update MPN00BS

This commit is contained in:
Li 2022-07-22 01:51:31 +12:00
parent c32d1740e3
commit b439ad1511
58 changed files with 173 additions and 139164 deletions

View file

@ -1,7 +1,51 @@
<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Name="Horse Isle"
x:Class="MPN00BS.App">
<Application.Styles>
<FluentTheme Mode="Light"/>
</Application.Styles>
<TrayIcon.Icons>
<TrayIcons>
<TrayIcon Icon="/icon.ico" ToolTipText="HI1 Server">
<TrayIcon.Menu>
<NativeMenu>
<NativeMenuItem Header="Users">
<NativeMenu>
<NativeMenuItem Header="Create New User" />
<NativeMenuItem Header="Reset Passsword" />
</NativeMenu>
</NativeMenuItem>
<NativeMenuItem Header="Server">
<NativeMenu>
<NativeMenuItem Header="Shutdown Server" />
<NativeMenuItem Header="Chat">
<NativeMenu>
<NativeMenuItem Header="Disable Swear Filter" ToggleType="CheckBox" IsChecked="True"/>
<NativeMenuItem Header="Disable Corrections" ToggleType="CheckBox" IsChecked="True"/>
<NativeMenuItem Header="Disable Non-Vio Checks" ToggleType="CheckBox" IsChecked="True"/>
<NativeMenuItem Header="Disable Spam Filter" ToggleType="CheckBox" IsChecked="True"/>
</NativeMenu>
</NativeMenuItem>
<NativeMenuItem Header="Game">
<NativeMenu>
<NativeMenuItem Header="All Users Subscribed" ToggleType="CheckBox" IsChecked="True"/>
<NativeMenuItem Header="Fix Offical Bugs" ToggleType="CheckBox" IsChecked="True"/>
</NativeMenu>
</NativeMenuItem>
<NativeMenuItem Header="Advanced">
<NativeMenu>
<NativeMenuItem Header="Edit &quot;server.properties&quot;" />
<NativeMenuItem Header="Open Server Folder" />
</NativeMenu>
</NativeMenuItem>
</NativeMenu>
</NativeMenuItem>
</NativeMenu>
</TrayIcon.Menu>
</TrayIcon>
</TrayIcons>
</TrayIcon.Icons>
</Application>

View file

@ -5,7 +5,7 @@
mc:Ignorable="d" d:DesignWidth="820" d:DesignHeight="200"
x:Class="MPN00BS.LoadingWindow"
Title="Starting Server ..." Height="200" Width="820"
MaxHeight="200" MaxWidth="820">
MaxHeight="200" MaxWidth="820" Icon="/icon.ico">
<Grid Height="200" Width="820">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*" />

View file

@ -9,17 +9,16 @@ namespace MPN00BS
public partial class LoadingWindow : Window
{
private void OnClientExit()
public void OnServerStarted()
{
Dispatcher.UIThread.InvokeAsync(() =>
{
this.Hide();
new SystemTrayIcon().Show();
this.Close();
});
}
public void OnServerStarted()
{
ServerStarter.StartHorseIsleClient(OnClientExit, "127.0.0.1", 12321);
}
public void OnNoUsersFound()
{
Dispatcher.UIThread.InvokeAsync(() =>
@ -33,10 +32,6 @@ namespace MPN00BS
Dispatcher.UIThread.InvokeAsync(() =>
{
startupProgress.Value++;
if (startupProgress.Value >= startupProgress.Maximum)
{
this.Hide();
}
});
}
public LoadingWindow()

View file

@ -25,7 +25,7 @@
<Platforms>x64</Platforms>
<PlatformTarget>x64</PlatformTarget>
<DefineConstants>OS_WINDOWS;ARCH_X86_64</DefineConstants>
<DebugType>none</DebugType>
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows|ARM'">
<RuntimeIdentifier>win-arm</RuntimeIdentifier>
@ -82,7 +82,7 @@
<Optimize>true</Optimize>
<PlatformTarget>x64</PlatformTarget>
<DefineConstants>OS_LINUX;ARCH_X86_64</DefineConstants>
<DebugType>none</DebugType>
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Linux|ARM'">
<RuntimeIdentifier>linux-arm</RuntimeIdentifier>
@ -104,7 +104,7 @@
<Optimize>true</Optimize>
<PlatformTarget>x64</PlatformTarget>
<DefineConstants>OS_MACOS;ARCH_X86_64</DefineConstants>
<DebugType>none</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MacOS|ARM64'">
<RuntimeIdentifier>osx-arm64</RuntimeIdentifier>
@ -133,6 +133,18 @@
<DefineConstants>OS_ALL;ARCH_ANYCPU</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Android|x64'">
<DebugType>portable</DebugType>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='iOS|x64'">
<DebugType>portable</DebugType>
</PropertyGroup>
<ItemGroup>
<None Remove=".gitignore" />
<None Remove="HispLogo.gif" />
@ -144,13 +156,6 @@
<TrimmableAssembly Include="Avalonia.Themes.Fluent" />
<TrimmableAssembly Include="Avalonia.Themes.Default" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.14" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.14" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.14" />
<PackageReference Include="XamlNameReferenceGenerator" Version="1.3.4" />
</ItemGroup>
<ItemGroup>
<Compile Update="MpOrSp.axaml.cs">
<DependentUpon>MpOrSp.axaml</DependentUpon>
@ -207,7 +212,15 @@
</ItemGroup>
<ItemGroup>
<Content Include="icon.ico" />
<AvaloniaResource Include="icon.ico" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Avalonia" Version="0.10.17" />
<PackageReference Include="Avalonia.Desktop" Version="0.10.17" />
<!--Condition below is needed to remove Avalonia.Diagnostics package from build output in Release configuration.-->
<PackageReference Condition="'$(Configuration)' == 'Debug'" Include="Avalonia.Diagnostics" Version="0.10.17" />
<PackageReference Include="XamlNameReferenceGenerator" Version="1.3.4" />
</ItemGroup>
<ItemGroup>

View file

@ -3,7 +3,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="MPN00BS.MessageBox" SizeToContent="WidthAndHeight" CanResize="False">
x:Class="MPN00BS.MessageBox" Icon="/icon.ico" SizeToContent="WidthAndHeight" CanResize="False">
<StackPanel HorizontalAlignment="Center">
<TextBlock HorizontalAlignment="Center" Name="Text"/>
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal" Name="Buttons">

View file

@ -8,7 +8,8 @@
Height="90"
Width="550"
MaxWidth="550"
MaxHeight="90">
MaxHeight="90"
Icon="/icon.ico">
<Grid Height="70" Width="550" HorizontalAlignment="Center" VerticalAlignment="Center" >
<Grid.RowDefinitions>
<RowDefinition Height="1*" />

View file

@ -4,6 +4,6 @@ https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project>
<PropertyGroup>
<History>True|2022-07-20T06:43:12.6339464Z;</History>
<History>True|2022-07-20T07:28:37.2663216Z;True|2022-07-20T18:43:12.6339464+12:00;</History>
</PropertyGroup>
</Project>

View file

@ -5,7 +5,7 @@
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="MPN00BS.RegisterWindow"
Title="Create Account" MaxHeight="450" MaxWidth="800"
MinWidth="800" MinHeight="450" Height="450" Width="800">
MinWidth="800" MinHeight="450" Height="450" Width="800" Icon="/icon.ico">
<Grid Height="450" Width="800">
<Grid.RowDefinitions>
<RowDefinition Height="1*" />

View file

@ -8,7 +8,8 @@
Height="100"
Width="780"
MaxWidth="780"
MaxHeight="100">
MaxHeight="100"
Icon="/icon.ico">
<Grid Height="100" Width="780">
<Grid.RowDefinitions>
<RowDefinition Height="1*" />

View file

@ -60,7 +60,6 @@ namespace MPN00BS
clientProcess.EnableRaisingEvents = true;
clientProcess.Exited += HorseIsleClientExited;
clientProcess.Start();
clientProcess.WaitForExit();
}
public static void StartHispServer(Action ProgressCallback, Action UserCreationCallback, Action ServerStartedCallback)

View file

@ -0,0 +1,15 @@
<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="1" d:DesignHeight="0"
x:Class="MPN00BS.SystemTrayIcon"
Title="System Tray Icon"
Height="0"
Width="0"
MaxWidth="0"
MaxHeight="0"
Icon="/icon.ico"
IsVisible="False">
</Window>

View file

@ -0,0 +1,73 @@
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.Threading;
using HISP.Server;
namespace MPN00BS
{
public partial class SystemTrayIcon : Window
{
public bool swearFilterEnabled
{
get
{
return ConfigReader.BadWords;
}
}
public bool correctionsEnabled
{
get
{
return ConfigReader.DoCorrections;
}
}
public bool nonVioChecksEnabled
{
get
{
return ConfigReader.DoNonViolations;
}
}
public bool spamFilterEnabled
{
get
{
return ConfigReader.EnableSpamFilter;
}
}
public bool allUsersSubbed
{
get
{
return ConfigReader.AllUsersSubbed;
}
}
public bool fixOfficalBugs
{
get
{
return ConfigReader.FixOfficalBugs;
}
}
private void OnClientExit()
{
Dispatcher.UIThread.InvokeAsync(() =>
{
this.Close();
});
}
public SystemTrayIcon()
{
InitializeComponent();
this.Hide();
ServerStarter.StartHorseIsleClient(OnClientExit, "127.0.0.1", 12321);
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}
}