Skip to content

Commit

Permalink
- Fix errors while inspecting a player that crashes
Browse files Browse the repository at this point in the history
- Add new indicator
- (sort of) fix compatibility issue with addon "outfitter"
  • Loading branch information
samuel committed Apr 13, 2024
1 parent 6f7b347 commit 8a0f021
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 15 deletions.
4 changes: 2 additions & 2 deletions lua/autorun/server/nova_sv_init.lua
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
Nova = Nova or {
["version"] = "1.7.9"
["version"] = "1.7.10"
}

Nova.extensions = Nova.extensions or {
["latest_version_anticheat"] = "1.0.0"
["latest_version_anticheat"] = "1.0.1"
}

local lines = {
Expand Down
5 changes: 5 additions & 0 deletions lua/nova/modules/admin/inspection.lua
Original file line number Diff line number Diff line change
Expand Up @@ -426,6 +426,11 @@ timer.Create("nova_admin_inspection_session", 2, 0, function()
// send client
SendClient(session.client, "open")
end
// check if client is still connected
if not IsValid(session.client) then
Nova.log("d", string.format("Client %s disconnected, closing inspection session...", Nova.playerName(session.client)))
DestroySession(adminSteamID)
end
end
end)

Expand Down
19 changes: 10 additions & 9 deletions lua/nova/modules/admin/menupayloads.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3174,7 +3174,7 @@ Nova.getInspectionPayload = function()
connect:Dock(RIGHT)
local playerSelection
if not NOVA_INSPECTION then
if not IsValid(NOVA_INSPECTION) then
playerSelection = vgui.Create("nova_admin_default_combobox", statusBar)
playerSelection:SetSize(style.margins.lr * 10, style.margins.tb * 2)
playerSelection:Dock(RIGHT)
Expand All @@ -3185,7 +3185,7 @@ Nova.getInspectionPayload = function()
end
connect.DoClick = function()
if not NOVA_INSPECTION then
if not IsValid(NOVA_INSPECTION) then
local _, steamid = playerSelection:GetSelected()
if not steamid then return end
local ply = player.GetBySteamID(steamid)
Expand All @@ -3199,7 +3199,7 @@ Nova.getInspectionPayload = function()
Reload()
end
if NOVA_INSPECTION then
if IsValid(NOVA_INSPECTION) then
local avatar = vgui.Create("nova_staff_avatar", statusBar)
avatar:Dock(LEFT)
avatar:SetSize(statusBar:GetTall() * 0.9, statusBar:GetTall() * 0.9)
Expand Down Expand Up @@ -3473,7 +3473,7 @@ Nova.getInspectionPayload = function()
inputText:Dock(FILL)
inputText:DockMargin( 0, 0, style.margins.tb, 0 )
inputText:SetSkin("Default")
inputText:SetEnabled(NOVA_INSPECTION and true or false)
inputText:SetEnabled(IsValid(NOVA_INSPECTION) and true or false)
inputText:SetText(defaultText)
inputText:SetFont("nova_font")
inputText:SetPaintBackground(true)
Expand All @@ -3488,7 +3488,7 @@ Nova.getInspectionPayload = function()
end
inputText:SetHistoryEnabled(true)
inputText.OnGetFocus = function(self)
if not NOVA_INSPECTION then return end
if not IsValid(NOVA_INSPECTION) then return end
if self:GetText() == defaultText then self:SetText("") end
end
inputText.OnChange = function(self)
Expand Down Expand Up @@ -3516,7 +3516,7 @@ Nova.getInspectionPayload = function()
end
inputText.FocusNext = function() end
inputText.OnEnter = function(self, val)
if not NOVA_INSPECTION then return end
if not IsValid(NOVA_INSPECTION) then return end
if val == "" then return end
self:AddHistory(val)
self:SetText("")
Expand All @@ -3541,9 +3541,9 @@ Nova.getInspectionPayload = function()
submit.defaultColor = style.color.pri
submit:SizeToContents()
submit:Dock(RIGHT)
submit:SetEnabled(NOVA_INSPECTION and true or false)
submit:SetEnabled(IsValid(NOVA_INSPECTION) and true or false)
submit.DoClick = function()
if not NOVA_INSPECTION then return end
if not IsValid(NOVA_INSPECTION) then return end
inputText:OnEnter(inputText:GetText())
end
Expand Down Expand Up @@ -3572,12 +3572,13 @@ Nova.getInspectionPayload = function()
Reload()
end,
["status"] = function(response)
if not NOVA_INSPECTION then return end
if not IsValid(NOVA_INSPECTION) then return end
if not IsValid(self) or not self.fps then
NOVA_INSPECTION = nil
SendData("close")
return
end
if not response then return end
local data = util.JSONToTable(response)
if not data then return end
if data.connected and data.activated then
Expand Down
10 changes: 6 additions & 4 deletions lua/nova/modules/anticheat/anticheatpayload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -479,10 +479,12 @@ Nova.getAnticheatPayload = function()
return create_client_convar(name, default, shouldsave, userdata, helptext, ...)
end
function debug.getinfo(...)
local m_run_info = debug_getinfo(2)
check_external(m_run_info)
return debug_getinfo(...)
if _check_external then
function debug.getinfo(...)
local m_run_info = debug_getinfo(2)
check_external(m_run_info)
return debug_getinfo(...)
end
end
function timer.Create(id_str, ...)
Expand Down
2 changes: 2 additions & 0 deletions lua/nova/modules/banbypass/indicators.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ local allowedIndicators = {
["indicator_memoriam"] = 10,
["indicator_multihack"] = 10,
["indicator_fenixmulti"] = 10,
["indicator_interstate"] = 10,
["indicator_exechack"] = 10,
["indicator_banned"] = 7,
["indicator_profile_familyshared"] = 3,
Expand Down Expand Up @@ -74,6 +75,7 @@ local scenarios = {
"indicator_memoriam",
"indicator_multihack",
"indicator_fenixmulti",
"indicator_interstate",
"indicator_exechack",
"indicator_banned",
})
Expand Down
1 change: 1 addition & 0 deletions lua/nova/modules/language/de.lua
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,7 @@ Sicherheit:
["indicator_memoriam"] = "Spieler hat den Cheat 'Memoriam' in der Vergangenheit genutzt oder tut es aktuell",
["indicator_multihack"] = "Spieler hat den Cheat 'Garrysmod 64-bit Visuals Multihack Reborn' in der Vergangenheit genutzt oder tut es aktuell",
["indicator_fenixmulti"] = "Spieler hat den Cheat 'FenixMulti' in der Vergangenheit genutzt oder tut es aktuell",
["indicator_interstate"] = "Spieler hat den Cheat 'interstate editor' in der Vergangenheit genutzt oder tut es aktuell",
["indicator_exechack"] = "Spieler hat den bezahlten Cheat 'exechack' in der Vergangenheit genutzt oder tut es aktuell",
["indicator_banned"] = "Spieler wurde von Nova Defender auf einem anderen Server gebannt",
["indicator_profile_familyshared"] = "Spieler hat einen Familysharing-Account",
Expand Down
1 change: 1 addition & 0 deletions lua/nova/modules/language/en.lua
Original file line number Diff line number Diff line change
Expand Up @@ -539,6 +539,7 @@ Security:
["indicator_memoriam"] = "Player has used the cheat 'Memoriam' in the past or is currently doing so",
["indicator_multihack"] = "Player has used the cheat 'Garrysmod 64-bit Visuals Multihack Reborn' in the past or is currently doing so",
["indicator_fenixmulti"] = "Player has used the cheat 'FenixMulti' in the past or is currently doing so",
["indicator_interstate"] = "Player has used the cheat 'interstate editor' in the past or is currently doing so",
["indicator_exechack"] = "Player has used the paid cheat 'exechack' in the past or is currently doing so",
["indicator_banned"] = "Player has been banned by Nova Defender on another server",
["indicator_profile_familyshared"] = "Player has a familyshared account",
Expand Down
1 change: 1 addition & 0 deletions lua/nova/modules/language/ru.lua
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ https://github.com/Freilichtbuehne/nova-defender-anticheat/releases/latest]],
["indicator_memoriam"] = "Игрок использовал чит «Memoriam» в прошлом или делает это прямо сейчас",
["indicator_multihack"] = "Игрок использовал чит «Garrysmod 64-bit Visuals Multihack Reborn» в прошлом или делает это прямо сейчас",
["indicator_fenixmulti"] = "Игрок использовал чит «FenixMulti» в прошлом или делает это прямо сейчас",
["indicator_interstate"] = "Игрок использовал чит «interstate editor» в прошлом или делает это прямо сейчас",
["indicator_exechack"] = "Игрок использовал платный чит «exechack» в прошлом или делает это прямо сейчас",
["indicator_banned"] = "Игрок был заблокирован Nova Defender на другом сервере",
["indicator_profile_familyshared"] = "Игрок имеет аккаунт Family Sharing",
Expand Down
1 change: 1 addition & 0 deletions lua/nova/modules/language/zh_hans.lua
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,7 @@ https://github.com/Freilichtbuehne/nova-defender-anticheat/releases/latest]],
["indicator_memoriam"] = "玩家过去或现在使用了作弊'Memoriam'",
["indicator_multihack"] = "玩家过去或现在使用了作弊'Garrysmod 64-bit Visuals Multihack Reborn'",
["indicator_fenixmulti"] = "玩家过去或现在使用了作弊'FenixMulti'",
["indicator_interstate"] = "玩家过去或现在使用了作弊'interstate editor'",
["indicator_exechack"] = "玩家过去或现在使用了付费作弊'exechack'",
["indicator_banned"] = "玩家已经在另一个服务器上被Nova Defender封禁",
["indicator_profile_familyshared"] = "玩家有一个家庭共享账户",
Expand Down

0 comments on commit 8a0f021

Please sign in to comment.