Skip to content

Commit

Permalink
admin: add some checks, and fix common log spam
Browse files Browse the repository at this point in the history
  • Loading branch information
Dutchman101 authored May 24, 2024
1 parent b1a608b commit 8e3199e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions [admin]/admin/server/admin_server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1457,6 +1457,7 @@ addEventHandler ( "aServer", root, function ( action, data, data2 )
end )

addEventHandler ( "onPlayerChat", root, function ( message )
if not isElement(source) then return end
local size = #chatHistory[source]
if ( size == g_Prefs.maxchatmsgs ) then
table.remove( chatHistory[source], 1 )
Expand Down Expand Up @@ -1547,6 +1548,7 @@ end

addEvent ( "aModdetails", true )
addEventHandler ( "aModdetails", resourceRoot, function ( action, player )
if source ~= resourceRoot then return end
if checkClient( false, client, 'aModdetails', action ) then return end
if ( hasObjectPermissionTo ( client, "general.adminpanel" ) ) then
if ( action == "get" ) then
Expand Down Expand Up @@ -1635,6 +1637,7 @@ addCommandHandler(get("adminChatCommandName"),

addEventHandler('onElementDataChange', root,
function(dataName, oldValue )
if dataName == "superman:flying" or dataName == "hedit:saved" then return end
if getElementType(source)=='player' and checkClient( false, source, 'onElementDataChange', dataName ) then
setElementData( source, dataName, oldValue )
return
Expand Down

0 comments on commit 8e3199e

Please sign in to comment.