Exemple #1
0
        //发送新的lua代码
        public static void SendLuaSciprtSource(string fileName, bool isFilePath)
        {
            if (HttpPushHostingService.GetAsyncSocket().isConnected)
            {
                string luaFullPath = fileName;
                if (!isFilePath)
                {
                    luaFullPath = (G6HotFixConst.LUA_SOURCES_PATH + fileName).Replace('.', '/');
                }

                if (File.Exists(luaFullPath))
                {
                    string luaName = LuaScriptManager.ConvertProjectPathToScriptPath(luaFullPath);
                    var    sendMsg = $"#LuaPush#luaName={luaName}#luaSrc={File.ReadAllText(luaFullPath)}";
                    HttpPushHostingService.GetAsyncSocket().Send(sendMsg);
                }
                else
                {
                    G6Debugger.LogError("lua file does't exist!");
                }
            }
            else
            {
                G6Debugger.LogErrorFormat("PushServer is't connected!");
            }
        }