Fix Roslyn compiler references for WebSocket/HttpListener and fix MCCScript using directive semicolons

Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/6fa57d65-60be-4a4b-b15a-ad3541ac6de3
This commit is contained in:
copilot-swe-agent[bot] 2026-03-25 14:32:39 +00:00
parent ed0a69185f
commit eeb4383099
2 changed files with 16 additions and 19 deletions

View file

@ -134,6 +134,12 @@ namespace MinecraftClient.Scripting.DynamicRun.Builder
assemblyrefs.Add(new("System.Runtime"));
assemblyrefs.Add(new("System.Private.Uri"));
assemblyrefs.Add(new("System.Net.Requests"));
assemblyrefs.Add(new("System.Net.WebSockets"));
assemblyrefs.Add(new("System.Net.HttpListener"));
assemblyrefs.Add(new("System.Net.Primitives"));
assemblyrefs.Add(new("System.Net.Sockets"));
assemblyrefs.Add(new("Microsoft.Win32.Primitives"));
assemblyrefs.Add(new("System.Collections.Concurrent"));
foreach (var refs in assemblyrefs) {
Assembly? loadedAssembly;
@ -182,7 +188,9 @@ namespace MinecraftClient.Scripting.DynamicRun.Builder
// Add facade assemblies needed for Roslyn compilation when referencing
// libraries that target netstandard (e.g. Brigadier.NET).
var runtimeDir = Path.GetDirectoryName(SystemPrivateCoreLib)!;
foreach (var facadeName in new[] { "netstandard.dll", "System.Runtime.dll", "System.Private.Uri.dll", "System.Net.Requests.dll" })
foreach (var facadeName in new[] { "netstandard.dll", "System.Runtime.dll", "System.Private.Uri.dll", "System.Net.Requests.dll",
"System.Net.WebSockets.dll", "System.Net.HttpListener.dll", "System.Net.Primitives.dll", "System.Net.Sockets.dll",
"Microsoft.Win32.Primitives.dll", "System.Collections.Concurrent.dll" })
{
var facadePath = Path.Combine(runtimeDir, facadeName);
if (File.Exists(facadePath))

View file

@ -1,22 +1,11 @@
//MCCScript 1.0
//using System.Collections.Concurrent
//using System.Collections.Generic
//using System.IO
//using System.Linq
//using System.Net
//using System.Net.Sockets
//using System.Net.WebSockets
//using System.Text
//using System.Text.Json
//using System.Text.Json.Serialization
//using System.Text.RegularExpressions
//using System.Threading
//using System.Threading.Tasks
//using MinecraftClient.CommandHandler
//using MinecraftClient.Inventory
//using MinecraftClient.Mapping
//using MinecraftClient.Scripting
//using MinecraftClient
//using System.Collections.Concurrent;
//using System.Net.Sockets;
//using System.Net.WebSockets;
//using System.Text.Json;
//using System.Text.Json.Serialization;
//using System.Threading.Tasks;
//using MinecraftClient.CommandHandler;
// IMPORTANT: Change the password below before use!
MCC.LoadBot(new WebSocketBot("127.0.0.1", 8043, "CHANGE_THIS_PASSWORD"));