Skip to content

Commit

Permalink
Add std.Misc:GetNeoLunaLogAsString() in NeoLuna plug-in.
Browse files Browse the repository at this point in the history
Fix typo std.Sys:Lu[s -> a]ServSetIndex().
  • Loading branch information
nobody committed Dec 4, 2024
1 parent 215a91e commit 8cb7b0e
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 8 deletions.
3 changes: 3 additions & 0 deletions 3rd/Luna/Interfaces/ILuaSys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,11 @@ public interface ILuaSys

bool LuaServChangeSettings(string name, string settings);

// should be deleted on 2026-01-01
bool LusServSetIndex(string name, double index);

bool LuaServSetIndex(string name, double index);

bool LuaServRemove(string name);

void LuaServRestart(string name);
Expand Down
9 changes: 6 additions & 3 deletions 3rd/Luna/Models/Apis/LuaSys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,10 @@ public bool LuaServChangeSettings(string name, string settings)
return false;
}

public bool LusServSetIndex(string name, double index)
// should be deleted on 2026-01-01
public bool LusServSetIndex(string name, double index) => LuaServSetIndex(name, index);

public bool LuaServSetIndex(string name, double index)
{
var core = GetLuaCoreCtrlByName(name);
if (core != null)
Expand Down Expand Up @@ -430,7 +433,7 @@ public void LuaVmWait(string vmh, int ms)

public string LuaVmCreate(string name)
{
var vm = new LuaVm() { logger = new VgcApis.Libs.Sys.QueueLogger(), };
var vm = new LuaVm() { logger = new VgcApis.Libs.Sys.QueueLogger() };

void log(string msg)
{
Expand Down Expand Up @@ -1377,7 +1380,7 @@ VgcApis.Interfaces.ILogable logable
RedirectStandardInput = useStdIn,
RedirectStandardError = redirectOutput,
RedirectStandardOutput = redirectOutput,
}
},
};

DataReceivedEventHandler logHandler = CreateLogHandler(outputEncoding, logable);
Expand Down
8 changes: 7 additions & 1 deletion Plugins/NeoLua/Interfaces/ILuaMisc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,16 @@ public interface ILuaMisc : ILogable
/// <returns>历史最大计数</returns>
int GetMutexPoolMaxCount();

/// <summary>
/// 获取NeoLuna日志窗口的内容
/// </summary>
/// <returns>日志</returns>
string GetNeoLunaLogAsString();

/// <summary>
/// 获取日志窗口的内容
/// </summary>
/// <returns></returns>
/// <returns>日志</returns>
string GetLogAsString();

/// <summary>
Expand Down
3 changes: 3 additions & 0 deletions Plugins/NeoLua/Interfaces/ILuaSys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ public interface ILuaSys

bool LuaServChangeSettings(string name, string settings);

// should be deleted on 2026-01-01
bool LusServSetIndex(string name, double index);

bool LuaServSetIndex(string name, double index);

bool LuaServRemove(string name);

void LuaServRestart(string name);
Expand Down
2 changes: 2 additions & 0 deletions Plugins/NeoLua/Models/Apis/Components/Misc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ public string DetectConfigType(string config)

public void Log(string message) => settings.SendLog(message);

public string GetNeoLunaLogAsString() => settings.GetLogger().GetLogAsString(false);

public string GetLogAsString()
{
return VgcApis.Misc.Logger.GetTrimedContent();
Expand Down
9 changes: 6 additions & 3 deletions Plugins/NeoLua/Models/Apis/LuaSys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,10 @@ public bool LuaServChangeSettings(string name, string settings)
return false;
}

public bool LusServSetIndex(string name, double index)
// should be deleted on 2026-01-01
public bool LusServSetIndex(string name, double index) => LuaServSetIndex(name, index);

public bool LuaServSetIndex(string name, double index)
{
var core = GetLuaCoreCtrlByName(name);
if (core != null)
Expand Down Expand Up @@ -459,7 +462,7 @@ public void LuaVmWait(string vmh, int ms)

public string LuaVmCreate(string name)
{
var vm = new LuaVm() { logger = new VgcApis.Libs.Sys.QueueLogger(), };
var vm = new LuaVm() { logger = new VgcApis.Libs.Sys.QueueLogger() };

void log(string msg)
{
Expand Down Expand Up @@ -1615,7 +1618,7 @@ ILogable logable
RedirectStandardInput = useStdIn,
RedirectStandardError = redirectOutput,
RedirectStandardOutput = redirectOutput,
}
},
};

if (!string.IsNullOrEmpty(workingDir))
Expand Down
4 changes: 3 additions & 1 deletion V2RayGCon/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@
// 可以指定所有值,也可以使用以下所示的 "*" 预置版本号和修订号
// 方法是按如下所示使用“*”: :
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("2.0.7.1")]
[assembly: AssemblyVersion("2.0.7.2")]
[assembly: AssemblyFileVersion("1.0.0.0")]

/*
v2.0.7.2 Add std.Misc:GetNeoLunaLogAsString() in NeoLuna plug-in.
Fix typo std.Sys:Lu[s -> a]ServSetIndex().
v2.0.7.1 Support xhttp and raw stream settings in vless://...
--------------------------------------------------------------------
v2.0.6.2 Fix CVE-2024-48510 in ZipExtractor.
Expand Down

0 comments on commit 8cb7b0e

Please sign in to comment.