From 8e3199e6a8c0d21ebe5c7ff5cbb066515e58266a Mon Sep 17 00:00:00 2001 From: Dutchman101 <12105539+Dutchman101@users.noreply.github.com> Date: Fri, 24 May 2024 19:14:30 +0000 Subject: [PATCH] admin: add some checks, and fix common log spam --- [admin]/admin/server/admin_server.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/[admin]/admin/server/admin_server.lua b/[admin]/admin/server/admin_server.lua index 8521e6295..d111c4756 100644 --- a/[admin]/admin/server/admin_server.lua +++ b/[admin]/admin/server/admin_server.lua @@ -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 ) @@ -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 @@ -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