From 6eb915c129fc90c6f4c82ae097dd6ffad5239efc Mon Sep 17 00:00:00 2001 From: chai Date: Mon, 25 Jan 2021 14:28:30 +0800 Subject: +scripts --- Client/Assets/Scripts/LuaEngine/XLua.cs | 51 +++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Client/Assets/Scripts/LuaEngine/XLua.cs (limited to 'Client/Assets/Scripts/LuaEngine/XLua.cs') diff --git a/Client/Assets/Scripts/LuaEngine/XLua.cs b/Client/Assets/Scripts/LuaEngine/XLua.cs new file mode 100644 index 00000000..59e33224 --- /dev/null +++ b/Client/Assets/Scripts/LuaEngine/XLua.cs @@ -0,0 +1,51 @@ +using UnityEngine; +using System.Collections.Generic; +using LuaInterface; +using System; + +public class XLua +{ + + + + + /// + /// ptc 处理 + /// + /// + public static void NotifyRoute(uint _type, byte[] bytes, int length) + { + LuaScriptMgr mgr = HotfixManager.Instance.GetLuaScriptMgr(); + mgr.DoFile("LuaNotifyProcess.lua"); + LuaFunction func = mgr.GetLuaFunction("LuaNotifyProcess.Process"); + func.Call(_type, Hotfix.LuaProtoBuffer(bytes, length), length); + } + + + + /// + /// 重载 c#协议 + /// + public static void OverideNet(uint _type,byte[] bytes,int length) + { + LuaScriptMgr mgr = HotfixManager.Instance.GetLuaScriptMgr(); + mgr.DoFile("LuaNotifyProcess.lua"); + LuaFunction func = mgr.GetLuaFunction("LuaNotifyProcess.ProcessOveride"); + func.Call(_type, Hotfix.LuaProtoBuffer(bytes, length), length); + } + + + /// + /// 抓取lua初始化的协议 + /// + /// + public static object[] FetchRegistID() + { + LuaScriptMgr mgr = HotfixManager.Instance.GetLuaScriptMgr(); + mgr.DoFile("LuaNotifyProcess.lua"); + LuaFunction func = mgr.GetLuaFunction("LuaNotifyProcess.FetchRegistedID"); + return func.Call(); + } + + +} -- cgit v1.1-26-g67d0