mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
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:
parent
ed0a69185f
commit
eeb4383099
2 changed files with 16 additions and 19 deletions
|
|
@ -134,6 +134,12 @@ namespace MinecraftClient.Scripting.DynamicRun.Builder
|
||||||
assemblyrefs.Add(new("System.Runtime"));
|
assemblyrefs.Add(new("System.Runtime"));
|
||||||
assemblyrefs.Add(new("System.Private.Uri"));
|
assemblyrefs.Add(new("System.Private.Uri"));
|
||||||
assemblyrefs.Add(new("System.Net.Requests"));
|
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) {
|
foreach (var refs in assemblyrefs) {
|
||||||
Assembly? loadedAssembly;
|
Assembly? loadedAssembly;
|
||||||
|
|
@ -182,7 +188,9 @@ namespace MinecraftClient.Scripting.DynamicRun.Builder
|
||||||
// Add facade assemblies needed for Roslyn compilation when referencing
|
// Add facade assemblies needed for Roslyn compilation when referencing
|
||||||
// libraries that target netstandard (e.g. Brigadier.NET).
|
// libraries that target netstandard (e.g. Brigadier.NET).
|
||||||
var runtimeDir = Path.GetDirectoryName(SystemPrivateCoreLib)!;
|
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);
|
var facadePath = Path.Combine(runtimeDir, facadeName);
|
||||||
if (File.Exists(facadePath))
|
if (File.Exists(facadePath))
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,11 @@
|
||||||
//MCCScript 1.0
|
//MCCScript 1.0
|
||||||
//using System.Collections.Concurrent
|
//using System.Collections.Concurrent;
|
||||||
//using System.Collections.Generic
|
//using System.Net.Sockets;
|
||||||
//using System.IO
|
//using System.Net.WebSockets;
|
||||||
//using System.Linq
|
//using System.Text.Json;
|
||||||
//using System.Net
|
//using System.Text.Json.Serialization;
|
||||||
//using System.Net.Sockets
|
//using System.Threading.Tasks;
|
||||||
//using System.Net.WebSockets
|
//using MinecraftClient.CommandHandler;
|
||||||
//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
|
|
||||||
|
|
||||||
// IMPORTANT: Change the password below before use!
|
// IMPORTANT: Change the password below before use!
|
||||||
MCC.LoadBot(new WebSocketBot("127.0.0.1", 8043, "CHANGE_THIS_PASSWORD"));
|
MCC.LoadBot(new WebSocketBot("127.0.0.1", 8043, "CHANGE_THIS_PASSWORD"));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue