Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into admin2-bans
Browse files Browse the repository at this point in the history
  • Loading branch information
jlillis committed Jan 18, 2024
2 parents b8085e8 + d7b0202 commit 30503db
Show file tree
Hide file tree
Showing 42 changed files with 1,342 additions and 867 deletions.
18 changes: 9 additions & 9 deletions [admin]/acpanel/meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
<script src="s_settings.lua"/>
<script src="s_img_mod.lua"/>

<script src="_common.lua" type="client" />
<script src="c_joiner.lua" type="client" />
<script src="c_settings.lua" type="client"/>
<script src="c_gui.lua" type="client" />
<script src="c_gui_ac.lua" type="client" />
<script src="c_gui_ac2.lua" type="client" />
<script src="c_gui_block_mods.lua" type="client" />
<script src="c_gui_config.lua" type="client" />
<script src="c_model_switcher.lua" type="client" />
<script src="_common.lua" type="client" cache="false" />
<script src="c_joiner.lua" type="client" cache="false" />
<script src="c_settings.lua" type="client" cache="false"/>
<script src="c_gui.lua" type="client" cache="false" />
<script src="c_gui_ac.lua" type="client" cache="false" />
<script src="c_gui_ac2.lua" type="client" cache="false" />
<script src="c_gui_block_mods.lua" type="client" cache="false" />
<script src="c_gui_config.lua" type="client" cache="false" />
<script src="c_model_switcher.lua" type="client" cache="false" />


<settings>
Expand Down
149 changes: 5 additions & 144 deletions [admin]/admin/admin_definitions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,153 +10,14 @@

_DEBUG = false

_version = '1.5.9'
_version = '1.6'

-- MISC DEFINITIONS
ADMIN_CHAT_MAXLENGTH = 225

function enum ( args, prefix )
for i, v in ipairs ( args ) do
if ( prefix ) then _G[v] = prefix..i
else _G[v] = i end
end
end

-- EVENT CALLS

enum
({
"EVENT_SYNC",
"EVENT_SYNC_PERMISSIONS",
"EVENT_TEAM",
"EVENT_ADMIN",
"EVENT_PLAYER",
"EVENT_VEHICLE",
"EVENT_RESOURCE",
"EVENT_SERVER",
"EVENT_MESSAGE",
"EVENT_BANS",
"EVENT_EXECUTE",
"EVENT_ADMIN_CHAT",
"EVENT_ADMIN_OPEN",

"EVENT_RESOURCE_START",
"EVENT_RESOURCE_STOP",
"EVENT_PLAYER_JOIN"
} )

-- SYNC DEFINITIONS

enum
({
"SYNC_PLAYER",
"SYNC_PLAYERS",
"SYNC_RESOURCES",
"SYNC_ADMINS",
"SYNC_SERVER",
"SYNC_RIGHTS",
"SYNC_BANS",
"SYNC_MESSAGES"
})

-- TEAM DEFINITIONS

enum
({
"TEAM_CREATE",
"TEAM_DESTROY"
})

-- ADMIN DEFINITIONS

enum
({
"ADMIN_PASSWORD",
"ADMIN_AUTOLOGIN",
"ADMIN_SYNC",
"ADMIN_ACL_CREATE",
"ADMIN_ACL_DESTROY",
"ADMIN_ACL_ADD",
"ADMIN_ACL_REMOVE"
})

-- PLAYER DEFINITIONS

enum
({
"PLAYER_KICK",
"PLAYER_BAN",
"PLAYER_MUTE",
"PLAYER_FREEZE",
"PLAYER_SHOUT",
"PLAYER_SET_HEALTH",
"PLAYER_SET_ARMOUR",
"PLAYER_SET_SKIN",
"PLAYER_SET_MONEY",
"PLAYER_SET_STAT",
"PLAYER_SET_TEAM",
"PLAYER_SET_INTERIOR",
"PLAYER_SET_DIMENSION",
"PLAYER_JETPACK",
"PLAYER_SET_GROUP",
"PLAYER_GIVE_VEHICLE",
"PLAYER_GIVE_WEAPON",
"PLAYER_SLAP",
"PLAYER_WARP",
"PLAYER_WARP_TO"
})

-- VEHICLE DEFINITIONS

enum
({
"VEHICLE_REPAIR",
"VEHICLE_CUSTOMIZE",
"VEHICLE_SET_PAINTJOB",
"VEHICLE_SET_COLOR",
"VEHICLE_BLOW",
"VEHICLE_DESTROY"
})

-- RESOURCE DEFINITIONS

enum
({
"RESOURCE_START",
"RESOURCE_RESTART",
"RESOURCE_STOP"
})

-- SERVER DEFINITIONS

enum
({
"SERVER_SET_GAME",
"SERVER_SET_MAP",
"SERVER_SET_WELCOME",
"SERVER_SET_TIME",
"SERVER_SET_PASSWORD",
"SERVER_SET_WEATHER",
"SERVER_BLEND_WEATHER",
"SERVER_SET_GAME_SPEED",
"SERVER_SET_GRAVITY",
"SERVER_SET_BLUR_LEVEL",
"SERVER_SET_WAVE_HEIGHT"
})

-- MESSAGE DEFINITIONS

enum
({
"MESSAGE_NEW",
"MESSAGE_GET",
"MESSAGE_READ",
"MESSAGE_DELETE"
})

-- BANS DEFINITIONS

enum
({
"BANS_BAN_IP",
"BANS_BAN_SERIAL",
"BANS_UNBAN_IP",
"BANS_UNBAN_SERIAL"
})
end
15 changes: 0 additions & 15 deletions [admin]/admin/client/admin_client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,21 +124,6 @@ function getWeatherNameFromID ( weather )
return iif ( aWeathers[weather], aWeathers[weather], "Unknown" )
end

function aExecute ( action, echo )
local result = loadstring("return " .. action)()
if ( echo == true ) then
local restring
if ( type ( result ) == "table" ) then
restring = "Table ("..unpack ( result )..")"
elseif ( type ( result ) == "userdata" ) then
restring = "Element ("..getElementType ( result )..")"
else
restring = tostring ( result )
end
outputChatBox( "Command executed! Result: " ..restring, 0, 0, 255 )
end
end

function iif ( cond, arg1, arg2 )
if ( cond ) then
return arg1
Expand Down
6 changes: 0 additions & 6 deletions [admin]/admin/client/gui/admin_inputbox.lua
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,9 @@ function aInputBoxClose ( destroy )
end
end

-- Escape character '%' will be lost when using gsub, so turn % into %%
function keepEscapeCharacter ( text )
return string.gsub( text, "%%", "%%%%" )
end

function aInputBoxClick ( button )
if ( button == "left" ) then
if ( source == aInputOk ) then
--loadstring ( string.gsub ( aInputAction, "$value", "\""..keepEscapeCharacter( guiGetText ( aInputValue ) ).."\"" ) )()

if (aInputAction == "kickPlayer") then
triggerServerEvent("aPlayer", localPlayer, varOne, "kick", guiGetText(aInputValue))
Expand Down
18 changes: 3 additions & 15 deletions [admin]/admin/client/gui/admin_main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -212,12 +212,7 @@ y=y+B aTab1.VehicleHealth = guiCreateLabel ( 0.26, y, 0.25, 0.04, "Vehicle Heal
aTab2.LogLine3 = guiCreateLabel ( 0.41, 0.87, 0.50, 0.03, "", true, aTab2.Tab )
aTab2.LogLine4 = guiCreateLabel ( 0.41, 0.90, 0.50, 0.03, "", true, aTab2.Tab )
aTab2.LogLine5 = guiCreateLabel ( 0.41, 0.93, 0.50, 0.03, "", true, aTab2.Tab )
guiCreateLabel ( 0.41, 0.65, 0.50, 0.04, "Execute Command:", true, aTab2.Tab )
aTab2.Command = guiCreateEdit ( 0.41, 0.70, 0.40, 0.055, "", true, aTab2.Tab )
aTab2.ExecuteClient = guiCreateButton ( 0.82, 0.70, 0.16, 0.035, "Client", true, aTab2.Tab, "execute" )
aTab2.ExecuteServer = guiCreateButton ( 0.82, 0.736, 0.16, 0.035, "Server", true, aTab2.Tab, "execute" )
aTab2.ExecuteAdvanced = guiCreateLabel ( 0.45, 0.71, 0.50, 0.04, "For advanced users only.", true, aTab2.Tab )
guiLabelSetColor ( aTab2.ExecuteAdvanced, 255, 0, 0 )

aLogLines = 1

createMapTab()
Expand Down Expand Up @@ -333,6 +328,7 @@ y=y+B aTab1.VehicleHealth = guiCreateLabel ( 0.26, y, 0.25, 0.04, "Vehicle Heal
guiGridListAddColumn ( aTab5.AdminPlayers, "Admins", 0.90 )
aTab5.AdminChatSound = guiCreateCheckBox ( 0.79, 0.86, 0.18, 0.04, "Play Sound", true, true, aTab5.Tab )
aTab5.AdminText = guiCreateEdit ( 0.03, 0.92, 0.80, 0.06, "", true, aTab5.Tab )
guiEditSetMaxLength(aTab5.AdminText, ADMIN_CHAT_MAXLENGTH)
aTab5.AdminSay = guiCreateButton ( 0.85, 0.92, 0.08, 0.06, "Say", true, aTab5.Tab )
aTab5.AdminChatHelp = guiCreateButton ( 0.94, 0.92, 0.03, 0.06, "?", true, aTab5.Tab )

Expand Down Expand Up @@ -1075,16 +1071,8 @@ function aClientClick ( button )
elseif ( source == aTab2.ResourceRefresh or source == aTab2.ResourceInclMaps ) then
guiGridListClear ( aTab2.ResourceList )
triggerServerEvent ( "aSync", localPlayer, "resources" )
elseif ( source == aTab2.ExecuteClient ) then
if ( ( guiGetText ( aTab2.Command ) ) and ( guiGetText ( aTab2.Command ) ~= "" ) ) then aExecute ( guiGetText ( aTab2.Command ), true ) end
elseif ( source == aTab2.ExecuteServer ) then
if ( ( guiGetText ( aTab2.Command ) ) and ( guiGetText ( aTab2.Command ) ~= "" ) ) then triggerServerEvent ( "aExecute", localPlayer, guiGetText ( aTab2.Command ), true ) end
elseif ( source == aTab2.Command ) then

guiSetVisible ( aTab2.ExecuteAdvanced, false )
elseif ( source == aTab2.ExecuteAdvanced ) then
guiSetVisible ( aTab2.ExecuteAdvanced, false )
end

-- TAB 3, WORLD
elseif ( getElementParent ( source ) == aTab3.Tab ) then
if ( source == aTab3.SetGameType ) then aInputBox ( "Game Type", "Enter game type:", "", "setGameType" )
Expand Down
4 changes: 0 additions & 4 deletions [admin]/admin/conf/ACL.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
<right name="command.stopall" access="false" />
<right name="command.delete" access="true" />
<right name="command.restart" access="true" />
<right name="command.execute" access="true" />
<!--Server related-->
<right name="command.setpassword" access="true" />
<right name="command.setwelcome" access="true" />
Expand Down Expand Up @@ -138,7 +137,6 @@
<right name="command.stopall" access="false" />
<right name="command.delete" access="false" />
<right name="command.restart" access="true" />
<right name="command.execute" access="false" />
<!--Server related-->
<right name="command.setpassword" access="true" />
<right name="command.setwelcome" access="true" />
Expand Down Expand Up @@ -219,7 +217,6 @@
<right name="command.stopall" access="false" />
<right name="command.delete" access="false" />
<right name="command.restart" access="false" />
<right name="command.execute" access="false" />
<!--Server related-->
<right name="command.setpassword" access="false" />
<right name="command.setwelcome" access="false" />
Expand Down Expand Up @@ -300,7 +297,6 @@
<right name="command.stopall" access="false" />
<right name="command.delete" access="false" />
<right name="command.restart" access="false" />
<right name="command.execute" access="false" />
<!--Server related-->
<right name="command.setpassword" access="false" />
<right name="command.setwelcome" access="false" />
Expand Down
10 changes: 10 additions & 0 deletions [admin]/admin/conf/skins.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
<group name="Special">
<skin model="1" name="Truth" />
<skin model="2" name="Maccer" />
<skin model="5" name="Big Bear(Large)"/>
<skin model="6" name="White Croupier"/>
<skin model="8" name="Cab Driver"/>
<skin model="42" name="Suzie"/>
<skin model="86" name="Tracksuit Girl (Pink)" />
<skin model="265" name="Tenpenny" />
<skin model="266" name="Pulaski" />
<skin model="267" name="Hern" />
Expand Down Expand Up @@ -165,6 +170,8 @@
<skin model="287" name="Army" />
</group>
<group name="Police">
<skin model="3" name="Deputy Officer"/>
<skin model="4" name="Sheriff"/>
<skin model="190" name="Barbara Schternvart" />
<skin model="246" name="Cop Stripper" />
<skin model="280" name="Cop 1" />
Expand Down Expand Up @@ -206,6 +213,7 @@
<skin model="17" name="Black suit" />
<skin model="57" name="Chinese Businessman" />
<skin model="61" name="Pilot" />
<skin model="65" name="Air Traffic Controller (1)"/>
<skin model="76" name="Businesswoman 1" />
<skin model="141" name="Cute Librarian" />
<skin model="147" name="Sigmund Freud" />
Expand All @@ -220,6 +228,8 @@
<skin model="228" name="Japanese Businessman 3" />
<skin model="255" name="Limo Driver" />
<skin model="263" name="Asian Hostess" />
<skin model="273" name="Reporter"/>
<skin model="289" name="Air Traffic Controller (2)"/>
</group>
<group name="Fighters">
<skin model="49" name="Ninja Sensei" />
Expand Down
53 changes: 27 additions & 26 deletions [admin]/admin/meta.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
versions of the admin system.
-->
<!--Main script files, keep them in that order or it may break-->
<script src="admin_definitions.lua" type="shared" cache="false" />
<script src="server/admin_serverjoiner.lua" />
<script src="server/admin_serverprefs.lua" />
<script src="server/admin_server.lua" />
Expand All @@ -18,32 +19,32 @@
<script src="server/admin_settings.lua" />
<script src="server/admin_screenshot.lua" />
<script src="server/http/admin_http.lua" />
<script src="client/admin_clientprefs.lua" type="client" />
<script src="client/admin_client.lua" type="client" />
<script src="client/admin_gui.lua" type="client" />
<script src="client/admin_ACL.lua" type="client" />
<script src="client/gui/admin_main.lua" type="client" />
<script src="client/gui/admin_performance.lua" type="client" />
<script src="client/gui/admin_permissions.lua" type="client" />
<script src="client/gui/admin_maps.lua" type="client" />
<script src="client/gui/admin_messages.lua" type="client" />
<script src="client/gui/admin_message.lua" type="client" />
<script src="client/gui/admin_moddetails.lua" type="client" />
<script src="client/gui/admin_spectator.lua" type="client" />
<script src="client/gui/admin_messagebox.lua" type="client" />
<script src="client/gui/admin_inputbox.lua" type="client" />
<script src="client/gui/admin_team.lua" type="client" />
<script src="client/gui/admin_skin.lua" type="client" />
<script src="client/gui/admin_stats.lua" type="client" />
<script src="client/gui/admin_vehicle.lua" type="client" />
<script src="client/gui/admin_interior.lua" type="client" />
<script src="client/gui/admin_ban.lua" type="client" />
<script src="client/gui/admin_warp.lua" type="client" />
<script src="client/gui/admin_report.lua" type="client" />
<script src="client/gui/admin_acl.lua" type="client" />
<script src="client/gui/admin_settings.lua" type="client" />
<script src="client/gui/admin_screenshot.lua" type="client" />
<script src="client/colorpicker/colorpicker.lua" type="client" />
<script src="client/admin_clientprefs.lua" type="client" cache="false" />
<script src="client/admin_client.lua" type="client" cache="false" />
<script src="client/admin_gui.lua" type="client" cache="false" />
<script src="client/admin_ACL.lua" type="client" cache="false" />
<script src="client/gui/admin_main.lua" type="client" cache="false" />
<script src="client/gui/admin_performance.lua" type="client" cache="false" />
<script src="client/gui/admin_permissions.lua" type="client" cache="false" />
<script src="client/gui/admin_maps.lua" type="client" cache="false" />
<script src="client/gui/admin_messages.lua" type="client" cache="false" />
<script src="client/gui/admin_message.lua" type="client" cache="false" />
<script src="client/gui/admin_moddetails.lua" type="client" cache="false" />
<script src="client/gui/admin_spectator.lua" type="client" cache="false" />
<script src="client/gui/admin_messagebox.lua" type="client" cache="false" />
<script src="client/gui/admin_inputbox.lua" type="client" cache="false" />
<script src="client/gui/admin_team.lua" type="client" cache="false" />
<script src="client/gui/admin_skin.lua" type="client" cache="false" />
<script src="client/gui/admin_stats.lua" type="client" cache="false" />
<script src="client/gui/admin_vehicle.lua" type="client" cache="false" />
<script src="client/gui/admin_interior.lua" type="client" cache="false" />
<script src="client/gui/admin_ban.lua" type="client" cache="false" />
<script src="client/gui/admin_warp.lua" type="client" cache="false" />
<script src="client/gui/admin_report.lua" type="client" cache="false" />
<script src="client/gui/admin_acl.lua" type="client" cache="false" />
<script src="client/gui/admin_settings.lua" type="client" cache="false" />
<script src="client/gui/admin_screenshot.lua" type="client" cache="false" />
<script src="client/colorpicker/colorpicker.lua" type="client" cache="false" />

<!-- Placeholder for backwards compatibility -->
<script src="server/admin_ip2c.lua" />
Expand Down
Loading

0 comments on commit 30503db

Please sign in to comment.