From a7f4e71f27b44db86798725af5997defdd3a2e3d Mon Sep 17 00:00:00 2001 From: Deyan Dobromirov Date: Tue, 29 Mar 2016 21:19:16 +0300 Subject: [PATCH] Fixed: GetStatus log variable names Fixed: Initialization order Changed: Default directories now persist in InitAssembly() --- hooks/pre-commit.bat | 2 +- lua/autorun/trackassembly_init.lua | 10 +++------- lua/trackassembly/trackasmlib.lua | 7 +++++++ lua/weapons/gmod_tool/stools/trackassembly.lua | 8 ++++---- 4 files changed, 15 insertions(+), 12 deletions(-) diff --git a/hooks/pre-commit.bat b/hooks/pre-commit.bat index 06fbbd06..ccb4f198 100644 --- a/hooks/pre-commit.bat +++ b/hooks/pre-commit.bat @@ -5,6 +5,6 @@ set LuaPath=%1 set LogFile=%2 echo %BasPath%, %LuaPath% > %LogFile% copy %BasPath%..\lua\autorun\%OutFile% %BasPath%..\lua\autorun\%InpFile% -call %LuaPath%lua.exe %BasPath%pre-commit.lua %BasPath%..\lua\autorun\ %OutFile% UNX E:\Desktop\tst.txt +call %LuaPath%lua.exe %BasPath%pre-commit.lua %BasPath%..\lua\autorun\ %OutFile% UNX D:\Desktop\tmp.txt del %BasPath%..\lua\autorun\tmp.lua exit 0 diff --git a/lua/autorun/trackassembly_init.lua b/lua/autorun/trackassembly_init.lua index 41fc5105..3a819726 100644 --- a/lua/autorun/trackassembly_init.lua +++ b/lua/autorun/trackassembly_init.lua @@ -22,21 +22,17 @@ local duplicatorStoreEntityModifier = duplicator and duplicator.StoreEntityModif local asmlib = trackasmlib ------ CONFIGURE ASMLIB ------ +asmlib.InitAssembly("track","assembly") +asmlib.SetLogControl(0,"") +asmlib.SetOpVar("TOOL_VERSION","5.221") asmlib.SetIndexes("V",1,2,3) asmlib.SetIndexes("A",1,2,3) asmlib.SetIndexes("S",4,5,6,7) -asmlib.InitAssembly("track","assembly") -asmlib.SetOpVar("TOOL_VERSION","5.220") -asmlib.SetOpVar("DIRPATH_BAS",asmlib.GetOpVar("TOOLNAME_NL")..asmlib.GetOpVar("OPSYM_DIRECTORY")) -asmlib.SetOpVar("DIRPATH_EXP","exp"..asmlib.GetOpVar("OPSYM_DIRECTORY")) -asmlib.SetOpVar("DIRPATH_DSV","dsv"..asmlib.GetOpVar("OPSYM_DIRECTORY")) -asmlib.SetOpVar("DIRPATH_LOG","") asmlib.SetOpVar("MAX_MASS",50000) asmlib.SetOpVar("MAX_LINEAR",1000) asmlib.SetOpVar("MAX_ROTATION",360) asmlib.SetOpVar("LOG_ONLY",nil) asmlib.SetOpVar("LOG_SKIP",{"Qsort","ModelToName","GetEntitySpawn: Not hitting active point","CacheQueryPiece: Record not located", "GetEntitySpawn: Trace model missing"}) -asmlib.SetLogControl(0,"") ------ CONFIGURE REPLICATED CVARS ----- Server tells the client what value to use asmlib.MakeCoVar("maxactrad", "150", {1,500} ,bitBor(FCVAR_ARCHIVE, FCVAR_ARCHIVE_XBOX, FCVAR_NOTIFY, FCVAR_REPLICATED, FCVAR_PRINTABLEONLY), "Maximum active radius to search for a point ID") diff --git a/lua/trackassembly/trackasmlib.lua b/lua/trackassembly/trackasmlib.lua index 4f0e9d9d..224ec0ca 100644 --- a/lua/trackassembly/trackasmlib.lua +++ b/lua/trackassembly/trackasmlib.lua @@ -362,6 +362,10 @@ function InitAssembly(sName,sPurpose) SetOpVar("TOOLNAME_NU",stringUpper(GetOpVar("NAME_INIT")..GetOpVar("NAME_PERP"))) SetOpVar("TOOLNAME_PL",GetOpVar("TOOLNAME_NL").."_") SetOpVar("TOOLNAME_PU",GetOpVar("TOOLNAME_NU").."_") + SetOpVar("DIRPATH_BAS",GetOpVar("TOOLNAME_NL")..GetOpVar("OPSYM_DIRECTORY")) + SetOpVar("DIRPATH_EXP","exp"..GetOpVar("OPSYM_DIRECTORY")) + SetOpVar("DIRPATH_DSV","dsv"..GetOpVar("OPSYM_DIRECTORY")) + SetOpVar("DIRPATH_LOG","") SetOpVar("MISS_NOID","N") -- No ID selected SetOpVar("MISS_NOAV","N/A") -- Not Available SetOpVar("MISS_NOMD","X") -- No model @@ -380,6 +384,9 @@ function InitAssembly(sName,sPurpose) SetOpVar("NAV_PROPERTY_NAMES",{}) SetOpVar("NAV_PROPERTY_TYPES",{}) SetOpVar("NAV_PANEL",{}) + SetOpVar("LOG_MAXLOGS",0) + SetOpVar("LOG_CURLOGS",0) + SetOpVar("LOG_LOGFILE","") SetOpVar("STRUCT_SPAWN",{ F = Vector(), R = Vector(), diff --git a/lua/weapons/gmod_tool/stools/trackassembly.lua b/lua/weapons/gmod_tool/stools/trackassembly.lua index 9ddc148f..b644e3bd 100644 --- a/lua/weapons/gmod_tool/stools/trackassembly.lua +++ b/lua/weapons/gmod_tool/stools/trackassembly.lua @@ -329,7 +329,7 @@ end function TOOL:GetStatus(stTrace,anyMessage,hdEnt) local sDelim = "\n" local iCurLog = asmlib.GetOpVar("LOG_CURLOGS") - local iFleLog = asmlib.GetOpVar("LOG_LOGFILE") + local sFleLog = asmlib.GetOpVar("LOG_LOGFILE") local iMaxlog = asmlib.GetOpVar("LOG_MAXLOGS") local sSpace = stringRep(" ",6 + stringLen(tostring(iMaxlog))) local ply = self:GetOwner() @@ -347,9 +347,9 @@ function TOOL:GetStatus(stTrace,anyMessage,hdEnt) local sDu = "" sDu = sDu..tostring(anyMessage)..sDelim sDu = sDu..sSpace.."Dumping logs state:"..sDelim - sDu = sDu..sSpace.." MaxLogs: <"..tostring(iMaxlog)..">"..sDelim - sDu = sDu..sSpace.." CurLogs: <"..tostring(iCurLog)..">"..sDelim - sDu = sDu..sSpace.." iFleLog: <"..tostring(iFleLog)..">"..sDelim + sDu = sDu..sSpace.." LogsMax: <"..tostring(iMaxlog)..">"..sDelim + sDu = sDu..sSpace.." LogsCur: <"..tostring(iCurLog)..">"..sDelim + sDu = sDu..sSpace.." LogFile: <"..tostring(sFleLog)..">"..sDelim sDu = sDu..sSpace.."Dumping player keys:"..sDelim sDu = sDu..sSpace.." Player: "..stringGsub(tostring(ply),"Player%s","")..sDelim sDu = sDu..sSpace.." IN.USE: <"..tostring(plyKeys["USE"])..">"..sDelim