Skip to content

Commit ef40a51

Browse files
authored
Merge branch 'master' into update-default-maps-physics
2 parents d30ac76 + 1735a38 commit ef40a51

File tree

14 files changed

+88
-55
lines changed

14 files changed

+88
-55
lines changed

[admin]/admin/conf/ACL.xml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,12 @@
2929
<right name="command.setmoney" access="true" />
3030
<right name="command.setskin" access="true" />
3131
<right name="command.setteam" access="true" />
32+
<right name="command.removefromteam" access="true" />
3233
<right name="command.giveweapon" access="true" />
3334
<right name="command.setstat" access="true" />
3435
<right name="command.jetpack" access="true" />
3536
<right name="command.warp" access="true" />
37+
<right name="command.warpto" access="true" />
3638
<right name="command.setdimension" access="true" />
3739
<right name="command.setinterior" access="true" />
3840
<!--Teams related-->
@@ -45,7 +47,9 @@
4547
<right name="command.destroyvehicle" access="true" />
4648
<right name="command.customize" access="true" />
4749
<right name="command.setcolor" access="true" />
50+
<right name="command.setlights" access="true" />
4851
<right name="command.setpaintjob" access="true" />
52+
<right name="command.setplates" access="true" />
4953
<!--Messages related-->
5054
<right name="command.listmessages" access="true" />
5155
<right name="command.readmessage" access="true" />
@@ -116,10 +120,12 @@
116120
<right name="command.setmoney" access="true" />
117121
<right name="command.setskin" access="true" />
118122
<right name="command.setteam" access="true" />
123+
<right name="command.removefromteam" access="true" />
119124
<right name="command.giveweapon" access="true" />
120125
<right name="command.setstat" access="true" />
121126
<right name="command.jetpack" access="true" />
122127
<right name="command.warp" access="true" />
128+
<right name="command.warpto" access="true" />
123129
<right name="command.setdimension" access="true" />
124130
<right name="command.setinterior" access="true" />
125131
<!--Teams related-->
@@ -132,7 +138,9 @@
132138
<right name="command.destroyvehicle" access="true" />
133139
<right name="command.customize" access="true" />
134140
<right name="command.setcolor" access="true" />
141+
<right name="command.setlights" access="true" />
135142
<right name="command.setpaintjob" access="true" />
143+
<right name="command.setplates" access="true" />
136144
<!--Messages related-->
137145
<right name="command.listmessages" access="true" />
138146
<right name="command.readmessage" access="true" />
@@ -202,10 +210,12 @@
202210
<right name="command.setmoney" access="false" />
203211
<right name="command.setskin" access="true" />
204212
<right name="command.setteam" access="true" />
213+
<right name="command.removefromteam" access="true" />
205214
<right name="command.giveweapon" access="true" />
206215
<right name="command.setstat" access="true" />
207216
<right name="command.jetpack" access="true" />
208217
<right name="command.warp" access="true" />
218+
<right name="command.warpto" access="true" />
209219
<right name="command.setdimension" access="true" />
210220
<right name="command.setinterior" access="true" />
211221
<!--Teams related-->
@@ -218,7 +228,9 @@
218228
<right name="command.destroyvehicle" access="true" />
219229
<right name="command.customize" access="true" />
220230
<right name="command.setcolor" access="true" />
231+
<right name="command.setlights" access="true" />
221232
<right name="command.setpaintjob" access="true" />
233+
<right name="command.setplates" access="true" />
222234
<!--Messages related-->
223235
<right name="command.listmessages" access="true" />
224236
<right name="command.readmessage" access="true" />
@@ -288,10 +300,12 @@
288300
<right name="command.setmoney" access="false" />
289301
<right name="command.setskin" access="false" />
290302
<right name="command.setteam" access="false" />
303+
<right name="command.removefromteam" access="false" />
291304
<right name="command.giveweapon" access="false" />
292305
<right name="command.setstat" access="false" />
293306
<right name="command.jetpack" access="false" />
294307
<right name="command.warp" access="false" />
308+
<right name="command.warpto" access="false" />
295309
<right name="command.setdimension" access="false" />
296310
<right name="command.setinterior" access="false" />
297311
<!--Teams related-->
@@ -304,7 +318,9 @@
304318
<right name="command.destroyvehicle" access="false" />
305319
<right name="command.customize" access="false" />
306320
<right name="command.setcolor" access="false" />
321+
<right name="command.setlights" access="false" />
307322
<right name="command.setpaintjob" access="false" />
323+
<right name="command.setplates" access="false" />
308324
<!--Messages related-->
309325
<right name="command.listmessages" access="false" />
310326
<right name="command.readmessage" access="false" />
@@ -351,4 +367,4 @@
351367
<right name="command.viewscreenshot" access="false" />
352368
<right name="command.listscreenshots" access="false" />
353369
</acl>
354-
</ACL>
370+
</ACL>

[admin]/admin/server/admin_commands.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ end
5858
function aCommand ( admin, command, ... )
5959
local call = _commands[command]
6060
if ( call ) then
61-
if ( hasObjectPermissionTo ( admin, "command."..call.action ) ) then
61+
if ( hasObjectPermissionTo ( admin, "command."..call.action, false ) ) then
6262
local arg, errormsg = aCommandToArgs ( { ... }, call.args )
6363
if not errormsg then
6464
if ( call.type == "player" ) then triggerEvent ( "aPlayer", admin, arg[1], call.action, arg[2], arg[3], arg[4] )

[admin]/admin/server/admin_screenshot.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ addEventHandler("aScreenShot",root,
4242
if not isElement(admin) then return end
4343
if not action then return end
4444
local right = rights[action]
45-
if not right or not hasObjectPermissionTo(admin,"command."..right) then return end
45+
if not right or not hasObjectPermissionTo(admin,"command."..right, false) then return end
4646
if action == "new" then
4747
if not isElement(player) then return end
4848
if screenshots[player] then

[admin]/admin/server/admin_server.lua

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ function aHandleIP2CUpdate()
5353

5454
for playerID = 1, #playersTable do
5555
local playerElement = playersTable[playerID]
56-
local hasAdminPermission = hasObjectPermissionTo(playerElement, "general.adminpanel")
56+
local hasAdminPermission = hasObjectPermissionTo(playerElement, "general.adminpanel", false)
5757

5858
if hasAdminPermission then
5959

@@ -89,7 +89,7 @@ addEventHandler ( "onResourceStart", root, function ( resource )
8989
if ( resource ~= getThisResource() ) then
9090
local resourceName = getResourceName(resource)
9191
for id, player in ipairs(getElementsByType("player")) do
92-
if ( hasObjectPermissionTo ( player, "general.tab_resources" ) ) then
92+
if ( hasObjectPermissionTo ( player, "general.tab_resources", false ) ) then
9393
triggerClientEvent ( player, "aClientResourceStart", root, resourceName )
9494
end
9595
end
@@ -107,7 +107,7 @@ addEventHandler ( "onResourceStart", root, function ( resource )
107107
aSetupCommands()
108108
for id, player in ipairs ( getElementsByType ( "player" ) ) do
109109
aPlayerInitialize ( player )
110-
if ( hasObjectPermissionTo ( player, "general.adminpanel" ) ) then
110+
if ( hasObjectPermissionTo ( player, "general.adminpanel", false ) ) then
111111
notifyPlayerLoggedIn(player)
112112
end
113113
end
@@ -257,7 +257,7 @@ addEventHandler ( "onResourceStop", root, function ( resource )
257257
if ( resource ~= getThisResource() ) then
258258
local resourceName = getResourceName(resource)
259259
for id, player in ipairs(getElementsByType("player")) do
260-
if ( hasObjectPermissionTo ( player, "general.tab_resources" ) ) then
260+
if ( hasObjectPermissionTo ( player, "general.tab_resources", false ) ) then
261261
triggerClientEvent ( player, "aClientResourceStop", root, resourceName )
262262
end
263263
end
@@ -431,8 +431,8 @@ addEventHandler ( "onPlayerJoin", root, function ()
431431
end
432432
aPlayerInitialize ( source )
433433
for id, player in ipairs(getElementsByType("player")) do
434-
if ( hasObjectPermissionTo ( player, "general.adminpanel" ) ) then
435-
triggerClientEvent ( player, "aClientPlayerJoin", source, getPlayerIP ( source ), getPlayerAccountName ( source ), getPlayerSerial ( source ), hasObjectPermissionTo ( source, "general.adminpanel" ), aPlayers[source]["country"] )
434+
if ( hasObjectPermissionTo ( player, "general.adminpanel", false ) ) then
435+
triggerClientEvent ( player, "aClientPlayerJoin", source, getPlayerIP ( source ), getPlayerAccountName ( source ), getPlayerSerial ( source ), hasObjectPermissionTo ( source, "general.adminpanel", false ), aPlayers[source]["country"] )
436436
end
437437
end
438438
setPedGravity ( source, getGravity() )
@@ -512,7 +512,7 @@ function aPlayerSerialCheck ( player, result )
512512
end
513513

514514
addEventHandler ( "onPlayerLogin", root, function ( previous, account, auto )
515-
if ( hasObjectPermissionTo ( source, "general.adminpanel" ) ) then
515+
if ( hasObjectPermissionTo ( source, "general.adminpanel", false ) ) then
516516
triggerEvent ( "aPermissions", source )
517517
notifyPlayerLoggedIn( source )
518518
end
@@ -545,7 +545,7 @@ end )
545545
addCommandHandler ( "unregister", function ( player, command, arg1 )
546546
local username = arg1 or ""
547547
local result = "failed - No permission"
548-
if ( hasObjectPermissionTo ( player, "function.removeAccount" ) ) then
548+
if ( hasObjectPermissionTo ( player, "function.removeAccount", false ) ) then
549549
local account = getAccount ( username )
550550
if not account then
551551
result = "failed - Does not exist"
@@ -574,7 +574,7 @@ function getAdminNameForLog(player)
574574
end
575575

576576
function aAdminMenu ( player, command )
577-
if ( hasObjectPermissionTo ( player, "general.adminpanel" ) ) then
577+
if ( hasObjectPermissionTo ( player, "general.adminpanel", false ) ) then
578578
triggerClientEvent ( player, "aClientAdminMenu", root )
579579
aPlayers[player]["chat"] = true
580580
end
@@ -631,7 +631,7 @@ addEventHandler ( "aTeam", root, function ( action, name, r, g, b )
631631
if checkClient( "command."..action, source, 'aTeam', action ) then
632632
return
633633
end
634-
if ( hasObjectPermissionTo ( client or source, "command."..action ) ) then
634+
if ( hasObjectPermissionTo ( client or source, "command."..action, false ) ) then
635635
mdata = ""
636636
if ( action == "createteam" ) then
637637
local success
@@ -954,7 +954,7 @@ addEventHandler ( "aPlayer", root, function ( player, action, data, additional,
954954
if not isElement( player ) then
955955
return -- Ignore if player is no longer valid
956956
end
957-
if ( hasObjectPermissionTo ( client or source, "command."..action ) ) then
957+
if ( hasObjectPermissionTo ( client or source, "command."..action, false ) ) then
958958
local admin = source
959959
local mdata = ""
960960
local more = ""
@@ -1168,7 +1168,7 @@ addEventHandler ( "aPlayer", root, function ( player, action, data, additional,
11681168
action = "adminr"
11691169
end
11701170
for id, p in ipairs ( getElementsByType ( "player" ) ) do
1171-
if ( hasObjectPermissionTo ( p, "general.adminpanel" ) ) then triggerEvent ( "aSync", p, "admins" ) end
1171+
if ( hasObjectPermissionTo ( p, "general.adminpanel", false ) ) then triggerEvent ( "aSync", p, "admins" ) end
11721172
end
11731173
else
11741174
outputChatBox ( "Error - Admin group not initialized. Please reinstall admin resource.", source, 255, 0 ,0 )
@@ -1263,7 +1263,7 @@ end
12631263
addEvent ( "aVehicle", true )
12641264
addEventHandler ( "aVehicle", root, function ( player, action, data )
12651265
if checkClient( "command."..action, source, 'aVehicle', action ) then return end
1266-
if ( hasObjectPermissionTo ( client or source, "command."..action ) ) then
1266+
if ( hasObjectPermissionTo ( client or source, "command."..action, false ) ) then
12671267
if ( not player ) then return end
12681268
local vehicle = getPedOccupiedVehicle ( player )
12691269
if ( vehicle ) then
@@ -1347,7 +1347,7 @@ addEvent ( "aResource", true )
13471347
addEventHandler ( "aResource", root, function ( name, action )
13481348
if checkClient( "command."..action, source, 'aResource', action ) then return end
13491349
local pname = getPlayerName ( source )
1350-
if ( hasObjectPermissionTo ( client or source, "command."..action ) ) then
1350+
if ( hasObjectPermissionTo ( client or source, "command."..action, false ) ) then
13511351
local text = ""
13521352
if ( action == "start" ) then
13531353
if ( startResource ( getResourceFromName ( name ), true ) ) then
@@ -1385,7 +1385,7 @@ end )
13851385
addEvent ( "aServer", true )
13861386
addEventHandler ( "aServer", root, function ( action, data, data2 )
13871387
if checkClient( "command."..action, source, 'aServer', action ) then return end
1388-
if ( hasObjectPermissionTo ( client or source, "command."..action ) ) then
1388+
if ( hasObjectPermissionTo ( client or source, "command."..action, false ) ) then
13891389
local mdata = tostring ( data )
13901390
local mdata2 = ""
13911391
if ( action == "setgame" ) then
@@ -1536,7 +1536,7 @@ function ( action, data )
15361536
aReports[id].read = false
15371537
-- PM all admins to say a new message has arrived
15381538
for _, p in ipairs ( getElementsByType ( "player" ) ) do
1539-
if ( hasObjectPermissionTo ( p, "general.adminpanel" ) ) then
1539+
if ( hasObjectPermissionTo ( p, "general.adminpanel", false ) ) then
15401540
outputChatBox( "New Admin message from " .. aReports[id].author .. " (" .. aReports[id].subject .. ")", p, 255, 0, 0 )
15411541
end
15421542
end
@@ -1545,7 +1545,7 @@ function ( action, data )
15451545
table.remove( aReports, 1 )
15461546
end
15471547
end
1548-
if ( hasObjectPermissionTo ( client or source, "general.adminpanel" ) ) then
1548+
if ( hasObjectPermissionTo ( client or source, "general.adminpanel", false ) ) then
15491549
if ( action == "get" ) then
15501550
triggerClientEvent ( source, "aMessage", source, "get", aReports, get("reportsEnabled") )
15511551
elseif ( action == "read" ) then
@@ -1561,7 +1561,7 @@ function ( action, data )
15611561
end
15621562
end
15631563
for id, p in ipairs ( getElementsByType ( "player" ) ) do
1564-
if ( hasObjectPermissionTo ( p, "general.adminpanel" ) ) then
1564+
if ( hasObjectPermissionTo ( p, "general.adminpanel", false ) ) then
15651565
triggerEvent ( "aSync", p, "messages" )
15661566
end
15671567
end
@@ -1572,7 +1572,7 @@ addEvent ( "aModdetails", true )
15721572
addEventHandler ( "aModdetails", resourceRoot, function ( action, player )
15731573
if source ~= resourceRoot then return end
15741574
if checkClient( false, client, 'aModdetails', action ) then return end
1575-
if ( hasObjectPermissionTo ( client, "general.adminpanel" ) ) then
1575+
if ( hasObjectPermissionTo ( client, "general.adminpanel", false ) ) then
15761576
if ( action == "get" ) then
15771577
triggerClientEvent ( client, "aModdetails", resourceRoot, "get", getPlayerModInfo(player), player )
15781578
end
@@ -1582,7 +1582,7 @@ end )
15821582
addEvent ( "aBans", true )
15831583
addEventHandler ( "aBans", root, function ( action, data, arg1, arg2, arg3 )
15841584
if checkClient( "command."..action, source, 'aBans', action ) then return end
1585-
if ( hasObjectPermissionTo ( client or source, "command."..action ) ) then
1585+
if ( hasObjectPermissionTo ( client or source, "command."..action, false ) ) then
15861586
local mdata = ""
15871587
local more = ""
15881588
if ( action == "banip" ) then
@@ -1686,17 +1686,17 @@ function checkClient(checkAccess,player,...)
16861686
end
16871687
if checkAccess and g_Prefs.securitylevel >= 1 then
16881688
if type(checkAccess) == 'string' then
1689-
if hasObjectPermissionTo ( player, checkAccess ) then
1689+
if hasObjectPermissionTo ( player, checkAccess, false ) then
16901690
return false -- Access ok
16911691
end
1692-
if hasObjectPermissionTo ( player, "general.adminpanel" ) then
1692+
if hasObjectPermissionTo ( player, "general.adminpanel", false ) then
16931693
local desc = table.concat({...}," ")
16941694
local ipAddress = getPlayerIP(player)
16951695
outputDebugString( "Admin security - Client does not have required rights ("..checkAccess.."). " .. tostring(ipAddress) .. " (" .. tostring(desc) .. ")" )
16961696
return true -- Low risk fail - Can't do specific command, but has access to admin panel
16971697
end
16981698
end
1699-
if not hasObjectPermissionTo ( player, "general.adminpanel" ) then
1699+
if not hasObjectPermissionTo ( player, "general.adminpanel", false ) then
17001700
local desc = table.concat({...}," ")
17011701
local ipAddress = getPlayerIP(client or player)
17021702
outputDebugString( "Admin security - Client without admin panel rights trigged an admin panel event. " .. tostring(ipAddress) .. " (" .. tostring(desc) .. ")", 2 )

[admin]/admin/server/admin_sync.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ function aSynchCoroutineFunc( type, data, typeOfTag, banSearchTag )
1515
local cor = aSyncCoroutine
1616
local tableOut = {}
1717
local theSource = root
18-
if client and not hasObjectPermissionTo ( client, "general.adminpanel" ) then
18+
if client and not hasObjectPermissionTo ( client, "general.adminpanel", false ) then
1919
type = "loggedout"
2020
elseif ( type == "player" ) then
2121
if not isElement( data ) then return end
@@ -51,14 +51,14 @@ function aSynchCoroutineFunc( type, data, typeOfTag, banSearchTag )
5151
tableOut[player]["accountname"] = getPlayerAccountName ( player ) or "N/A"
5252
tableOut[player]["serial"] = getPlayerSerial ( player )
5353
tableOut[player]["country"] = aPlayers[player]["country"]
54-
tableOut[player]["admin"] = hasObjectPermissionTo ( player, "general.adminpanel" )
54+
tableOut[player]["admin"] = hasObjectPermissionTo ( player, "general.adminpanel", false )
5555
tableOut[player]["acdetected"] = getPlayerACDetectedList( player )
5656
tableOut[player]["d3d9dll"] = getPlayerD3D9DLLHash( player )
5757
tableOut[player]["imgmodsnum"] = getPlayerModCount( player )
5858
end
5959
end
6060
elseif ( type == "resources" ) then
61-
if not hasObjectPermissionTo( source, "general.tab_resources" ) then
61+
if not hasObjectPermissionTo( source, "general.tab_resources", false ) then
6262
return
6363
end
6464
local resourceTable = getResources()
@@ -100,7 +100,7 @@ function aSynchCoroutineFunc( type, data, typeOfTag, banSearchTag )
100100
for id, player in ipairs(getElementsByType("player")) do
101101
if isElement(player) and aPlayers[player] then
102102
tableOut[player] = {}
103-
tableOut[player]["admin"] = hasObjectPermissionTo ( player, "general.adminpanel" )
103+
tableOut[player]["admin"] = hasObjectPermissionTo ( player, "general.adminpanel", false )
104104
if ( tableOut[player]["admin"] ) then
105105
tableOut[player]["chat"] = aPlayers[player]["chat"]
106106
end
@@ -281,7 +281,7 @@ end )
281281
addEvent ( "aPermissions", true )
282282
addEventHandler ( "aPermissions", root, function()
283283
if checkClient( false, source, 'aPermissions' ) then return end
284-
if ( hasObjectPermissionTo ( source, "general.adminpanel" ) ) then
284+
if ( hasObjectPermissionTo ( source, "general.adminpanel", false ) ) then
285285
local tableOut = {}
286286
for gi, group in ipairs ( aclGroupList() ) do
287287
for oi, object in ipairs ( aclGroupListObjects ( group ) ) do

0 commit comments

Comments
 (0)