Skip to content

Commit

Permalink
chore: remove analytics
Browse files Browse the repository at this point in the history
chore: bump glualint
  • Loading branch information
Cherry committed Oct 21, 2023
1 parent 9888c7a commit a21d23c
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 46 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
- name: Download GLuaLint
run: curl -o glualint.zip -L https://github.com/FPtje/GLuaFixer/releases/download/$GLUALINT_VERSION/glualint-$GLUALINT_VERSION-x86_64-linux.zip
env:
GLUALINT_VERSION: 1.24.4
GLUALINT_VERSION: 1.26.0
- name: Unzip GLuaLint
run: unzip glualint.zip
- name: Lint lua files
Expand Down
38 changes: 0 additions & 38 deletions lua/autorun/textscreens_util.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,47 +22,9 @@ if SERVER then
AddCSLuaFile("textscreens_config.lua")
include("textscreens_config.lua")
CreateConVar("sbox_maxtextscreens", "1", {FCVAR_NOTIFY, FCVAR_REPLICATED}, "Determines the maximum number of textscreens users can spawn.")
CreateConVar("ss_call_to_home", 0, {FCVAR_NOTIFY, FCVAR_REPLICATED}, "Determines whether anonymous usage analytics can be sent to the addon author.", 0, 1)

--local rainbow_enabled = cvars.Number('ss_enable_rainbow', 1)

local version = "1.20.1"

local function GetOS()
if system.IsLinux() then return "linux" end
if system.IsWindows() then return "windows" end
if system.IsOSX() then return "osx" end
return "unknown"
end

local submitted = false
local function submitAnalytics()
if GetConVar("ss_call_to_home"):GetInt() ~= 1 or submitted then return end

submitted = true
http.Post("https://jross.me/textscreens/analytics.php", {
["operating_system"] = GetOS(),
["server_dedicated"] = game.IsDedicated() and "true" or "false",
["server_name"] = GetHostName(),
["server_ip"] = util.CRC(game.GetIPAddress()),
["version"] = version
})
end

-- Set ss_call_to_home to 1 to opt-in to anonymous stat tracking
-- These won't be used for anything other than putting a smile on my face :)
hook.Add("Initialize", "CallToHomeSS", function()
timer.Simple(15, function()
submitAnalytics()
end)
end)

cvars.AddChangeCallback("ss_call_to_home", function(convar_name, value_old, value_new)
if value_new == "1" then
submitAnalytics()
end
end)

local function StringRandom(int)
math.randomseed(os.time())
local s = ""
Expand Down
7 changes: 0 additions & 7 deletions lua/weapons/gmod_tool/stools/textscreen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,6 @@ function TOOL.BuildCPanel(CPanel)
Description = "#tool.textscreen.desc"
})

local analytics = vgui.Create("DCheckBoxLabel", CPanel)
analytics:SetText("Anonymous Analytics")
analytics:SetTextColor(Color(0,0,0,255))
analytics:SetConVar("ss_call_to_home")
analytics:SetTooltip("Enabling this will submit anonymous analytics to the author of this addon, including your Operating System, version of the addon, and anonymised IP address.")
CPanel:AddItem(analytics)

local function TrimFontName(fontnum)
return string.Left(textscreenFonts[fontnum], 8) == "Screens_" and string.TrimLeft(textscreenFonts[fontnum], "Screens_") or textscreenFonts[fontnum]
end
Expand Down

0 comments on commit a21d23c

Please sign in to comment.