Skip to content

Commit 6eb2bfd

Browse files
textstackpingu7867
andauthored
Add admin checks to admin networking (#1371)
* add admin checks to admin networking * apply admin checks to combat bans too --------- Co-authored-by: pingu7867 <cedric4321@hotmail.com>
1 parent dd4a750 commit 6eb2bfd

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

lua/pac3/editor/server/bans.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,10 @@ function pace.IsBanned(ply)
117117
end
118118

119119
net.Receive("pac.BanUpdate", function(len, ply)
120+
if not ply:IsAdmin() then
121+
return
122+
end
123+
120124
pac.Message("Received ban list update operation from : ", ply)
121125
pac.Message("Time : ", os.date( "%a %X %x", os.time() ))
122126
local playerlist = net.ReadTable()
@@ -131,6 +135,10 @@ net.Receive("pac.BanUpdate", function(len, ply)
131135
end)
132136

133137
net.Receive("pac.RequestBanStates", function(len,ply)
138+
if not ply:IsAdmin() then
139+
return
140+
end
141+
134142
local archive = net.ReadBool()
135143
pac.Message("Received ban list request from : ", ply)
136144
pac.Message("Time : ", os.date( "%a %X %x", os.time() ))

lua/pac3/editor/server/combat_bans.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ if SERVER then
4646
end
4747

4848

49-
net.Receive("pac.CombatBanUpdate", function()
49+
net.Receive("pac.CombatBanUpdate", function(len, player)
50+
if not player:IsAdmin() then
51+
return
52+
end
5053
--get old states first
5154
pac.old_tbl_on_file = get_combat_ban_states()
5255

@@ -80,6 +83,9 @@ net.Receive("pac.CombatBanUpdate", function()
8083
end)
8184

8285
net.Receive("pac.RequestCombatBanStates", function(len, ply)
86+
if not ply:IsAdmin() then
87+
return
88+
end
8389
pac.global_combat_whitelist = get_combat_ban_states()
8490
net.Start("pac.SendCombatBanStates")
8591
net.WriteTable(pac.global_combat_whitelist)

0 commit comments

Comments
 (0)