From f7c95d8216e2eefb50dddf5eaabb709ef1d1203e Mon Sep 17 00:00:00 2001 From: ALEXTANGXIAO <574809918@qq.com> Date: Sat, 29 Jul 2023 00:12:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=8D=E5=8A=A1=E5=99=A8=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E9=98=B2=E5=91=86=E6=8F=90=E7=A4=BA=E9=9C=80=E8=A6=81=E8=BD=AC?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 服务器启动防呆提示需要转表 --- DotNet/Logic/src/Config/ConfigLoader.cs | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/DotNet/Logic/src/Config/ConfigLoader.cs b/DotNet/Logic/src/Config/ConfigLoader.cs index 6cb73946..cb0f9149 100644 --- a/DotNet/Logic/src/Config/ConfigLoader.cs +++ b/DotNet/Logic/src/Config/ConfigLoader.cs @@ -1,3 +1,4 @@ +using System.Diagnostics; using Bright.Serialization; using GameConfig; using TEngine; @@ -35,11 +36,18 @@ public class ConfigLoader:Singleton /// public void Load() { - var tablesCtor = typeof(Tables).GetConstructors()[0]; - var loaderReturnType = tablesCtor.GetParameters()[0].ParameterType.GetGenericArguments()[1]; + try + { + var tablesCtor = typeof(Tables).GetConstructors()[0]; + var loaderReturnType = tablesCtor.GetParameters()[0].ParameterType.GetGenericArguments()[1]; - System.Delegate loader = new System.Func(LoadByteBuf); - _tables = (Tables)tablesCtor.Invoke(new object[] { loader }); + System.Delegate loader = new System.Func(LoadByteBuf); + _tables = (Tables)tablesCtor.Invoke(new object[] { loader }); + } + catch (Exception e) + { + Log.Warning($"找不到游戏配置 启动项目前请运行Luban目录gen_code_bin_to_server.bat."+e.Message); + } }