Address PR #2927 review: revert files, translate Polish comments to English

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/fa881b38-28d9-4e46-9c06-8ddab0dcac78
This commit is contained in:
copilot-swe-agent[bot] 2026-03-20 21:36:31 +00:00
parent 2a6922ccba
commit 56fffc6716
10 changed files with 852 additions and 515 deletions

View file

@ -1,6 +1,8 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual Studio 2010
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 18
VisualStudioVersion = 18.3.11505.172 d18.3
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MinecraftClientGUI", "MinecraftClientGUI\MinecraftClientGUI.csproj", "{B9E600B3-C8F0-4BF8-85E1-C164956B0B0D}"
EndProject
Global
@ -9,8 +11,8 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{B9E600B3-C8F0-4BF8-85E1-C164956B0B0D}.Debug|x86.ActiveCfg = Debug|x86
{B9E600B3-C8F0-4BF8-85E1-C164956B0B0D}.Debug|x86.Build.0 = Debug|x86
{B9E600B3-C8F0-4BF8-85E1-C164956B0B0D}.Debug|x86.ActiveCfg = Release|x86
{B9E600B3-C8F0-4BF8-85E1-C164956B0B0D}.Debug|x86.Build.0 = Release|x86
{B9E600B3-C8F0-4BF8-85E1-C164956B0B0D}.Release|x86.ActiveCfg = Release|x86
{B9E600B3-C8F0-4BF8-85E1-C164956B0B0D}.Release|x86.Build.0 = Release|x86
EndGlobalSection

View file

@ -28,146 +28,20 @@
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(Form1));
this.groupBox_Login = new System.Windows.Forms.GroupBox();
this.btn_connect = new System.Windows.Forms.Button();
this.box_ip = new System.Windows.Forms.TextBox();
this.box_password = new System.Windows.Forms.TextBox();
this.box_Login = new System.Windows.Forms.TextBox();
this.box_output = new System.Windows.Forms.RichTextBox();
this.box_input = new System.Windows.Forms.TextBox();
this.btn_send = new System.Windows.Forms.Button();
this.btn_about = new System.Windows.Forms.Button();
this.groupBox_Login.SuspendLayout();
this.components = new System.ComponentModel.Container();
this.SuspendLayout();
//
// groupBox_Login
//
this.groupBox_Login.BackColor = System.Drawing.Color.Transparent;
this.groupBox_Login.Controls.Add(this.btn_connect);
this.groupBox_Login.Controls.Add(this.box_ip);
this.groupBox_Login.Controls.Add(this.box_password);
this.groupBox_Login.Controls.Add(this.box_Login);
this.groupBox_Login.Location = new System.Drawing.Point(13, 11);
this.groupBox_Login.Name = "groupBox_Login";
this.groupBox_Login.Size = new System.Drawing.Size(564, 46);
this.groupBox_Login.TabIndex = 0;
this.groupBox_Login.TabStop = false;
this.groupBox_Login.Text = " ";
//
// btn_connect
//
this.btn_connect.Location = new System.Drawing.Point(513, 15);
this.btn_connect.Name = "btn_connect";
this.btn_connect.Size = new System.Drawing.Size(40, 23);
this.btn_connect.TabIndex = 6;
this.btn_connect.Text = "Go!";
this.btn_connect.UseVisualStyleBackColor = true;
this.btn_connect.Click += new System.EventHandler(this.btn_connect_Click);
//
// box_ip
//
this.box_ip.Location = new System.Drawing.Point(400, 17);
this.box_ip.Name = "box_ip";
this.box_ip.Size = new System.Drawing.Size(100, 20);
this.box_ip.TabIndex = 5;
this.box_ip.KeyUp += new System.Windows.Forms.KeyEventHandler(this.loginBox_KeyUp);
//
// box_password
//
this.box_password.Location = new System.Drawing.Point(235, 17);
this.box_password.Name = "box_password";
this.box_password.PasswordChar = '•';
this.box_password.Size = new System.Drawing.Size(100, 20);
this.box_password.TabIndex = 3;
this.box_password.KeyUp += new System.Windows.Forms.KeyEventHandler(this.loginBox_KeyUp);
//
// box_Login
//
this.box_Login.Location = new System.Drawing.Point(67, 17);
this.box_Login.Name = "box_Login";
this.box_Login.Size = new System.Drawing.Size(100, 20);
this.box_Login.TabIndex = 1;
this.box_Login.KeyUp += new System.Windows.Forms.KeyEventHandler(this.loginBox_KeyUp);
//
// box_output
//
this.box_output.Location = new System.Drawing.Point(13, 66);
this.box_output.Name = "box_output";
this.box_output.ReadOnly = true;
this.box_output.Size = new System.Drawing.Size(564, 292);
this.box_output.TabIndex = 1;
this.box_output.Text = "";
this.box_output.LinkClicked += new System.Windows.Forms.LinkClickedEventHandler(this.LinkClicked);
//
// box_input
//
this.box_input.AcceptsTab = true;
this.box_input.Location = new System.Drawing.Point(13, 365);
this.box_input.MaxLength = 100;
this.box_input.Multiline = true;
this.box_input.Name = "box_input";
this.box_input.Size = new System.Drawing.Size(490, 20);
this.box_input.TabIndex = 2;
this.box_input.KeyDown += new System.Windows.Forms.KeyEventHandler(this.inputBox_KeyDown);
//
// btn_send
//
this.btn_send.Location = new System.Drawing.Point(509, 364);
this.btn_send.Name = "btn_send";
this.btn_send.Size = new System.Drawing.Size(40, 22);
this.btn_send.TabIndex = 3;
this.btn_send.Text = "Send";
this.btn_send.UseVisualStyleBackColor = true;
this.btn_send.Click += new System.EventHandler(this.btn_send_Click);
//
// btn_about
//
this.btn_about.Location = new System.Drawing.Point(555, 364);
this.btn_about.Name = "btn_about";
this.btn_about.Size = new System.Drawing.Size(22, 22);
this.btn_about.TabIndex = 4;
this.btn_about.Text = "?";
this.btn_about.UseVisualStyleBackColor = true;
this.btn_about.Click += new System.EventHandler(this.btn_about_Click);
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.BackColor = System.Drawing.SystemColors.Control;
this.ClientSize = new System.Drawing.Size(589, 398);
this.Controls.Add(this.btn_about);
this.Controls.Add(this.btn_send);
this.Controls.Add(this.box_input);
this.Controls.Add(this.box_output);
this.Controls.Add(this.groupBox_Login);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.ClientSize = new System.Drawing.Size(1100, 700);
this.Name = "Form1";
this.Text = "MCC Multibox Commander";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Minecraft Console Client GUI";
this.FormClosed += new System.Windows.Forms.FormClosedEventHandler(this.onClose);
this.Load += new System.EventHandler(this.Form1_Load);
this.groupBox_Login.ResumeLayout(false);
this.groupBox_Login.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.GroupBox groupBox_Login;
private System.Windows.Forms.Button btn_connect;
private System.Windows.Forms.TextBox box_ip;
private System.Windows.Forms.TextBox box_password;
private System.Windows.Forms.TextBox box_Login;
private System.Windows.Forms.RichTextBox box_output;
private System.Windows.Forms.TextBox box_input;
private System.Windows.Forms.Button btn_send;
private System.Windows.Forms.Button btn_about;
}
}

File diff suppressed because it is too large Load diff

View file

@ -24,33 +24,18 @@ namespace MinecraftClientGUI
private Process Client;
private Thread Reader;
/// <summary>
/// Start a client using command-line arguments
/// </summary>
/// <param name="args">Arguments to pass</param>
public MinecraftClient(string[] args)
{
initClient("\"" + String.Join("\" \"", args) + "\" BasicIO");
}
/// <summary>
/// Start the client using username, password and server IP
/// </summary>
/// <param name="username">Username or email</param>
/// <param name="password">Password for the given username</param>
/// <param name="serverip">Server IP to join</param>
public MinecraftClient(string username, string password, string serverip)
{
// If password is empty, send an empty string to handle Microsoft/Browser login
if (password == null) password = "";
initClient('"' + username + "\" \"" + password + "\" \"" + serverip + "\" BasicIO");
}
/// <summary>
/// Inner function for launching the external console application
/// </summary>
/// <param name="arguments">Arguments to pass</param>
private void initClient(string arguments)
{
if (File.Exists(ExePath))
@ -59,7 +44,10 @@ namespace MinecraftClientGUI
Client.StartInfo.FileName = ExePath;
Client.StartInfo.Arguments = arguments;
Client.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
Client.StartInfo.StandardOutputEncoding = Encoding.GetEncoding(System.Globalization.CultureInfo.CurrentCulture.TextInfo.ANSICodePage);
// FIX: Force UTF-8 encoding to fix special characters and colors
Client.StartInfo.StandardOutputEncoding = System.Text.Encoding.UTF8;
Client.StartInfo.UseShellExecute = false;
Client.StartInfo.RedirectStandardOutput = true;
Client.StartInfo.RedirectStandardInput = true;
@ -69,66 +57,58 @@ namespace MinecraftClientGUI
Reader = new Thread(new ThreadStart(t_reader));
Reader.Start();
}
else throw new FileNotFoundException("Cannot find Minecraft Client Executable!", ExePath);
else throw new FileNotFoundException("MinecraftClient.exe not found!", ExePath);
}
/// <summary>
/// Thread for reading output and app messages from the console
/// </summary>
private void t_reader()
{
while (true)
{
try
{
string line = "";
while (line.Trim() == "")
if (Client.HasExited) { disconnected = true; break; }
string line = Client.StandardOutput.ReadLine();
if (line != null)
{
line = Client.StandardOutput.ReadLine() + Client.MainWindowTitle;
if (line.Length > 0)
if (line.Trim() != "")
{
if (line == "Server was successfuly joined.") { disconnected = false; }
if (line == "You have left the server.") { disconnected = true; }
if (line[0] == (char)0x00)
if (line.Contains("Server was successfuly joined")) { disconnected = false; }
if (line.Contains("You have left the server")) { disconnected = true; }
if (line.Length > 0 && line[0] == (char)0x00)
{
//App message from the console
string[] command = line.Substring(1).Split((char)0x00);
switch (command[0].ToLower())
if (command[0].ToLower() == "autocomplete")
{
case "autocomplete":
if (command.Length > 1) { tabAutoCompleteBuffer.AddLast(command[1]); }
else tabAutoCompleteBuffer.AddLast("");
break;
if (command.Length > 1) { tabAutoCompleteBuffer.AddLast(command[1]); }
else tabAutoCompleteBuffer.AddLast("");
}
}
else OutputBuffer.AddLast(line);
else
{
OutputBuffer.AddLast(line);
}
}
}
else { Thread.Sleep(10); } // Small pause to avoid high CPU usage
}
catch (NullReferenceException) { break; }
catch (Exception) { break; }
}
}
/// <summary>
/// Get the first queuing output line to print
/// </summary>
/// <returns></returns>
public string ReadLine()
{
while (OutputBuffer.Count < 1) { }
while (OutputBuffer.Count < 1)
{
if (disconnected) return "";
Thread.Sleep(10); // Save CPU while waiting for data
}
string line = OutputBuffer.First.Value;
OutputBuffer.RemoveFirst();
return line;
}
/// <summary>
/// Complete a playername or a command, usually by pressing the TAB key
/// </summary>
/// <param name="text_behindcursor">Text to complete</param>
/// <returns>Returns an autocompletion for the provided text</returns>
public string tabAutoComplete(string text_behindcursor)
{
tabAutoCompleteBuffer.Clear();
@ -136,7 +116,12 @@ namespace MinecraftClientGUI
{
text_behindcursor = text_behindcursor.Trim();
SendText((char)0x00 + "autocomplete" + (char)0x00 + text_behindcursor);
int maxwait = 30; while (tabAutoCompleteBuffer.Count < 1 && maxwait > 0) { Thread.Sleep(100); maxwait--; }
int maxwait = 30;
while (tabAutoCompleteBuffer.Count < 1 && maxwait > 0)
{
Thread.Sleep(100);
maxwait--;
}
if (tabAutoCompleteBuffer.Count > 0)
{
string text_completed = tabAutoCompleteBuffer.First.Value;
@ -148,14 +133,9 @@ namespace MinecraftClientGUI
else return "";
}
/// <summary>
/// Send a message or a command to the server
/// </summary>
/// <param name="text">Text to send</param>
public void SendText(string text)
{
if (text != null)
if (text != null && !Client.HasExited)
{
text = text.Replace("\t", "");
text = text.Replace("\r", "");
@ -168,18 +148,17 @@ namespace MinecraftClientGUI
}
}
/// <summary>
/// Properly disconnect from the server and dispose the client
/// </summary>
public void Close()
{
Client.StandardInput.WriteLine("/quit");
if (Reader.IsAlive) { Reader.Abort(); }
if (!Client.WaitForExit(3000))
if (!Client.HasExited)
{
try { Client.Kill(); } catch { }
Client.StandardInput.WriteLine("/quit");
if (Reader.IsAlive) { Reader.Abort(); }
if (!Client.WaitForExit(2000))
{
try { Client.Kill(); } catch { }
}
}
}
}
}
}

Binary file not shown.

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
@ -10,9 +10,26 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>MinecraftClientGUI</RootNamespace>
<AssemblyName>MinecraftClientGUI</AssemblyName>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
<TargetFrameworkProfile>
</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>C:\Users\Admin\Desktop\publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>3</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
@ -23,6 +40,7 @@
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
<PlatformTarget>x86</PlatformTarget>
@ -32,10 +50,23 @@
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>AppIcon.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup>
<ManifestCertificateThumbprint>4C76A63F11DB91E010AF3039521927BEB537A320</ManifestCertificateThumbprint>
</PropertyGroup>
<PropertyGroup>
<ManifestKeyFile>MinecraftClientGUI_TemporaryKey.pfx</ManifestKeyFile>
</PropertyGroup>
<PropertyGroup>
<GenerateManifests>true</GenerateManifests>
</PropertyGroup>
<PropertyGroup>
<SignManifests>true</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
@ -69,7 +100,13 @@
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
<DesignTime>True</DesignTime>
</Compile>
<None Include="app.config" />
<Content Include="MinecraftClient.ini">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Include="MinecraftClientGUI_TemporaryKey.pfx" />
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
@ -82,6 +119,30 @@
</ItemGroup>
<ItemGroup>
<Content Include="AppIcon.ico" />
<Content Include="language.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="macros.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="MinecraftClient.exe">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="settings_v3.txt">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.8">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4.8 %28x86 i x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View file

@ -1,17 +1,17 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18046
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MinecraftClientGUI.Properties
{
namespace MinecraftClientGUI.Properties {
using System;
/// <summary>
/// A strongly-typed resource class, for looking up localized strings, etc.
/// </summary>
@ -19,51 +19,43 @@ namespace MinecraftClientGUI.Properties
// class via a tool like ResGen or Visual Studio.
// To add or remove a member, edit your .ResX file then rerun ResGen
// with the /str option, or rebuild your VS project.
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "18.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
internal class Resources
{
internal class Resources {
private static global::System.Resources.ResourceManager resourceMan;
private static global::System.Globalization.CultureInfo resourceCulture;
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
internal Resources()
{
internal Resources() {
}
/// <summary>
/// Returns the cached ResourceManager instance used by this class.
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Resources.ResourceManager ResourceManager
{
get
{
if ((resourceMan == null))
{
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("MinecraftClientGUI.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;
}
}
/// <summary>
/// Overrides the current thread's CurrentUICulture property for all
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
internal static global::System.Globalization.CultureInfo Culture
{
get
{
internal static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
set
{
set {
resourceCulture = value;
}
}

View file

@ -1,28 +1,24 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.18046
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace MinecraftClientGUI.Properties
{
namespace MinecraftClientGUI.Properties {
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "10.0.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "17.14.0.0")]
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
public static Settings Default
{
get
{
public static Settings Default {
get {
return defaultInstance;
}
}

View file

@ -0,0 +1,3 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8"/></startup></configuration>

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB