mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
Fixed Script Scheduler bug
This commit is contained in:
parent
5b13e740ef
commit
a5423211ad
6 changed files with 131 additions and 55 deletions
|
|
@ -25,6 +25,7 @@ namespace MinecraftClient.ChatBots
|
|||
private bool csharp;
|
||||
private Thread? thread;
|
||||
private readonly Dictionary<string, object>? localVars;
|
||||
private readonly string? scriptOwnerKey;
|
||||
|
||||
public Script(string filename)
|
||||
{
|
||||
|
|
@ -38,6 +39,13 @@ namespace MinecraftClient.ChatBots
|
|||
this.localVars = localVars;
|
||||
}
|
||||
|
||||
internal Script(string filename, string? ownername, Dictionary<string, object>? localVars, string? scriptOwnerKey)
|
||||
: this(filename, ownername, localVars)
|
||||
{
|
||||
this.scriptOwnerKey = scriptOwnerKey;
|
||||
SetScriptOwnerKey(scriptOwnerKey);
|
||||
}
|
||||
|
||||
private void ParseArguments(string argstr)
|
||||
{
|
||||
List<string> args = new();
|
||||
|
|
@ -166,7 +174,7 @@ namespace MinecraftClient.ChatBots
|
|||
{
|
||||
try
|
||||
{
|
||||
CSharpRunner.Run(this, lines, args, localVars, scriptName: file!);
|
||||
CSharpRunner.Run(this, lines, args, localVars, scriptName: file!, scriptOwnerKey: scriptOwnerKey);
|
||||
}
|
||||
catch (CSharpException e)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue