From d2c2334ac80c98422f4affdfeb37d9dd6a6f129f Mon Sep 17 00:00:00 2001 From: sin365 <353374337@qq.com> Date: Mon, 22 Jan 2024 11:57:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NoSugarNet.ClientCore/App.cs | 33 ------------------- NoSugarNet.ServerCore/Manager/LoginManager.cs | 9 +++++ .../NoSugarNet.ServerCore.csproj | 5 ++- NoSugarNet.sln | 26 +++++++++++++++ 4 files changed, 39 insertions(+), 34 deletions(-) delete mode 100644 NoSugarNet.ClientCore/App.cs diff --git a/NoSugarNet.ClientCore/App.cs b/NoSugarNet.ClientCore/App.cs deleted file mode 100644 index 8980450..0000000 --- a/NoSugarNet.ClientCore/App.cs +++ /dev/null @@ -1,33 +0,0 @@ -using NoSugarNet.ClientCore.Manager; -using NoSugarNet.ClientCore.Network; -using ServerCore.Manager; - -namespace NoSugarNet.ClientCore -{ - public class App - { - public static string TokenStr; - public static long RID = -1; - public static string IP; - public static int Port; - public static LogManager log; - public static NetworkHelper networkHelper; - public static AppLogin login; - public static AppChat chat; - public static AppLocalClient local; - public static UserDataManager user; - - public static void Init(string IP, int port) - { - log = new LogManager(); - networkHelper = new NetworkHelper(); - login = new AppLogin(); - chat = new AppChat(); - local = new AppLocalClient(); - user = new UserDataManager(); - networkHelper.Init(IP, port); - } - } - - -} \ No newline at end of file diff --git a/NoSugarNet.ServerCore/Manager/LoginManager.cs b/NoSugarNet.ServerCore/Manager/LoginManager.cs index 05d39b8..c5501ee 100644 --- a/NoSugarNet.ServerCore/Manager/LoginManager.cs +++ b/NoSugarNet.ServerCore/Manager/LoginManager.cs @@ -27,6 +27,15 @@ namespace ServerCore.Manager }); ServerManager.g_ClientMgr.ClientSend(cinfo, (int)CommandID.CmdLogin, (int)ErrorCode.ErrorOk, respData); + + Protobuf_Cfgs cfgsSP = new Protobuf_Cfgs(); + cfgsSP.Cfgs.Add(new Protobuf_Cfgs_Single { TunnelID = 0, IP = "127.0.0.1", Port = 10001 }); + cfgsSP.Cfgs.Add(new Protobuf_Cfgs_Single { TunnelID = 1, IP = "127.0.0.1", Port = 10002 }); + cfgsSP.Cfgs.Add(new Protobuf_Cfgs_Single { TunnelID = 2, IP = "127.0.0.1", Port = 10003 }); + cfgsSP.Cfgs.Add(new Protobuf_Cfgs_Single { TunnelID = 3, IP = "127.0.0.1", Port = 10004 }); + + byte[] respDataCfg = ProtoBufHelper.Serizlize(cfgsSP); + ServerManager.g_ClientMgr.ClientSend(cinfo, (int)CommandID.CmdCfgs, (int)ErrorCode.ErrorOk, respDataCfg); } } } \ No newline at end of file diff --git a/NoSugarNet.ServerCore/NoSugarNet.ServerCore.csproj b/NoSugarNet.ServerCore/NoSugarNet.ServerCore.csproj index 9e5bc6c..4cc33e2 100644 --- a/NoSugarNet.ServerCore/NoSugarNet.ServerCore.csproj +++ b/NoSugarNet.ServerCore/NoSugarNet.ServerCore.csproj @@ -1,4 +1,4 @@ - + net7.0 @@ -10,6 +10,9 @@ ..\Lib\Google.Protobuf.dll + + ..\Lib\HaoYueNet.ClientNetwork.dll + ..\Lib\HaoYueNet.ServerNetwork.dll diff --git a/NoSugarNet.sln b/NoSugarNet.sln index c65b196..708ff58 100644 --- a/NoSugarNet.sln +++ b/NoSugarNet.sln @@ -5,11 +5,21 @@ VisualStudioVersion = 17.7.34031.279 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Lib", "Lib", "{EDA9D3FD-1A72-434D-81F6-B1B420406D20}" ProjectSection(SolutionItems) = preProject + Lib\Google.Protobuf.dll = Lib\Google.Protobuf.dll + Lib\HaoYueNet.ClientNetwork.dll = Lib\HaoYueNet.ClientNetwork.dll Lib\HaoYueNet.ServerNetwork.dll = Lib\HaoYueNet.ServerNetwork.dll EndProjectSection EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NoSugarNet.ServerCore", "NoSugarNet.ServerCore\NoSugarNet.ServerCore.csproj", "{25FB6F12-4619-4D2C-8FC1-70AAAA8AD100}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NoSugarNet.ClientCore", "NoSugarNet.ClientCore\NoSugarNet.ClientCore.csproj", "{80AF9D64-681C-4B6F-B2FF-5DD847186749}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Sample", "Sample", "{5E65F25A-8B59-4FC7-8582-C6887C3CD0A1}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NoSugarNet.ClientCli", "Sample\NoSugarNet.ClientCli\NoSugarNet.ClientCli.csproj", "{29D76CF3-BF7E-45A5-9957-2CBC0A41B6FB}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NoSugarNet.ServerCli", "Sample\NoSugarNet.ServerCli\NoSugarNet.ServerCli.csproj", "{65220036-9A81-49FA-A5BC-DA06783D2E52}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -20,10 +30,26 @@ Global {25FB6F12-4619-4D2C-8FC1-70AAAA8AD100}.Debug|Any CPU.Build.0 = Debug|Any CPU {25FB6F12-4619-4D2C-8FC1-70AAAA8AD100}.Release|Any CPU.ActiveCfg = Release|Any CPU {25FB6F12-4619-4D2C-8FC1-70AAAA8AD100}.Release|Any CPU.Build.0 = Release|Any CPU + {80AF9D64-681C-4B6F-B2FF-5DD847186749}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {80AF9D64-681C-4B6F-B2FF-5DD847186749}.Debug|Any CPU.Build.0 = Debug|Any CPU + {80AF9D64-681C-4B6F-B2FF-5DD847186749}.Release|Any CPU.ActiveCfg = Release|Any CPU + {80AF9D64-681C-4B6F-B2FF-5DD847186749}.Release|Any CPU.Build.0 = Release|Any CPU + {29D76CF3-BF7E-45A5-9957-2CBC0A41B6FB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {29D76CF3-BF7E-45A5-9957-2CBC0A41B6FB}.Debug|Any CPU.Build.0 = Debug|Any CPU + {29D76CF3-BF7E-45A5-9957-2CBC0A41B6FB}.Release|Any CPU.ActiveCfg = Release|Any CPU + {29D76CF3-BF7E-45A5-9957-2CBC0A41B6FB}.Release|Any CPU.Build.0 = Release|Any CPU + {65220036-9A81-49FA-A5BC-DA06783D2E52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65220036-9A81-49FA-A5BC-DA06783D2E52}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65220036-9A81-49FA-A5BC-DA06783D2E52}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65220036-9A81-49FA-A5BC-DA06783D2E52}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(NestedProjects) = preSolution + {29D76CF3-BF7E-45A5-9957-2CBC0A41B6FB} = {5E65F25A-8B59-4FC7-8582-C6887C3CD0A1} + {65220036-9A81-49FA-A5BC-DA06783D2E52} = {5E65F25A-8B59-4FC7-8582-C6887C3CD0A1} + EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {637DC2BB-F9BB-41A2-ADC0-B41B871F66DE} EndGlobalSection