From 8ad711091f80328d8543ec2e32da2f1ec0be5a68 Mon Sep 17 00:00:00 2001 From: Samuel Williams <33094920+samuelWilliams99@users.noreply.github.com> Date: Sat, 5 Dec 2020 22:43:18 +0000 Subject: [PATCH] Styling fixes + add gitignore --- .gitignore | 44 +++++++++++++++++++ lua/autorun/server/sv_cfc_di_init.lua | 2 +- .../client/cl_api.lua | 4 +- .../client/cl_detached_timer.lua | 4 +- .../client/cl_interface.lua | 3 +- .../client/cl_ponger.lua | 2 +- .../server/sv_pinger.lua | 2 +- 7 files changed, 52 insertions(+), 9 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1592ca1 --- /dev/null +++ b/.gitignore @@ -0,0 +1,44 @@ +# Compiled Lua sources +luac.out + +# Projects +*.sublime-* + +# luarocks build files +*.src.rock +*.zip +*.tar.gz + +# Object files +*.o +*.os +*.ko +*.obj +*.elf + +# Precompiled Headers +*.gch +*.pch + +# Libraries +*.lib +*.a +*.la +*.lo +*.def +*.exp + +# Shared objects (inc. Windows DLLs) +*.dll +*.so +*.so.* +*.dylib + +# Executables +*.exe +*.out +*.app +*.i*86 +*.x86_64 +*.hex + diff --git a/lua/autorun/server/sv_cfc_di_init.lua b/lua/autorun/server/sv_cfc_di_init.lua index 082e45c..1484b14 100644 --- a/lua/autorun/server/sv_cfc_di_init.lua +++ b/lua/autorun/server/sv_cfc_di_init.lua @@ -11,4 +11,4 @@ AddCSLuaFile( "cfc_disconnect_interface/client/cl_detached_timer.lua" ) resource.AddSingleFile( "materials/icons/cross.png" ) -include( "cfc_disconnect_interface/server/sv_pinger.lua" ) \ No newline at end of file +include( "cfc_disconnect_interface/server/sv_pinger.lua" ) diff --git a/lua/cfc_disconnect_interface/client/cl_api.lua b/lua/cfc_disconnect_interface/client/cl_api.lua index d837d79..d487d28 100644 --- a/lua/cfc_disconnect_interface/client/cl_api.lua +++ b/lua/cfc_disconnect_interface/client/cl_api.lua @@ -46,7 +46,7 @@ if DEV_MODE then end -local responses = {cfc = nil, global = nil} -- Does nothing but helps with clarity +local responses = { cfc = nil, global = nil } -- Does nothing but helps with clarity local state = api.INACTIVE @@ -84,7 +84,7 @@ end local function triggerPing() pingCancelled = false state = api.PINGING_API - responses = {cfc = nil, global = nil} + responses = { cfc = nil, global = nil } http.Fetch( cfc_endpoint, function( body, size, headers, code ) diff --git a/lua/cfc_disconnect_interface/client/cl_detached_timer.lua b/lua/cfc_disconnect_interface/client/cl_detached_timer.lua index 7be4559..7caa39e 100644 --- a/lua/cfc_disconnect_interface/client/cl_detached_timer.lua +++ b/lua/cfc_disconnect_interface/client/cl_detached_timer.lua @@ -4,7 +4,7 @@ dTimer.timers = {} dTimer.idCounter = 0 function dTimer.Create( id, delay, reps, f ) - dTimer.timers[id] = {id = id, delay = delay, reps = reps, func = f, lastCall = SysTime()} + dTimer.timers[id] = { id = id, delay = delay, reps = reps, func = f, lastCall = SysTime() } end function dTimer.Adjust( id, delay, reps, f ) @@ -55,4 +55,4 @@ hook.Add( "Think", "cfc_di_detatched_timer", function() curTimer.func() end end -end ) \ No newline at end of file +end ) diff --git a/lua/cfc_disconnect_interface/client/cl_interface.lua b/lua/cfc_disconnect_interface/client/cl_interface.lua index 05f1893..51620fa 100644 --- a/lua/cfc_disconnect_interface/client/cl_interface.lua +++ b/lua/cfc_disconnect_interface/client/cl_interface.lua @@ -53,7 +53,7 @@ disconnectMessages[crashApi.NO_INTERNET] = "Are you sure? If your internet comes -- Helper function local function getFrom( i, ... ) - return ( {...} )[i] + return ( { ... } )[i] end -- Colors @@ -503,4 +503,3 @@ hook.Add( "cfc_di_crashTick", "cfc_di_interfaceUpdate", function( isCrashing, _t end end end ) - diff --git a/lua/cfc_disconnect_interface/client/cl_ponger.lua b/lua/cfc_disconnect_interface/client/cl_ponger.lua index aedf9ca..172bf81 100644 --- a/lua/cfc_disconnect_interface/client/cl_ponger.lua +++ b/lua/cfc_disconnect_interface/client/cl_ponger.lua @@ -30,7 +30,7 @@ hook.Add( "ShutDown", "cfc_di_shutdown", shutdown ) local function crashTick( timedown ) local apiState = crashApi.getState(); if ( apiState == crashApi.INACTIVE ) or -- No ping sent - ( SysTime() - lastApiCall > API_TIMEOUT ) then -- API_TIMEOUT has passed + ( SysTime() - lastApiCall > API_TIMEOUT ) then -- API_TIMEOUT has passed crashApi.triggerPing() lastApiCall = SysTime() diff --git a/lua/cfc_disconnect_interface/server/sv_pinger.lua b/lua/cfc_disconnect_interface/server/sv_pinger.lua index 9c6f86f..eb2161a 100644 --- a/lua/cfc_disconnect_interface/server/sv_pinger.lua +++ b/lua/cfc_disconnect_interface/server/sv_pinger.lua @@ -27,4 +27,4 @@ end ) hook.Add( "ShutDown", "cfc_di", function() net.Start( "cfc_di_shutdown" ) net.Send( players ) -end ) \ No newline at end of file +end )