@@ -4,6 +4,7 @@ using Lagrange.Core;
|
|||||||
using Lagrange.Core.Common;
|
using Lagrange.Core.Common;
|
||||||
using Lagrange.Core.Common.Interface;
|
using Lagrange.Core.Common.Interface;
|
||||||
using Lagrange.Core.Common.Interface.Api;
|
using Lagrange.Core.Common.Interface.Api;
|
||||||
|
using Lagrange.Core.Event.EventArg;
|
||||||
using Shrink.Utility;
|
using Shrink.Utility;
|
||||||
using Console = System.Console;
|
using Console = System.Console;
|
||||||
|
|
||||||
@@ -19,7 +20,6 @@ public class QrCode
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
// 双重检查锁定
|
|
||||||
if (_instance != null) return _instance;
|
if (_instance != null) return _instance;
|
||||||
lock (Lock)
|
lock (Lock)
|
||||||
{
|
{
|
||||||
|
|||||||
21
Program.cs
21
Program.cs
@@ -1,6 +1,6 @@
|
|||||||
using Grpc.Net.Client;
|
using Debugger;
|
||||||
using Mono.Cecil;
|
using Grpc.Core;
|
||||||
using Mono.Cecil.Cil;
|
using Shrink.API;
|
||||||
using Shrink.Command;
|
using Shrink.Command;
|
||||||
using Shrink.Login;
|
using Shrink.Login;
|
||||||
|
|
||||||
@@ -16,12 +16,22 @@ public static class Program
|
|||||||
var newUrl = "自己找";
|
var newUrl = "自己找";
|
||||||
|
|
||||||
ModifyAssembly(originalAssemblyPath, tempAssemblyPath, oldUrl, newUrl);*/
|
ModifyAssembly(originalAssemblyPath, tempAssemblyPath, oldUrl, newUrl);*/
|
||||||
|
const int port = 50051;
|
||||||
|
|
||||||
|
var server = new Server
|
||||||
|
{
|
||||||
|
Services = { BotService.BindService(new BotServiceImpl()) },
|
||||||
|
Ports = { new ServerPort("localhost", port, ServerCredentials.Insecure) }
|
||||||
|
};
|
||||||
|
|
||||||
|
server.Start();
|
||||||
|
|
||||||
|
Console.WriteLine($"gRPC server listening on port {port}");
|
||||||
|
|
||||||
await QrCode.Instance.Login();
|
await QrCode.Instance.Login();
|
||||||
await Commands.Instance.Init();
|
await Commands.Instance.Init();
|
||||||
await Commands.Instance.Run();
|
await Commands.Instance.Run();
|
||||||
|
//await server.ShutdownAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
/*private static void ModifyAssembly(string originalAssemblyPath, string tempAssemblyPath, string oldUrl, string newUrl)
|
/*private static void ModifyAssembly(string originalAssemblyPath, string tempAssemblyPath, string oldUrl, string newUrl)
|
||||||
{
|
{
|
||||||
@@ -58,5 +68,4 @@ public static class Program
|
|||||||
assembly.Write(tempAssemblyPath);
|
assembly.Write(tempAssemblyPath);
|
||||||
Console.WriteLine($"已将修改后的程序集保存在{tempAssemblyPath}");
|
Console.WriteLine($"已将修改后的程序集保存在{tempAssemblyPath}");
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user