Skip to content

Commit b0aea3e

Browse files
committed
Linting
1 parent 695cd92 commit b0aea3e

File tree

3 files changed

+4
-24
lines changed

3 files changed

+4
-24
lines changed

gamemode/core/libraries/keybind.lua

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -203,13 +203,11 @@ hook.Add("PlayerButtonDown", "liaKeybindPress", function(p, b)
203203
local data = lia.keybind.stored[action]
204204
if not data.shouldRun or data.shouldRun(p) then
205205
if data.serverOnly then
206-
-- Server-side execution - network the call
207206
net.Start("liaKeybindServer")
208207
net.WriteString(action)
209208
net.WriteEntity(p)
210209
net.SendToServer()
211210
else
212-
-- Client-side execution
213211
data.callback(p)
214212
end
215213
end
@@ -223,13 +221,11 @@ hook.Add("PlayerButtonUp", "liaKeybindRelease", function(p, b)
223221
local data = lia.keybind.stored[action]
224222
if not data.shouldRun or data.shouldRun(p) then
225223
if data.serverOnly then
226-
-- Server-side execution - network the release call
227224
net.Start("liaKeybindServer")
228225
net.WriteString(action .. "_release")
229226
net.WriteEntity(p)
230227
net.SendToServer()
231228
else
232-
-- Client-side execution
233229
data.release(p)
234230
end
235231
end
@@ -383,13 +379,12 @@ lia.keybind.add(KEY_NONE, "adminMode", {
383379
if client:isStaffOnDuty() then
384380
local oldCharID = client:getNetVar("OldCharID", 0)
385381
if oldCharID > 0 then
386-
-- Restore original position when switching back to non-staff character
387382
local originalPos = client:getNetVar("OriginalPosition")
388383
if originalPos then
389384
client:SetPos(originalPos)
390385
client:setNetVar("OriginalPosition", nil)
391386
end
392-
387+
393388
net.Start("AdminModeSwapCharacter")
394389
net.WriteInt(oldCharID, 32)
395390
net.Send(client)
@@ -399,12 +394,8 @@ lia.keybind.add(KEY_NONE, "adminMode", {
399394
client:notifyLocalized("noPrevChar")
400395
end
401396
else
402-
-- Save original position when switching to staff mode
403397
local currentChar = client:getChar()
404-
if currentChar and currentChar:getFaction() ~= "staff" then
405-
client:setNetVar("OriginalPosition", client:GetPos())
406-
end
407-
398+
if currentChar and currentChar:getFaction() ~= "staff" then client:setNetVar("OriginalPosition", client:GetPos()) end
408399
lia.db.query(string.format("SELECT * FROM lia_characters WHERE steamID = \"%s\"", lia.db.escape(steamID)), function(data)
409400
for _, row in ipairs(data) do
410401
local id = tonumber(row.id)

gamemode/core/netcalls/server.lua

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,30 +25,20 @@ net.Receive("liaKeybindServer", function(len, ply)
2525
if not IsValid(ply) then return end
2626
local action = net.ReadString()
2727
local player = net.ReadEntity()
28-
-- Verify the player is valid and the action exists
2928
if not IsValid(player) or player ~= ply then return end
3029
if not lia.keybind.stored[action] then return end
3130
local data = lia.keybind.stored[action]
32-
-- Check if this is a release action
3331
local isRelease = action:find("_release$")
3432
local baseAction = action:gsub("_release$", "")
3533
if isRelease then
36-
-- Handle release action
3734
if data.release and data.serverOnly then
3835
local success, err = pcall(data.release, player)
39-
if not success then
40-
-- Log error on server
41-
print("Keybind release error for " .. tostring(player) .. ": " .. tostring(err))
42-
end
36+
if not success then print("Keybind release error for " .. tostring(player) .. ": " .. tostring(err)) end
4337
end
4438
else
45-
-- Handle press action
4639
if data.callback and data.serverOnly then
4740
local success, err = pcall(data.callback, player)
48-
if not success then
49-
-- Log error on server
50-
print("Keybind press error for " .. tostring(player) .. ": " .. tostring(err))
51-
end
41+
if not success then print("Keybind press error for " .. tostring(player) .. ": " .. tostring(err)) end
5242
end
5343
end
5444
end)

gamemode/init.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
local networkStrings = {"liaKeybindServer", "AdminModeSwapCharacter", "AnimationStatus", "ArgumentsRequest", "BinaryQuestionRequest", "ButtonRequest", "ChangeAttribute", "CharacterInfo", "CheckHack", "CheckSeed", "CurTime-Sync", "CurTimeSync", "DisplayCharList", "ForceUpdateF1", "KickCharacter", "LIA_BigTable_Ack", "NetStreamDS", "OpenInvMenu", "OptionsRequest", "RegenChat", "RequestDropdown", "RequestFactionRoster", "RequestRemoveWarning", "RunAction", "RunOption", "SendTableUI", "ServerChatAddText", "SpawnMenuGiveItem", "SpawnMenuSpawnItem", "StringRequest", "TicketSystem", "TicketSystemClaim", "TicketSystemClose", "TransferMoneyFromP2P", "VendorAllowClass", "VendorAllowFaction", "VendorEdit", "VendorExit", "VendorFaction", "VendorMaxStock", "VendorMode", "VendorMoney", "VendorOpen", "VendorPrice", "VendorStock", "VendorSync", "VendorTrade", "VerifyCheats", "VerifyCheatsResponse", "ViewClaims", "WorkshopDownloader_Info", "WorkshopDownloader_Request", "WorkshopDownloader_Start", "actBar", "attrib", "blindFade", "blindTarget", "cMsg", "cfgList", "cfgSet", "charInfo", "charKick", "charSet", "charVar", "classUpdate", "cmd", "doorMenu", "doorPerm", "gVar", "invAct", "invData", "invQuantity", "item", "liaActiveTickets", "liaAllFlags", "liaAllPKs", "liaAllPlayers", "liaAllWarnings", "liaCharChoose", "liaCharCreate", "liaCharDelete", "liaCharFetchNames", "liaCharList", "liaCharRequest", "liaCharacterData", "liaCharacterInvList", "liaCmdArgPrompt", "liaDBTableData", "liaDBTables", "liaData", "liaDataSync", "liaDatabaseViewData", "liaFactionRosterData", "liaFullCharList", "liaGroupPermChanged", "liaGroupsAdd", "liaGroupsRemove", "liaGroupsRename", "liaGroupsRequest", "liaGroupsSetPerm", "liaInventoryAdd", "liaInventoryData", "liaInventoryDelete", "liaInventoryInit", "liaInventoryRemove", "liaItemDelete", "liaItemInspect", "liaItemInstance", "liaModifyFlags", "liaNotify", "liaNotifyL", "liaPACPartAdd", "liaPACPartRemove", "liaPACPartReset", "liaPACSync", "liaPKsCount", "liaPlayerCharacters", "liaRequestActiveTickets", "liaRequestAllFlags", "liaRequestAllPKs", "liaRequestAllWarnings", "liaRequestDatabaseView", "liaRequestFactionRoster", "liaRequestFullCharList", "liaRequestPKsCount", "liaRequestPlayerCharacters", "liaRequestPlayers", "liaRequestStaffSummary", "liaRequestTableData", "liaRequestTicketsCount", "liaRequestWarningsCount", "liaStaffDiscordPrompt", "liaStaffDiscordResponse", "liaStaffSummary", "liaStorageExit", "liaStorageOpen", "liaStorageTransfer", "liaStorageUnlock", "liaTicketsCount", "liaTransferItem", "liaRestoreOverflowItems", "liaWarningsCount", "lia_managesitrooms_action", "managesitrooms", "msg", "nDel", "nLcl", "nVar", "playerLoadedChar", "postPlayerLoadedChar", "prePlayerLoadedChar", "removeF1", "request_respawn", "rgnDone", "send_logs", "send_logs_request", "seqSet", "setWaypoint", "setWaypointWithLogo", "trunkInitStorage", "updateAdminGroups", "updateAdminPrivileges", "liaProvideServerPassword"}
21
DeriveGamemode("sandbox")
32
AddCSLuaFile("cl_init.lua")
43
AddCSLuaFile("shared.lua")

0 commit comments

Comments
 (0)