diff options
author | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-01-25 14:28:30 +0800 |
commit | 6eb915c129fc90c6f4c82ae097dd6ffad5239efc (patch) | |
tree | 7dd2be50edf41f36b60fac84696e731c13afe617 /Client/Assets/Scripts/LuaEngine/XLua.cs |
+scripts
Diffstat (limited to 'Client/Assets/Scripts/LuaEngine/XLua.cs')
-rw-r--r-- | Client/Assets/Scripts/LuaEngine/XLua.cs | 51 |
1 files changed, 51 insertions, 0 deletions
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
+{
+
+
+
+
+ /// <summary>
+ /// ptc 处理
+ /// </summary>
+ /// <returns></returns>
+ 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);
+ }
+
+
+
+ /// <summary>
+ /// 重载 c#协议
+ /// </summary>
+ 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);
+ }
+
+
+ /// <summary>
+ /// 抓取lua初始化的协议
+ /// </summary>
+ /// <returns></returns>
+ public static object[] FetchRegistID()
+ {
+ LuaScriptMgr mgr = HotfixManager.Instance.GetLuaScriptMgr();
+ mgr.DoFile("LuaNotifyProcess.lua");
+ LuaFunction func = mgr.GetLuaFunction("LuaNotifyProcess.FetchRegistedID");
+ return func.Call();
+ }
+
+
+}
|