Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
jlillis committed Jul 17, 2024
2 parents b1f2449 + 8ffc446 commit bc9fafe
Show file tree
Hide file tree
Showing 272 changed files with 168,623 additions and 115,692 deletions.
4 changes: 3 additions & 1 deletion [admin]/admin/client/admin_client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

_DEBUG = false

_version = '1.5.9'
_version = '1.6'
_flags = {}
_widgets = {}
_settings = nil
Expand All @@ -26,6 +26,7 @@ function aClientAdminMenu ()
aAdminMenuClose ( false )
else
aAdminMenu ()
guiFocus (aAdminForm)
end
end

Expand All @@ -39,6 +40,7 @@ addEvent ( "aClientAdminChat", true )
addEvent ( "aClientResourceStart", true )
addEvent ( "aClientResourceStop", true )
addEvent ( "aClientAdminMenu", true )
addEvent ( "aClientReports", true )
function aAdminResourceStart ()
addEventHandler ( "aClientAdminMenu", root, aClientAdminMenu )
local node = xmlLoadFile ( "conf\\weathers.xml" )
Expand Down
1 change: 0 additions & 1 deletion [admin]/admin/client/colorpicker/colorpicker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ function colorPicker.create(id, start, title)
end

function colorPicker:render()
-- if not self.gui.focus then return end
local x,y = guiGetPosition(self.gui.window, false)
dxDrawRectangle(x+16, y+32, 256, 256, self.color.huecurrent, self.gui.focus)
dxDrawImage(x+16, y+32, 256, 256, "client/colorpicker/sv.png", 0, 0, 0, self.color.white, self.gui.focus)
Expand Down
12 changes: 6 additions & 6 deletions [admin]/admin/client/gui/admin_acl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ function aManageACL ()
guiGridListSetSortingEnabled ( aACLList, false )
guiGridListAddColumn( aACLList, "", 0.10 )
guiGridListAddColumn( aACLList, "", 0.85 )
aACLCreateGroup = guiCreateButton ( 0.55, 0.05, 0.40, 0.04, "Create group", true, aAclForm )
aACLCreateACL = guiCreateButton ( 0.55, 0.10, 0.40, 0.04, "Create ACL", true, aAclForm )
aACLCreateGroup = guiCreateButton ( 0.55, 0.05, 0.40, 0.04, "Create group", true, aAclForm, "aclcreate" )
aACLCreateACL = guiCreateButton ( 0.55, 0.10, 0.40, 0.04, "Create ACL", true, aAclForm, "aclcreate" )
aACLLabel = guiCreateLabel ( 0.55, 0.19, 0.40, 0.04, "", true, aAclForm )
aACLSeparator = guiCreateStaticImage ( 0.55, 0.235, 0.40, 0.0025, "client\\images\\dot.png", true, aAclForm )
aACLDestroyGroup = guiCreateButton ( 0.55, 0.25, 0.40, 0.04, "Destroy group", true, aAclForm )
aACLDestroyACL = guiCreateButton ( 0.55, 0.25, 0.40, 0.04, "Destroy ACL", true, aAclForm )
aACLAddObject = guiCreateButton ( 0.55, 0.30, 0.40, 0.04, "Add Object", true, aAclForm )
aACLRemoveObject = guiCreateButton ( 0.55, 0.35, 0.40, 0.04, "Remove Object", true, aAclForm )
aACLDestroyGroup = guiCreateButton ( 0.55, 0.25, 0.40, 0.04, "Destroy group", true, aAclForm, "acldestroy" )
aACLDestroyACL = guiCreateButton ( 0.55, 0.25, 0.40, 0.04, "Destroy ACL", true, aAclForm, "acldestroy" )
aACLAddObject = guiCreateButton ( 0.55, 0.30, 0.40, 0.04, "Add Object", true, aAclForm, "acladd" )
aACLRemoveObject = guiCreateButton ( 0.55, 0.35, 0.40, 0.04, "Remove Object", true, aAclForm, "aclremove" )
aACLAddACL = guiCreateButton ( 0.55, 0.40, 0.40, 0.04, "Add ACL", true, aAclForm )
aACLRemoveACL = guiCreateButton ( 0.55, 0.45, 0.40, 0.04, "Remove ACL", true, aAclForm )

Expand Down
23 changes: 21 additions & 2 deletions [admin]/admin/client/gui/admin_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ aLastSync = 0
aResources = {}

local serverPassword = 'None'
local hasResourceSetting

function guiComboBoxAdjustHeight ( combobox, itemcount )
if getElementType ( combobox ) ~= "gui-combobox" or type ( itemcount ) ~= "number" then error ( "Invalid arguments @ 'guiComboBoxAdjustHeight'", 2 ) end
Expand Down Expand Up @@ -181,7 +182,7 @@ y=y+B aTab1.VehicleHealth = guiCreateLabel ( 0.26, y, 0.25, 0.04, "Vehicle Heal

aTab2 = {}
aTab2.Tab = guiCreateTab ( "Resources", aTabPanel, "resources" )
aTab2.ManageACL = guiCreateButton ( 0.75, 0.02, 0.23, 0.04, "Manage ACL", true, aTab2.Tab )
aTab2.ManageACL = guiCreateButton ( 0.75, 0.02, 0.23, 0.04, "Manage ACL", true, aTab2.Tab, "aclmanager" )
aTab2.ResourceListSearch = guiCreateEdit ( 0.03, 0.05, 0.31, 0.04, "", true, aTab2.Tab )
guiCreateStaticImage ( 0.34, 0.05, 0.035, 0.04, "client\\images\\search.png", true, aTab2.Tab )
aTab2.ResourceList = guiCreateGridList ( 0.03, 0.10, 0.35, 0.80, true, aTab2.Tab )
Expand All @@ -194,6 +195,7 @@ y=y+B aTab1.VehicleHealth = guiCreateLabel ( 0.26, y, 0.25, 0.04, "Vehicle Heal
aTab2.ResourceInclMaps = guiCreateCheckBox ( 0.03, 0.91, 0.15, 0.04, "Include Maps", false, true, aTab2.Tab )
aTab2.ResourceRefresh = guiCreateButton ( 0.20, 0.915, 0.18, 0.04, "Refresh list", true, aTab2.Tab, "listresources" )
aTab2.ResourceSettings = guiCreateButton ( 0.40, 0.05, 0.20, 0.04, "Settings", true, aTab2.Tab )
guiSetVisible ( aTab2.ResourceSettings, false)
aTab2.ResourceStart = guiCreateButton ( 0.40, 0.10, 0.20, 0.04, "Start", true, aTab2.Tab, "start" )
aTab2.ResourceRestart = guiCreateButton ( 0.40, 0.15, 0.20, 0.04, "Restart", true, aTab2.Tab, "restart" )
aTab2.ResourceStop = guiCreateButton ( 0.40, 0.20, 0.20, 0.04, "Stop", true, aTab2.Tab, "stop" )
Expand Down Expand Up @@ -969,7 +971,9 @@ end
function aClientDoubleClick ( button )
if ( source == aTab2.ResourceList ) then
if ( guiGridListGetSelectedItem ( aTab2.ResourceList ) ~= -1 ) then
aManageSettings ( guiGridListGetItemText ( aTab2.ResourceList, guiGridListGetSelectedItem( aTab2.ResourceList ), 1 ) )
if hasResourceSetting then
aManageSettings ( guiGridListGetItemText ( aTab2.ResourceList, guiGridListGetSelectedItem( aTab2.ResourceList ), 1 ) )
end
end
elseif ( source == aTab4.BansList ) then
if ( guiGridListGetSelectedItem ( aTab4.BansList ) == -1 ) then
Expand Down Expand Up @@ -1059,6 +1063,10 @@ function aClientClick ( button )
elseif ( source == aTab2.ResourceList ) then
guiSetVisible ( aTab2.ResourceFailture, false )
if ( guiGridListGetSelectedItem ( aTab2.ResourceList ) ~= -1 ) then
local resName = guiGridListGetItemText(aTab2.ResourceList, guiGridListGetSelectedItem( aTab2.ResourceList ), 1)
if resName then
triggerServerEvent("aAdmin", localPlayer, "resourcelist", resName)
end
guiSetText(aTab2.ResourceName, "Full Name: " .. guiGridListGetItemText(aTab2.ResourceList, guiGridListGetSelectedItem ( aTab2.ResourceList ), 4))
guiSetText(aTab2.ResourceAuthor, "Author: " .. guiGridListGetItemText(aTab2.ResourceList, guiGridListGetSelectedItem ( aTab2.ResourceList ), 5))
guiSetText(aTab2.ResourceVersion, "Version: " .. guiGridListGetItemText(aTab2.ResourceList, guiGridListGetSelectedItem ( aTab2.ResourceList ), 6))
Expand Down Expand Up @@ -1192,6 +1200,17 @@ function aClientClick ( button )
end
end

addEvent ("setVisibilityOfSettingsButton", true)
function setVisibilityOfSettingsButton (showResourceSetting)
hasResourceSetting = showResourceSetting
if hasResourceSetting then
guiSetVisible(aTab2.ResourceSettings, true)
else
guiSetVisible(aTab2.ResourceSettings, false)
end
end
addEventHandler ( "setVisibilityOfSettingsButton", resourceRoot, setVisibilityOfSettingsButton)

function aClientRender ()
if ( guiGetVisible ( aAdminForm ) ) then
if ( getTickCount() >= aLastCheck ) then
Expand Down
9 changes: 0 additions & 9 deletions [admin]/admin/client/gui/admin_maps.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,15 +78,6 @@ function guiClick(button)
else
guiSetEnabled(aTabMap.NextMap, false)
end
-- if gamemode == "deleted maps" then
-- guiSetEnabled(aTabMap.Start, false)
-- guiSetEnabled(aTabMap.Delete, false)
-- guiSetEnabled(aTabMap.Revert, true)
-- else
-- guiSetEnabled(aTabMap.Start, true)
-- guiSetEnabled(aTabMap.Delete, true)
-- guiSetEnabled(aTabMap.Revert, false)
-- end
elseif source == aTabMap.Start then
triggerServerEvent("startGamemodeMap_s", localPlayer, gamemode, mapResName)
elseif source == aTabMap.NextMap then
Expand Down
4 changes: 3 additions & 1 deletion [admin]/admin/client/gui/admin_messages.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,11 @@ function aViewMessagesClose ( destroy )
end
end

function aMessagesSync ( action, data )
function aMessagesSync ( action, data, isReportDisabled )
if ( action == "get" ) then
_messages = data
guiGridListClear ( aMessagesList )

for id=#data,1,-1 do
local message = data[id]
local row = guiGridListAddRow ( aMessagesList )
Expand All @@ -68,6 +69,7 @@ function aMessagesSync ( action, data )
guiGridListSetItemText ( aMessagesList, row, 3, message.time, false, false )
guiGridListSetItemText ( aMessagesList, row, 4, removeColorCoding(message.author), false, false )
end
guiSetText(aMessagesForm, (isReportDisabled ~= "true" and "View Messages (reports are disabled)" or "View Messages"))
end
end

Expand Down
2 changes: 1 addition & 1 deletion [admin]/admin/client/gui/admin_performance.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ function aPerformance ()
aPerformanceVehicle = guiCreateCheckBox ( 0.05, 0.50, 0.90, 0.08, "Unload Vehicle Form when not used", false, true, aPerformanceForm )
aPerformanceBan = guiCreateCheckBox ( 0.05, 0.58, 0.90, 0.08, "Unload Ban Form when not used", false, true, aPerformanceForm )
guiCreateStaticImage ( 0.05, 0.68, 0.60, 0.003, "client\\images\\dot.png", true, aPerformanceForm )
aPerformanceInput = guiCreateCheckBox ( 0.05, 0.70, 0.90, 0.08, "Unload Input Box when not used", false, true, aPerformanceForm )
aPerformanceInput = guiCreateCheckBox ( 0.05, 0.70, 0.90, 0.08, "Unload Input Box when not used", false, true, aPerformanceForm )
aPerformanceMessage = guiCreateCheckBox ( 0.05, 0.78, 0.90, 0.08, "Unload Message Box when not used", false, true, aPerformanceForm )

aPerformanceOk = guiCreateButton ( 0.79, 0.90, 0.18, 0.08, "Ok", true, aPerformanceForm )
Expand Down
4 changes: 2 additions & 2 deletions [admin]/admin/client/gui/admin_report.lua
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ local reportCategories
local aSelectPlayer = nil

function aReport ( )

if ( aReportForm == nil ) then
reportCategories = {}
for i,cat in ipairs( split( g_Prefs.reportCategories, string.byte(',') ) ) do
Expand Down Expand Up @@ -58,8 +59,7 @@ function aReport ( )
guiBringToFront ( aReportForm )
showCursor ( true )
end
addCommandHandler ( "report", aReport )

addEventHandler( "aClientReports", root, aReport )

function aReportClose ( )
if ( aReportForm ) then
Expand Down
3 changes: 0 additions & 3 deletions [admin]/admin/client/gui/admin_vehicle.lua
Original file line number Diff line number Diff line change
Expand Up @@ -241,9 +241,6 @@ function aClientVehicleClick ( button )
triggerServerEvent ( "aVehicle", localPlayer, aVehicleCustomizePlayer, "setlights", { guiGetText ( aLightsColor ) } )
elseif ( source == aLicensePlateSet ) then
triggerServerEvent ( "aVehicle", localPlayer, aVehicleCustomizePlayer, "setplates", { guiGetText ( aLicensePlate ) } )
-- elseif ( source == aVehicleColorScheme ) then
-- guiSetVisible ( aVehicleColorForm, true )
-- guiBringToFront ( aVehicleColorForm )
elseif ( source == aVehicleUpgradeAll ) then
triggerServerEvent ( "aVehicle", localPlayer, aVehicleCustomizePlayer, "customize", { "all" } )
setTimer ( aVehicleCheckCurrentUpgrades, 2000, 1, aVehicleCustomizeVehicle )
Expand Down
24 changes: 24 additions & 0 deletions [admin]/admin/conf/ACL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,12 @@
<right name="command.stopall" access="false" />
<right name="command.delete" access="true" />
<right name="command.restart" access="true" />
<!--ACL Manager related-->
<right name="command.aclmanager" access="true" />
<right name="command.aclcreate" access="true" />
<right name="command.acldestroy" access="true" />
<right name="command.acladd" access="true" />
<right name="command.aclremove" access="true" />
<!--Server related-->
<right name="command.setpassword" access="true" />
<right name="command.setwelcome" access="true" />
Expand Down Expand Up @@ -137,6 +143,12 @@
<right name="command.stopall" access="false" />
<right name="command.delete" access="false" />
<right name="command.restart" access="true" />
<!--ACL Manager related-->
<right name="command.aclmanager" access="false" />
<right name="command.aclcreate" access="false" />
<right name="command.acldestroy" access="false" />
<right name="command.acladd" access="false" />
<right name="command.aclremove" access="false" />
<!--Server related-->
<right name="command.setpassword" access="true" />
<right name="command.setwelcome" access="true" />
Expand Down Expand Up @@ -217,6 +229,12 @@
<right name="command.stopall" access="false" />
<right name="command.delete" access="false" />
<right name="command.restart" access="false" />
<!--ACL Manager related-->
<right name="command.aclmanager" access="false" />
<right name="command.aclcreate" access="false" />
<right name="command.acldestroy" access="false" />
<right name="command.acladd" access="false" />
<right name="command.aclremove" access="false" />
<!--Server related-->
<right name="command.setpassword" access="false" />
<right name="command.setwelcome" access="false" />
Expand Down Expand Up @@ -297,6 +315,12 @@
<right name="command.stopall" access="false" />
<right name="command.delete" access="false" />
<right name="command.restart" access="false" />
<!--ACL Manager related-->
<right name="command.aclmanager" access="false" />
<right name="command.aclcreate" access="false" />
<right name="command.acldestroy" access="false" />
<right name="command.acladd" access="false" />
<right name="command.aclremove" access="false" />
<!--Server related-->
<right name="command.setpassword" access="false" />
<right name="command.setwelcome" access="false" />
Expand Down
78 changes: 52 additions & 26 deletions [admin]/admin/meta.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<meta>
<info author="lil_Toady" type="misc" version="1.5.9" />
<info author="lil_Toady" type="misc" version="1.6.0" />
<min_mta_version client="1.5.9-9.20957.0" server="1.5.9-9.20957.0"/>
<!--
Admin System Meta File.
Expand All @@ -18,6 +18,7 @@
<script src="server/admin_ACL.lua" />
<script src="server/admin_settings.lua" />
<script src="server/admin_screenshot.lua" />
<script src="server/admin_report.lua" />
<script src="server/http/admin_http.lua" />
<script src="client/admin_clientprefs.lua" type="client" cache="false" />
<script src="client/admin_client.lua" type="client" cache="false" />
Expand Down Expand Up @@ -115,45 +116,70 @@
4. double click on the resource name
***************************************************** -->

<setting name="*maxmsgs" value="99"
<setting name="*reportsEnabled" value="true"
friendlyname="Enable default reporting system"
accept="true,false"
desc="When enabled, players will be able to submit reports to admins via the /report command."
/>

<setting name="*maxmsgs" value="55"
friendlyname="Max messages"
accept="1-1000"
desc="Maximum admin messages to keep."
/>

<setting name="*bandurations" value="60,3600,43200,0"
<setting name="*bandurations" value="3600,43200,86400,172800,604800,0"
friendlyname="Ban durations"
group="Durations"
examples="60,360,0"
examples="3600,43200,0"
desc="Duration options for the ban window. Comma seperated list in seconds. 0 means no duration limit."
/>

<setting name="*mutedurations" value="60,120,300,600,0"
<setting name="*mutedurations" value="60,300,3600,43200,86400,172800,0"
friendlyname="Mute durations"
group="Durations"
examples="60,360,0"
examples="60,300,0"
desc="Duration options for the mute window. Comma seperated list in seconds. 0 means no duration limit."
/>

<setting name="*securitylevel" value="1"
friendlyname="Security level"
<setting name="*useip2c" value="true"
friendlyname="useip2c"
group="_Advanced"
accept="0-2"
desc="Detect fake admin packets. 0-No checks 1-Some checks 2-All checks."
accept="true,false"
desc="When enabled, admin will use the ip2c resource to determine players' countries by their IP."
/>

<setting name="*clientcheckban" value="false"
friendlyname="clientcheckban"
group="_Advanced"
<setting name="*fakePacketsIPban" value="false"
friendlyname="IPBan"
group="_fake packets"
accept="true,false"
desc="Ban IP's that attempt to send fake admin packets."
/>
<setting name="*useip2c" value="true"
friendlyname="useip2c"
group="_Advanced"
desc="Ban IPs that attempt to send fake admin packets."
/>

<setting name="*fakePacketsSerialban" value="false"
friendlyname="Serialban"
group="_fake packets"
accept="true,false"
desc="When enabled, admin will use the ip2c resource to determine players' countries by their IP."
desc="Ban serials that attempt to send fake admin packets."
/>

<setting name="*fakePacketsIPbanLength" value="86400"
friendlyname="IPBan length"
group="_fake packets"
desc="Set ban length for IPBan in seconds. Set to 0 for a permanent ban."
/>

<setting name="*fakePacketsSerialbanLength" value="86400"
friendlyname="Serialban length"
group="_fake packets"
desc="Set ban length for Serialban in seconds. Set to 0 for a permanent ban."
/>

<setting name="*securitylevel" value="2"
friendlyname="Security level"
group="_fake packets"
accept="0-2"
desc="Detect fake admin packets. 0-No checks 1-Some checks 2-All checks."
/>

<setting name="*maxchatmsgs" value="10"
Expand All @@ -167,15 +193,15 @@
desc="List of non player report categories."
/>

<setting name="*playerReportCategories" value="Cheater/Modder,Spammer"
<setting name="*playerReportCategories" value="Rulebreaks,Cheater/Modder,Spammer"
friendlyname="Player report categories"
desc="List of report categories for reporting players."
/>
<setting name="*adminChatCommandName" value="a"
friendlyname="Admin chat command name"
desc="The command name for admin chat."
/>

</settings>
<setting name="*adminChatCommandName" value="a"
friendlyname="Admin chat command name"
desc="The command name for admin chat."
/>

</settings>
</meta>
7 changes: 7 additions & 0 deletions [admin]/admin/server/admin_report.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
addCommandHandler("report", function( playerSource )
if ( get("reportsEnabled") ~= "false" ) then
triggerClientEvent( playerSource, "aClientReports", playerSource )
else
outputChatBox ( "Reports are not accepted currently.", playerSource, 255, 0, 0 )
end
end, false, false)
Loading

0 comments on commit bc9fafe

Please sign in to comment.