mirror of
https://github.com/lifestorm/wnsrc.git
synced 2025-12-17 13:53:45 +03:00
Upload
This commit is contained in:
123
lua/pac3/editor/server/bans.lua
Normal file
123
lua/pac3/editor/server/bans.lua
Normal file
@@ -0,0 +1,123 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local function get_bans()
|
||||
local str = file.Read("pac_bans.txt", "DATA")
|
||||
|
||||
local bans = {}
|
||||
|
||||
if str and str ~= "" then
|
||||
bans = util.KeyValuesToTable(str)
|
||||
end
|
||||
|
||||
do -- check if this needs to be rebuilt
|
||||
local k,v = next(bans)
|
||||
if isstring(v) then
|
||||
local temp = {}
|
||||
|
||||
for k,v in pairs(bans) do
|
||||
temp[util.CRC("gm_" .. v .. "_gm")] = {steamid = v, name = k}
|
||||
end
|
||||
|
||||
bans = temp
|
||||
end
|
||||
end
|
||||
|
||||
return bans
|
||||
end
|
||||
|
||||
function pace.Ban(ply)
|
||||
|
||||
ply:ConCommand("pac_clear_parts")
|
||||
|
||||
timer.Simple( 1, function() -- made it a timer because the ConCommand don't run fast enough. - Bizzclaw
|
||||
|
||||
net.Start("pac_submit_acknowledged")
|
||||
net.WriteBool(false)
|
||||
net.WriteString("You have been banned from using pac!")
|
||||
net.Send(ply)
|
||||
|
||||
local bans = get_bans()
|
||||
|
||||
for key, data in pairs(bans) do
|
||||
if ply:SteamID() == data.steamid then
|
||||
bans[key] = nil
|
||||
end
|
||||
end
|
||||
|
||||
bans[ply:UniqueID()] = {steamid = ply:SteamID(), nick = ply:Nick()}
|
||||
|
||||
pace.Bans = bans
|
||||
|
||||
file.Write("pac_bans.txt", util.TableToKeyValues(bans), "DATA")
|
||||
end)
|
||||
end
|
||||
|
||||
function pace.Unban(ply)
|
||||
|
||||
net.Start("pac_submit_acknowledged")
|
||||
net.WriteBool(true)
|
||||
net.WriteString("You are now permitted to use pac!")
|
||||
net.Send(ply)
|
||||
|
||||
local bans = get_bans()
|
||||
|
||||
for key, data in pairs(bans) do
|
||||
if ply:SteamID() == data.steamid then
|
||||
bans[key] = nil
|
||||
end
|
||||
end
|
||||
|
||||
pace.Bans = bans
|
||||
|
||||
file.Write("pac_bans.txt", util.TableToKeyValues(bans), "DATA")
|
||||
end
|
||||
|
||||
local function GetPlayer(target)
|
||||
for key, ply in pairs(player.GetAll()) do
|
||||
if ply:SteamID() == target or ply:UniqueID() == target or ply:Nick():lower():find(target:lower()) then
|
||||
return ply
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
concommand.Add("pac_ban", function(ply, cmd, args)
|
||||
if not next(args) then
|
||||
pac.Message("Please provide one of the following: SteamID, UniqueID or Nick.")
|
||||
return
|
||||
end
|
||||
local target = GetPlayer(args[1])
|
||||
if (not IsValid(ply) or ply:IsAdmin()) and target then
|
||||
pace.Ban(target)
|
||||
pac.Message(ply, " banned ", target, " from PAC.")
|
||||
end
|
||||
end)
|
||||
|
||||
concommand.Add("pac_unban", function(ply, cmd, args)
|
||||
if not next(args) then
|
||||
pac.Message("Please provide one of the following: SteamID, UniqueID or Nick.")
|
||||
return
|
||||
end
|
||||
local target = GetPlayer(args[1])
|
||||
if (not IsValid(ply) or ply:IsAdmin()) and target then
|
||||
pace.Unban(target)
|
||||
pac.Message(ply, " unbanned ", target, " from PAC.")
|
||||
end
|
||||
end)
|
||||
|
||||
function pace.IsBanned(ply)
|
||||
if not ply or not ply:IsValid() then return false end
|
||||
|
||||
if not pace.Bans then
|
||||
pace.Bans = get_bans()
|
||||
end
|
||||
|
||||
return pace.Bans[ply:UniqueID()] ~= nil
|
||||
end
|
||||
105
lua/pac3/editor/server/init.lua
Normal file
105
lua/pac3/editor/server/init.lua
Normal file
@@ -0,0 +1,105 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
pace = pace or {}
|
||||
|
||||
-- for the default models
|
||||
resource.AddWorkshop("104691717")
|
||||
|
||||
pace.luadata = include("pac3/libraries/luadata.lua")
|
||||
pace.Parts = pace.Parts or {}
|
||||
pace.Errors = {}
|
||||
|
||||
do
|
||||
util.AddNetworkString("pac.TogglePartDrawing")
|
||||
|
||||
function pac.TogglePartDrawing(ent, b, who) --serverside interface to clientside function of the same name
|
||||
net.Start("pac.TogglePartDrawing")
|
||||
net.WriteEntity(ent)
|
||||
net.WriteBit(b)
|
||||
if not who then
|
||||
net.Broadcast()
|
||||
else
|
||||
net.Send(who)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function pace.CanPlayerModify(ply, ent)
|
||||
if not IsValid(ply) or not IsValid(ent) then
|
||||
return false
|
||||
end
|
||||
|
||||
if ply == ent then
|
||||
return true
|
||||
end
|
||||
|
||||
if game.SinglePlayer() then
|
||||
return true
|
||||
end
|
||||
|
||||
if ent.CPPICanTool and ent:CPPICanTool(ply, "paint") then
|
||||
return true
|
||||
end
|
||||
|
||||
if ent.CPPIGetOwner and ent:CPPIGetOwner() == ply then
|
||||
return true
|
||||
end
|
||||
|
||||
do
|
||||
local tr = util.TraceLine({ start = ply:EyePos(), endpos = ent:WorldSpaceCenter(), filter = ply })
|
||||
if tr.Entity == ent and hook.Run("CanTool", ply, tr, "paint") == true then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
include("util.lua")
|
||||
include("wear.lua")
|
||||
include("wear_filter.lua")
|
||||
include("bans.lua")
|
||||
include("spawnmenu.lua")
|
||||
include("show_outfit_on_use.lua")
|
||||
|
||||
do
|
||||
util.AddNetworkString("pac_in_editor")
|
||||
|
||||
net.Receive("pac_in_editor", function(_, ply)
|
||||
ply:SetNW2Bool("pac_in_editor", net.ReadBit() == 1)
|
||||
end)
|
||||
|
||||
util.AddNetworkString("pac_in_editor_posang")
|
||||
|
||||
net.Receive("pac_in_editor_posang", function(_, ply)
|
||||
if not ply.pac_last_editor_message then
|
||||
ply.pac_last_editor_message = 0
|
||||
end
|
||||
if ply.pac_last_editor_message > CurTime() then return end
|
||||
ply.pac_last_editor_message = CurTime() + 0.2
|
||||
|
||||
local pos = net.ReadVector()
|
||||
local ang = net.ReadAngle()
|
||||
local part_pos = net.ReadVector()
|
||||
|
||||
net.Start("pac_in_editor_posang", true)
|
||||
net.WriteEntity(ply)
|
||||
net.WriteVector(pos)
|
||||
net.WriteAngle(ang)
|
||||
net.WriteVector(part_pos)
|
||||
net.SendPVS(ply:GetPos())
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
CreateConVar("has_pac3_editor", "1", {FCVAR_NOTIFY})
|
||||
|
||||
resource.AddSingleFile("materials/icon64/pac3.png")
|
||||
676
lua/pac3/editor/server/legacy_network_dictionary_translate.lua
Normal file
676
lua/pac3/editor/server/legacy_network_dictionary_translate.lua
Normal file
@@ -0,0 +1,676 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
return {
|
||||
|
||||
[1076811763] = "is_dupe",
|
||||
[1191326365] = "ClassName",
|
||||
[1225748678] = "part",
|
||||
[2068527459] = "self",
|
||||
[2711073210] = "children",
|
||||
[3479234172] = "owner",
|
||||
[783959845] = "player_uid",
|
||||
|
||||
[100787502] = "fleshsubsurfacetexture",
|
||||
[1020291948] = "Radius",
|
||||
[102079488] = "LightWarpTexture",
|
||||
[1021315175] = "StartAlpha",
|
||||
[1022140656] = "flesheffectcenterradius1",
|
||||
[1025052663] = "suppress_decals",
|
||||
[1031186024] = "MaxPitch",
|
||||
[1045412760] = "EmissiveBlendTint",
|
||||
[1063510319] = "blendtintbybasealpha",
|
||||
[1079863564] = "DrawWeapon",
|
||||
[1081499344] = "CollideWithOwner",
|
||||
[1083824756] = "FarZ",
|
||||
[1090045300] = "emissiveblendstrength",
|
||||
[1096474325] = "sheenmap",
|
||||
[1099352106] = "BaseTextureScale",
|
||||
[1100049831] = "MinimumRadius",
|
||||
[1104142786] = "FollowPartUID",
|
||||
[1110368737] = "DrawOrder",
|
||||
[1113161297] = "PoseParameter",
|
||||
[1116685109] = "FollowPart",
|
||||
[114277299] = "PointC",
|
||||
[114400132] = "Length",
|
||||
[1154474433] = "ConstrainX",
|
||||
[1162527309] = "ambientonly",
|
||||
[1165467388] = "BloodColor",
|
||||
[1177992464] = "detailscale",
|
||||
[1196430393] = "Collide",
|
||||
[1199526629] = "outline",
|
||||
[1202631935] = "Velocity",
|
||||
[1207855863] = "AmbientOcclusionTexture",
|
||||
[1208336382] = "PlayerAngles",
|
||||
[1212418031] = "bumptransformAngle",
|
||||
[1215714457] = "FinLiftMode",
|
||||
[1221564783] = "phongwarptexture",
|
||||
[1222901307] = "InnerAngle",
|
||||
[1224948332] = "FinCline",
|
||||
[1228198681] = "compress",
|
||||
[1237391457] = "flashlighttextureframe",
|
||||
[1238953138] = "HidePhysgunBeam",
|
||||
[1249613445] = "basetexturetransformPosition",
|
||||
[1252061369] = "HorizontalFOV",
|
||||
[125937960] = "Jump",
|
||||
[1261109621] = "BumpMap",
|
||||
[1261992767] = "ConstantVelocity",
|
||||
[127573335] = "EmissiveBlendTexture",
|
||||
[1280306369] = "envmapmode",
|
||||
[1283871871] = "flesheffectcenterradius4",
|
||||
[1285932729] = "distancealphafromdetail",
|
||||
[1288785580] = "FleshInteriorTexture",
|
||||
[1294740419] = "iris",
|
||||
[1295479485] = "OverridePosition",
|
||||
[1299096975] = "NoWorld",
|
||||
[1299602945] = "cloakpassenabled",
|
||||
[1306211566] = "Texture",
|
||||
[1306225195] = "Width",
|
||||
[1316359440] = "UseLua",
|
||||
[133378496] = "outlinecolor",
|
||||
[1350790561] = "ParticleAngleVelocity",
|
||||
[1351414674] = "DetailBlendMode",
|
||||
[1359751819] = "ParticleAngle",
|
||||
[1366251103] = "DuckSpeed",
|
||||
[136747755] = "multipass",
|
||||
[13726709] = "nodiffusebumplighting",
|
||||
[1380349261] = "Range",
|
||||
[1381327793] = "Sphere",
|
||||
[1381580842] = "ConstrainPitch",
|
||||
[1385904101] = "AlignToSurface",
|
||||
[1388988026] = "UserData",
|
||||
[13906112] = "SphericalSize",
|
||||
[1404127492] = "normalmap2",
|
||||
[1408682351] = "ParentUID",
|
||||
[1420980032] = "no_draw",
|
||||
[1423777818] = "detailtint",
|
||||
[1427089258] = "AimDir",
|
||||
[1430631481] = "scaleoutlinesoftnessbasedonscreenres",
|
||||
[1430956612] = "flat",
|
||||
[1475057037] = "sheenmapmaskoffsety",
|
||||
[1475513172] = "Size",
|
||||
[1477136694] = "lightwarptexture",
|
||||
[1486876184] = "TextureFrame",
|
||||
[1511310547] = "BaseTexture",
|
||||
[1527308877] = "vertexalphatest",
|
||||
[1527723453] = "ambientoccltexture",
|
||||
[1529787366] = "eyeballradius",
|
||||
[153870497] = "FleshDebugForceFleshOn",
|
||||
[1545096391] = "DrawShadow",
|
||||
[1547209979] = "PhongTint",
|
||||
[1553467512] = "RandomPitch",
|
||||
[1563474897] = "AlphaTest",
|
||||
[1570418372] = "AnimationRate",
|
||||
[1572572351] = "FleshNormalTexture",
|
||||
[1572922901] = "Color1",
|
||||
[1579039006] = "refracttinttextureframe",
|
||||
[1581292695] = "CellShade",
|
||||
[1587990502] = "Offset",
|
||||
[1589148299] = "Start",
|
||||
[1595671388] = "Overlapping",
|
||||
[1597486773] = "flashlighttexture",
|
||||
[159830115] = "fleshglossbrightness",
|
||||
[160765680] = "FilterFraction",
|
||||
[1616823508] = "ActRangeAttack1",
|
||||
[1635297824] = "selfillummask",
|
||||
[1639766413] = "seamless_detail",
|
||||
[1647506049] = "Selfillum",
|
||||
[1657866020] = "URL",
|
||||
[1667545098] = "TargetPartUID",
|
||||
[1688468960] = "LifeTime",
|
||||
[1702818780] = "Angles",
|
||||
[1713137144] = "Spacing",
|
||||
[1716930793] = "color",
|
||||
[1747493843] = "halflambert",
|
||||
[1748754976] = "Run",
|
||||
[1756575192] = "NumberParticles",
|
||||
[1756738751] = "OutlineAlpha",
|
||||
[1760996810] = "BlendTintByBaseAlpha",
|
||||
[1766098085] = "irisv",
|
||||
[1767680427] = "FleshBorderSoftness",
|
||||
[1779579145] = "nolod",
|
||||
[1785337431] = "UseWeaponColor",
|
||||
[1803606517] = "Phong",
|
||||
[1808658128] = "glowstart",
|
||||
[181643838] = "UniqueID",
|
||||
[1822259635] = "EnvMapMode",
|
||||
[1822771111] = "debug",
|
||||
[1823988912] = "InputMultiplier",
|
||||
[1835620746] = "edgesoftnessstart",
|
||||
[1840448085] = "StickToSurface",
|
||||
[1841733856] = "ExectueOnShow",
|
||||
[1853286158] = "NoDraw",
|
||||
[1855955664] = "Weapon",
|
||||
[1857803419] = "nocull",
|
||||
[1864389370] = "fresnelreflection",
|
||||
[186789201] = "fleshbordertexture1d",
|
||||
[1869147073] = "Orthographic",
|
||||
[1870691467] = "FleshSubsurfaceTexture",
|
||||
[1872249158] = "Follow",
|
||||
[1875565421] = "ModelFallback",
|
||||
[1878085130] = "FollowPartName",
|
||||
[1886367387] = "UsePlayerColor",
|
||||
[1889299241] = "BoneMerge",
|
||||
[1889970156] = "Font",
|
||||
[1892605006] = "EyeAnglesLerp",
|
||||
[1899496415] = "ConstrainSphere",
|
||||
[1908968229] = "PointB",
|
||||
[1912561071] = "OwnerVelocityMultiplier",
|
||||
[1914650335] = "VelocityToViewAngles",
|
||||
[1916030699] = "SelfillumMask",
|
||||
[1919609898] = "Attract",
|
||||
[1931874443] = "ModelModifiers",
|
||||
[1935388575] = "Delay",
|
||||
[1949158587] = "AttractRadius",
|
||||
[1951887127] = "StopRadius",
|
||||
[1953937788] = "selfillumfresnelminmaxexp",
|
||||
[1963527648] = "phongfresnelranges",
|
||||
[1963915452] = "envmapcontrast",
|
||||
[1969067402] = "Rimlight",
|
||||
[198239607] = "edgesoftnessend",
|
||||
[1986147915] = "MaxSpeedDamp",
|
||||
[1988138791] = "Selfillum_Envmapmask_Alpha",
|
||||
[1994059780] = "detailtexturetransformAngle",
|
||||
[1996646023] = "PlayerOwner",
|
||||
[2010458333] = "UseLegacyScale",
|
||||
[2010856791] = "ResetVelocitiesOnHide",
|
||||
[2014274444] = "VolumeLFOAmount",
|
||||
[201810811] = "AddFrametimeLife",
|
||||
[2022803527] = "bumptransformAngleCenter",
|
||||
[2027003763] = "Collisions",
|
||||
[2028067246] = "ColorTint_Tmp",
|
||||
[2032645517] = "Arguments",
|
||||
[2039881014] = "AttractMode",
|
||||
[205696537] = "RimlightExponent",
|
||||
[2065278286] = "Spread",
|
||||
[2071291059] = "Override",
|
||||
[2076886321] = "fleshbordersoftness",
|
||||
[2084456166] = "fleshnormaltexture",
|
||||
[2089246144] = "warpparam",
|
||||
[2097184418] = "AffectChildrenOnly",
|
||||
[2124224297] = "ModelIndex",
|
||||
[2126483307] = "FOV",
|
||||
[2130420070] = "phongtint",
|
||||
[2131789398] = "OuterVolume",
|
||||
[2132861502] = "StartLength",
|
||||
[2133451414] = "Duration",
|
||||
[2139599550] = "EndLength",
|
||||
[2145292295] = "Rate",
|
||||
[2146670156] = "alphatest",
|
||||
[2149804402] = "detailblendfactor",
|
||||
[2155233785] = "FleshScrollSpeed",
|
||||
[2162269484] = "envmapNoHDR",
|
||||
[2169069517] = "BlurSpacing",
|
||||
[2172035691] = "use_in_fillrate_mode",
|
||||
[2187726194] = "texture",
|
||||
[2192070255] = "fleshinteriornoisetexture",
|
||||
[2196266252] = "ConstrainRoll",
|
||||
[219726482] = "basetexturetransformAngle",
|
||||
[2198807142] = "LevelOfDetail",
|
||||
[2208170016] = "IgnoreOwner",
|
||||
[2213789594] = "JiggleAngle",
|
||||
[2216901808] = "MuteSounds",
|
||||
[2217606683] = "Air",
|
||||
[2218327336] = "EnvMapMask",
|
||||
[2219830704] = "SwimIdle",
|
||||
[2240868719] = "Bounce",
|
||||
[2241851621] = "StickEndSize",
|
||||
[2243556946] = "CrouchIdle",
|
||||
[2244483011] = "Material",
|
||||
[2249424691] = "OuterAngle",
|
||||
[2252036822] = "outlineend0",
|
||||
[2267036619] = "FleshBorderWidth",
|
||||
[226825662] = "AddOwnerSpeed",
|
||||
[2268636547] = "Translucent",
|
||||
[2269412568] = "normalmapalphaenvmapmask",
|
||||
[2269939838] = "InvertFrames",
|
||||
[2294442873] = "Outline",
|
||||
[2296450635] = "LodOverride",
|
||||
[229655782] = "normalmap",
|
||||
[2299360628] = "Amount",
|
||||
[2299685159] = "seamless_scale",
|
||||
[2307504008] = "ColorTint_Base",
|
||||
[230775901] = "Data",
|
||||
[2307923604] = "TextureFilter",
|
||||
[2314435604] = "sheenmapmaskdirection",
|
||||
[2315684609] = "PingPongLoop",
|
||||
[2320923108] = "StartColor",
|
||||
[2325995266] = "Selfillum_EnvMapMask_Alpha",
|
||||
[2332551640] = "MuteFootsteps",
|
||||
[2343764982] = "Damping",
|
||||
[2347308090] = "PhongExponent",
|
||||
[2347713615] = "envmapsphere",
|
||||
[2351691740] = "rimlight",
|
||||
[2356986845] = "fleshcubetexture",
|
||||
[2361627006] = "NormalMapAlphaEnvMapMask",
|
||||
[2372710726] = "detailtexturetransformAngleCenter",
|
||||
[23797187] = "DetailScale",
|
||||
[2381693933] = "EndPointName",
|
||||
[238564812] = "AlternativeRate",
|
||||
[239372004] = "PitchLFOAmount",
|
||||
[23966416] = "Loop",
|
||||
[2403468563] = "DeathRagdollizeParent",
|
||||
[2424072824] = "HideRagdollOnDeath",
|
||||
[2427847608] = "Duplicate",
|
||||
[2429118223] = "PlayCount",
|
||||
[2434391136] = "Shadows",
|
||||
[2442836657] = "PauseOnHide",
|
||||
[245483896] = "Owner",
|
||||
[2457472943] = "FleshBorderNoiseScale",
|
||||
[245941972] = "AnimationType",
|
||||
[2464347062] = "glowcolor",
|
||||
[2467927080] = "PointDUID",
|
||||
[2470426476] = "SecondsToArrive",
|
||||
[2477553126] = "EmissiveBlendBaseTexture",
|
||||
[2480406194] = "OutfitPartName",
|
||||
[2483228587] = "StartSize",
|
||||
[248425617] = "PointCUID",
|
||||
[2492705487] = "AimPartUID",
|
||||
[2494345416] = "vertexalpha",
|
||||
[249530136] = "fadeoutonsilhouette",
|
||||
[2497330934] = "Jiggle",
|
||||
[2498046961] = "Sticky",
|
||||
[2499943728] = "NoCulling",
|
||||
[2503655295] = "PositionOffset",
|
||||
[2504967853] = "ScaleChildren",
|
||||
[2506526918] = "TextureStretch",
|
||||
[2507411529] = "Bone",
|
||||
[2510298171] = "Gravity",
|
||||
[2511021039] = "sheenmapmaskframe",
|
||||
[2511903858] = "BlendTintColorOverBase",
|
||||
[2519455027] = "Brightness",
|
||||
[2524680267] = "distancealpha",
|
||||
[2527625975] = "RootOwner",
|
||||
[2532097615] = "glowy",
|
||||
[2540525009] = "Expression",
|
||||
[2545356115] = "ReloadCrouch",
|
||||
[2551912729] = "StopOtherAnimations",
|
||||
[2553440258] = "MaxAngular",
|
||||
[2560789589] = "Flex",
|
||||
[2561355280] = "PointD",
|
||||
[2568140703] = "String",
|
||||
[2570476336] = "Min",
|
||||
[2585628809] = "detailtexturetransformScale",
|
||||
[2589223512] = "corneatexture",
|
||||
[2610384354] = "phongexponenttexture",
|
||||
[2610874064] = "PitchLFOTime",
|
||||
[2612037735] = "EndAlpha",
|
||||
[2612376555] = "refracttint",
|
||||
[2612594937] = "Text",
|
||||
[2618392030] = "fleshbordernoisescale",
|
||||
[2619913426] = "AllowOggWhenMuted",
|
||||
[2621544536] = "DefaultOnHide",
|
||||
[2627599123] = "PhongFresnelRanges",
|
||||
[2630596920] = "fleshsubsurfacetint",
|
||||
[2639742899] = "AttackCrouchPrimaryfire",
|
||||
[2645882096] = "ZeroEyePitch",
|
||||
[2648461065] = "PointCName",
|
||||
[2655015979] = "OwnerName",
|
||||
[2655084767] = "invertphongmask",
|
||||
[2655975514] = "FleshInteriorEnabled",
|
||||
[2689828446] = "Ground",
|
||||
[2693580309] = "NoModel",
|
||||
[2696701625] = "PointBName",
|
||||
[270362173] = "depthblend",
|
||||
[2704002686] = "Doppler",
|
||||
[2704213808] = "parallaxstrength",
|
||||
[2711406660] = "Strain",
|
||||
[2722139334] = "ignore_alpha_modulation",
|
||||
[2722875168] = "Skin",
|
||||
[2726990886] = "CloakFactor",
|
||||
[2732657383] = "EmissiveBlendFlowTexture",
|
||||
[2734613864] = "rimlightboost",
|
||||
[2745527887] = "EndSize",
|
||||
[275204260] = "DamageType",
|
||||
[27535956] = "translucent",
|
||||
[2759158581] = "SuppressFrames",
|
||||
[2760075106] = "bumptransformScale",
|
||||
[2760784560] = "Frequency",
|
||||
[2764530714] = "PointAUID",
|
||||
[2766825562] = "envmapmask",
|
||||
[2770239416] = "DoubleFace",
|
||||
[2772132969] = "Max",
|
||||
[2773904166] = "SubMaterialId",
|
||||
[2775049079] = "FallApartOnDeath",
|
||||
[2777523306] = "phongboost",
|
||||
[2783310154] = "flesheffectcenterradius2",
|
||||
[2790218405] = "AmbientOcclusion",
|
||||
[2790617357] = "AllowZVelocity",
|
||||
[2799845852] = "basealphaenvmapmask",
|
||||
[2811717613] = "Color",
|
||||
[2818751691] = "fleshbordertint",
|
||||
[2826786425] = "sheenmapmask",
|
||||
[2837103662] = "RefractAmount",
|
||||
[2845320476] = "MaterialOverride",
|
||||
[2856449777] = "phong",
|
||||
[2859513395] = "PlayOnFootstep",
|
||||
[2864808173] = "ConstrainZ",
|
||||
[2868056120] = "UseEndpointOffsets",
|
||||
[2868953825] = "sheenpassenabled",
|
||||
[2870201270] = "StandIdle",
|
||||
[2873080202] = "BulletImpact",
|
||||
[287381102] = "Alpha",
|
||||
[2874029347] = "HideEntity",
|
||||
[2875597873] = "Path",
|
||||
[2880540790] = "SlotWeight",
|
||||
[2897121259] = "WidthBendSize",
|
||||
[2900648379] = "SizeY",
|
||||
[2906761383] = "BaseTextureAngle",
|
||||
[290789797] = "fleshinteriortexture",
|
||||
[2912286735] = "StickEndAlpha",
|
||||
[2918809477] = "refracttinttexture",
|
||||
[29234718] = "AirFriction",
|
||||
[2937253556] = "localrefractdepth",
|
||||
[295005948] = "AimPartName",
|
||||
[2961561047] = "PositionSpread",
|
||||
[2974105667] = "outlinealpha",
|
||||
[2982974660] = "Effect",
|
||||
[2995653722] = "Resolution",
|
||||
[2995890130] = "Interpolation",
|
||||
[2999436126] = "SelfCollision",
|
||||
[300286009] = "RollDelta",
|
||||
[3013936484] = "sheenmapmaskscalex",
|
||||
[3015686426] = "EyeTargetUID",
|
||||
[3052944589] = "frame",
|
||||
[3056118896] = "allowalphatocoverage",
|
||||
[3056839399] = "MaxAirSpeed",
|
||||
[3060607055] = "Darken",
|
||||
[3060976628] = "PointBUID",
|
||||
[3068149764] = "RandomRollSpeed",
|
||||
[3073810188] = "Echo",
|
||||
[3073827385] = "WidthBend",
|
||||
[3076101386] = "opaquetexture",
|
||||
[3078372176] = "phongalbedotint",
|
||||
[3078601052] = "NoLighting",
|
||||
[3091768899] = "EmissiveBlendScrollVector",
|
||||
[3101336424] = "vertexcolormodulate",
|
||||
[311612122] = "FireDelay",
|
||||
[3123552686] = "GroundFriction",
|
||||
[31331793] = "MaximumRadius",
|
||||
[3149040884] = "DetailTint",
|
||||
[3164026182] = "outlinestart1",
|
||||
[3168501257] = "bumpmap",
|
||||
[3168695210] = "AlternativeScaling",
|
||||
[318312488] = "ReloadStand",
|
||||
[3185819868] = "DieTime",
|
||||
[3191261416] = "Volume",
|
||||
[3195858990] = "glowend",
|
||||
[3210380963] = "Position",
|
||||
[3210927238] = "BlurX",
|
||||
[3215971424] = "Sliding",
|
||||
[3220792405] = "Pow",
|
||||
[322269848] = "basetexture",
|
||||
[3228764313] = "linearwrite",
|
||||
[3250695889] = "StickStartAlpha",
|
||||
[3252764057] = "phongexponent",
|
||||
[3254932247] = "bumptransformPosition",
|
||||
[325620535] = "CloakPassEnabled",
|
||||
[3272832927] = "DampFactor",
|
||||
[3278221977] = "color2",
|
||||
[3280264308] = "TranslucentX",
|
||||
[32833283] = "stretch",
|
||||
[3284840275] = "fleshinteriorenabled",
|
||||
[328655192] = "Noclip",
|
||||
[3287782131] = "BlurFiltering",
|
||||
[3288592966] = "3D",
|
||||
[3290824561] = "EditorExpand",
|
||||
[3291899302] = "znearer",
|
||||
[3298964978] = "sheenmapmaskscaley",
|
||||
[3301554095] = "Color2",
|
||||
[3309610943] = "srgbtint",
|
||||
[3323140843] = "PhongExponentTexture",
|
||||
[3339354943] = "localrefract",
|
||||
[3347082725] = "EnvMapContrast",
|
||||
[3347359863] = "ParentName",
|
||||
[3362097708] = "bumpcompress",
|
||||
[3362122768] = "BlurY",
|
||||
[3362723860] = "Fallback",
|
||||
[3363468630] = "ResetOnHide",
|
||||
[3369233247] = "SelfillumFresnlenMinMaxExp",
|
||||
[3369354170] = "CenterAttraction",
|
||||
[3373163503] = "FilterType",
|
||||
[3380016481] = "LightBlend",
|
||||
[3388936124] = "FinEfficiency",
|
||||
[3396130544] = "VariableName",
|
||||
[3399182291] = "WalkSpeed",
|
||||
[3402293178] = "IsDisturbing",
|
||||
[3404345144] = "emissiveblendtexture",
|
||||
[3415213520] = "outlinestart0",
|
||||
[3424774496] = "EyeAngles",
|
||||
[3425825880] = "Mass",
|
||||
[3428410754] = "FollowAnglesOnly",
|
||||
[3446009287] = "AttackStandPrimaryfire",
|
||||
[3460941471] = "Stretch",
|
||||
[3467113162] = "masked",
|
||||
[3471299058] = "Speed",
|
||||
[3483905723] = "FleshBorderTint",
|
||||
[3490224934] = "alphatestreference",
|
||||
[3491011159] = "fleshscrollspeed",
|
||||
[3493953945] = "RimlightBoost",
|
||||
[3503728928] = "PhongAlbedoTint",
|
||||
[3504355690] = "alpha",
|
||||
[3529641707] = "FleshCubeTexture",
|
||||
[3533715801] = "EnvMap",
|
||||
[3538076124] = "flesheffectcenterradius3",
|
||||
[35382841] = "cloakcolortint",
|
||||
[3554452859] = "NoTextureFiltering",
|
||||
[3555790875] = "VertexAlpha",
|
||||
[3557570834] = "CrouchWalk",
|
||||
[3558548301] = "decal",
|
||||
[3559176154] = "ambientocclcolor",
|
||||
[3562291122] = "ActLand",
|
||||
[3571629350] = "FleshGlossBrightness",
|
||||
[3572019749] = "forcerefract",
|
||||
[3573885857] = "EmissiveBlendEnabled",
|
||||
[3579762028] = "EnvMapTint",
|
||||
[3580580754] = "RelativeBones",
|
||||
[3582205125] = "RemoveOnCollide",
|
||||
[3587230874] = "Maximum",
|
||||
[3593577359] = "InverseKinematics",
|
||||
[3608746186] = "FleshSubsurfaceTint",
|
||||
[3609698214] = "Code",
|
||||
[3611484261] = "fleshborderwidth",
|
||||
[3613180849] = "StickStartSize",
|
||||
[3616895705] = "model",
|
||||
[3623967811] = "AirResistance",
|
||||
[3624428921] = "IgnoreZ",
|
||||
[36256171] = "emissiveblendflowtexture",
|
||||
[3626359763] = "flashlightnolambert",
|
||||
[3627612281] = "SlotName",
|
||||
[3639218737] = "EchoDelay",
|
||||
[364119328] = "EchoFeedback",
|
||||
[3653155542] = "blendtintcoloroverbase",
|
||||
[3653708971] = "fleshglobalopacity",
|
||||
[365946439] = "MaxSpeed",
|
||||
[3664816097] = "HideBullets",
|
||||
[3675654537] = "MinPitch",
|
||||
[3689107757] = "SizeX",
|
||||
[3719121240] = "EnvMapMaskScale",
|
||||
[3724789052] = "OutlineColor",
|
||||
[3740738969] = "OutfitPartUID",
|
||||
[374627805] = "Model",
|
||||
[3751602517] = "corneabumpstrength",
|
||||
[3756635115] = "envmapsaturation",
|
||||
[375673178] = "Damage",
|
||||
[3767786107] = "WeaponHoldType",
|
||||
[3770904610] = "selfillum",
|
||||
[3789529631] = "basetexturetransformScale",
|
||||
[3790311129] = "glowx",
|
||||
[3792418610] = "rimlightexponent",
|
||||
[3803564364] = "bumpframe",
|
||||
[382817369] = "PhongWarpTexture",
|
||||
[3838112954] = "DistanceAlpha",
|
||||
[3850296099] = "BaseTexturePosition",
|
||||
[3862676233] = "additive",
|
||||
[3864957405] = "Pitch",
|
||||
[3872259023] = "UnlockPitch",
|
||||
[3876283572] = "EyeTargetName",
|
||||
[3877379177] = "PointAName",
|
||||
[3886387638] = "Passes",
|
||||
[3888625542] = "CrouchSpeed",
|
||||
[3902550134] = "EyeTarget",
|
||||
[3905018527] = "PointA",
|
||||
[3911318520] = "JigglePosition",
|
||||
[3915127474] = "Amplitude",
|
||||
[3934040341] = "glow",
|
||||
[3955665290] = "BlurLength",
|
||||
[3955731083] = "Multiplier",
|
||||
[3961566551] = "receiveflashlight",
|
||||
[3964430251] = "DrawPlayerOnDeath",
|
||||
[3978266206] = "fleshdebugforcefleshon",
|
||||
[3980491407] = "envmap",
|
||||
[3984299289] = "wireframe",
|
||||
[3988566908] = "CloakColorTint",
|
||||
[3988721371] = "VolumeLFOTime",
|
||||
[3993258444] = "StickToGround",
|
||||
[4005234647] = "bumpstretch",
|
||||
[4006412890] = "DrawViewModel",
|
||||
[4021008510] = "AffectChildren",
|
||||
[4024739081] = "Bend",
|
||||
[4025760937] = "UseParticleTracer",
|
||||
[4031632671] = "irisu",
|
||||
[4045073016] = "BaseTextureAngleCenter",
|
||||
[4047268416] = "outlineend1",
|
||||
[4050194015] = "SequenceName",
|
||||
[4068251502] = "Style",
|
||||
[407122208] = "envmapframe",
|
||||
[4071891638] = "StickLifetime",
|
||||
[4072346765] = "NearZ",
|
||||
[4073739642] = "SpawnEntity",
|
||||
[4074889273] = "Height",
|
||||
[4078496411] = "TrailPath",
|
||||
[408731570] = "AlternativeBones",
|
||||
[410360270] = "emissiveblendenabled",
|
||||
[410628504] = "LoadVmt",
|
||||
[410702523] = "basemapalphaphongmask",
|
||||
[4116696577] = "eyeorigin",
|
||||
[4119253790] = "depthblendscale",
|
||||
[4119609374] = "envmaptint",
|
||||
[4120506060] = "OwnerCycle",
|
||||
[4122548018] = "OwnerEntity",
|
||||
[4122897393] = "Invert",
|
||||
[4130807097] = "SelfillumFresnel",
|
||||
[4132084891] = "RunSpeed",
|
||||
[4135986248] = "InputDivider",
|
||||
[4142526270] = "rimmask",
|
||||
[4148491794] = "VelocityRoughness",
|
||||
[4151342750] = "dudvmap",
|
||||
[4151359135] = "ConstrainYaw",
|
||||
[4164783995] = "entityorigin",
|
||||
[4165134066] = "FleshGlobalOpacity",
|
||||
[4179328573] = "sheenmaptint",
|
||||
[4180692025] = "AimPart",
|
||||
[4188075353] = "hdrcolorscale",
|
||||
[419301429] = "irisframe",
|
||||
[4195501556] = "SpritePath",
|
||||
[4201426897] = "TargetPartName",
|
||||
[4201588131] = "Event",
|
||||
[4203405457] = "detailblendmode",
|
||||
[4233617135] = "MaxGroundSpeed",
|
||||
[4243931689] = "EndPoint",
|
||||
[424808130] = "basetexturetransformAngleCenter",
|
||||
[4248310283] = "EndPointUID",
|
||||
[4262580536] = "Name",
|
||||
[4263455099] = "VerticalFOV",
|
||||
[4270648677] = "nofog",
|
||||
[4290238655] = "separatedetailuvs",
|
||||
[4294355676] = "FleshInteriorNoiseTexture",
|
||||
[429871315] = "FixedSize",
|
||||
[434541590] = "Materials",
|
||||
[434707923] = "Input",
|
||||
[436585760] = "intro",
|
||||
[457408266] = "TextureScroll",
|
||||
[461806449] = "BoneIndex",
|
||||
[465977310] = "gammacolorread",
|
||||
[47348911] = "PositionSpread2",
|
||||
[485609692] = "Shape",
|
||||
[491592698] = "LocalVelocity",
|
||||
[491912776] = "RandomColor",
|
||||
[497241101] = "OutfitPart",
|
||||
[499682029] = "refractamount",
|
||||
[51955875] = "MaxAngularDamp",
|
||||
[525181279] = "Additive",
|
||||
[52881986] = "SoundLevel",
|
||||
[529048665] = "detailframe",
|
||||
[536679825] = "dilation",
|
||||
[545579439] = "FleshBorderTexture1D",
|
||||
[552379675] = "sheenmapmaskoffsetx",
|
||||
[554243480] = "HalfLambert",
|
||||
[555957045] = "forcealphawrite",
|
||||
[572178763] = "vertexcolor",
|
||||
[5726647] = "BlendMode",
|
||||
[584367692] = "no_debug_override",
|
||||
[592602799] = "SelfillumTint",
|
||||
[599400135] = "cloakfactor",
|
||||
[601550850] = "HideMesh",
|
||||
[605808423] = "TargetPart",
|
||||
[606182201] = "seamless_base",
|
||||
[609518133] = "glowalpha",
|
||||
[615666844] = "raytracesphere",
|
||||
[624765380] = "Axis",
|
||||
[6377591] = "Weight",
|
||||
[655049087] = "Sitting",
|
||||
[665949449] = "softedges",
|
||||
[678534180] = "BaseAlphaEnvMapMask",
|
||||
[699038373] = "Detail",
|
||||
[720518801] = "envmapcameraspace",
|
||||
[722569406] = "PhongBoost",
|
||||
[738174289] = "detailtexturetransformPosition",
|
||||
[738569664] = "ReversePitch",
|
||||
[741620047] = "scaleedgesoftnessbasedonscreenres",
|
||||
[744834810] = "sheenindex",
|
||||
[747255451] = "Class",
|
||||
[748443611] = "TintColor",
|
||||
[752581677] = "ignorez",
|
||||
[753615260] = "bluramount",
|
||||
[755431908] = "EndColor",
|
||||
[755434297] = "albedo",
|
||||
[763824768] = "Scale",
|
||||
[765711723] = "Walk",
|
||||
[76905957] = "ExectueOnWear",
|
||||
[772177811] = "detail",
|
||||
[774649796] = "RollAmount",
|
||||
[777998942] = "Physical",
|
||||
[780061838] = "Swim",
|
||||
[78016324] = "StopOnHide",
|
||||
[782008594] = "SprintSpeed",
|
||||
[78341141] = "Hide",
|
||||
[783638488] = "selfillumfresnel",
|
||||
[785434071] = "Operator",
|
||||
[799765487] = "selfillum_envmapmask_alpha",
|
||||
[800117097] = "DetailBlendFactor",
|
||||
[805081881] = "PointDName",
|
||||
[807305828] = "selfillumtint",
|
||||
[813694416] = "BonePower",
|
||||
[81975224] = "LocalPlayerOnly",
|
||||
[820252378] = "Box",
|
||||
[841983231] = "emissiveblendtint",
|
||||
[847148837] = "Lighting",
|
||||
[847995095] = "MoveChildrenToOrigin",
|
||||
[862209706] = "emissiveblendbasetexture",
|
||||
[868798807] = "ConstrainY",
|
||||
[869823595] = "Function",
|
||||
[875804561] = "GestureName",
|
||||
[881024350] = "JumpHeight",
|
||||
[888504499] = "EnvMapSaturation",
|
||||
[892946837] = "DoubleSided",
|
||||
[908225605] = "BodyGroupName",
|
||||
[912703237] = "noalphamod",
|
||||
[916203062] = "Fullbright",
|
||||
[945363216] = "DamageRadius",
|
||||
[947603807] = "AmbientOcclusionColor",
|
||||
[951154001] = "End",
|
||||
[961539200] = "Sound",
|
||||
[962069675] = "emissiveblendscrollvector",
|
||||
[968192046] = "DrawManual",
|
||||
[968774113] = "InvertHideMesh",
|
||||
[975332729] = "Parent",
|
||||
[985864094] = "AngleOffset",
|
||||
}
|
||||
11
lua/pac3/editor/server/show_outfit_on_use.lua
Normal file
11
lua/pac3/editor/server/show_outfit_on_use.lua
Normal file
@@ -0,0 +1,11 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
CreateConVar("pac_onuse_only_force", "0", bit.bor(FCVAR_ARCHIVE, FCVAR_REPLICATED), "Forces the default for onuse to be ON on players that have not enabled the override.")
|
||||
31
lua/pac3/editor/server/spawnmenu.lua
Normal file
31
lua/pac3/editor/server/spawnmenu.lua
Normal file
@@ -0,0 +1,31 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
concommand.Add("pac_in_editor", function(ply, _, args)
|
||||
ply:SetNWBool("in pac3 editor", tonumber(args[1]) == 1)
|
||||
end)
|
||||
|
||||
function pace.SpawnPart(ply, model)
|
||||
if pace.suppress_prop_spawn then return end
|
||||
if model then
|
||||
if IsValid(ply) and ply:GetNWBool("in pac3 editor") then
|
||||
net.Start("pac_spawn_part")
|
||||
net.WriteString(model)
|
||||
net.Send(ply)
|
||||
return false
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
pac.AddHook( "PlayerSpawnProp", "pac_PlayerSpawnProp", pace.SpawnPart)
|
||||
pac.AddHook( "PlayerSpawnRagdoll", "pac_PlayerSpawnRagdoll", pace.SpawnPart)
|
||||
pac.AddHook( "PlayerSpawnEffect", "pac_PlayerSpawnEffect", pace.SpawnPart)
|
||||
|
||||
util.AddNetworkString("pac_spawn_part")
|
||||
68
lua/pac3/editor/server/util.lua
Normal file
68
lua/pac3/editor/server/util.lua
Normal file
@@ -0,0 +1,68 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
function pace.dprint(fmt, ...)
|
||||
if pace.debug then
|
||||
MsgN("\n")
|
||||
MsgN(">>>PAC3>>>")
|
||||
MsgN(fmt:format(...))
|
||||
if pace.debug_trace then
|
||||
MsgN("==TRACE==")
|
||||
debug.Trace()
|
||||
MsgN("==TRACE==")
|
||||
end
|
||||
MsgN("<<<PAC3<<<")
|
||||
MsgN("\n")
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
function pace.CallHook(str, ...)
|
||||
return hook.Call("pac_" .. str, GAMEMODE, ...)
|
||||
end
|
||||
|
||||
|
||||
local function wrap_err(ok,...)
|
||||
if not ok then
|
||||
ErrorNoHalt(tostring((...)) .. "\n")
|
||||
end
|
||||
return ...
|
||||
end
|
||||
|
||||
function pace.PCallCriticalFunction(ply, func, ...)
|
||||
if ply.pac_pcall_last_error and ply.pac_pcall_last_error + 1 > SysTime() then
|
||||
local time = RealTime()
|
||||
if not ply.pac_pcall_next_print or ply.pac_pcall_next_print < time then
|
||||
pac.Message("cannot handle net message from ", ply, " because it errored less than 1 second ago")
|
||||
ply.pac_pcall_next_print = time + 1
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local ok, msg = xpcall(func, function(msg)
|
||||
debug.Trace()
|
||||
end, ...)
|
||||
|
||||
if ok then
|
||||
return ok, msg
|
||||
end
|
||||
|
||||
pac.Message("net receive error from ", ply, ": ", msg)
|
||||
|
||||
ply.pac_pcall_last_error = SysTime()
|
||||
|
||||
return false
|
||||
end
|
||||
|
||||
function pace.PCallNetReceive(receive, id, func)
|
||||
receive(id, function(len, ply, ...)
|
||||
pace.PCallCriticalFunction(ply, func, len, ply, ...)
|
||||
end)
|
||||
end
|
||||
455
lua/pac3/editor/server/wear.lua
Normal file
455
lua/pac3/editor/server/wear.lua
Normal file
@@ -0,0 +1,455 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
local next = next
|
||||
local type = type
|
||||
local istable = istable
|
||||
local IsValid = IsValid
|
||||
local tostring = tostring
|
||||
local isfunction = isfunction
|
||||
local ProtectedCall = ProtectedCall
|
||||
|
||||
pace.StreamQueue = pace.StreamQueue or {}
|
||||
|
||||
timer.Create("pac_check_stream_queue", 0.1, 0, function()
|
||||
local item = table.remove(pace.StreamQueue)
|
||||
if not item then return end
|
||||
|
||||
local data = item.data
|
||||
local filter = item.filter
|
||||
local callback = item.callback
|
||||
|
||||
local allowed, reason
|
||||
local function submitPart()
|
||||
allowed, reason = pace.SubmitPartNow(data, filter)
|
||||
end
|
||||
|
||||
local success = ProtectedCall(submitPart)
|
||||
|
||||
if not isfunction(callback) then return end
|
||||
|
||||
if not success then
|
||||
allowed = false
|
||||
reason = "Unexpected Error"
|
||||
end
|
||||
|
||||
ProtectedCall(function()
|
||||
callback(allowed, reason)
|
||||
end)
|
||||
end)
|
||||
|
||||
local function make_copy(tbl, input)
|
||||
if tbl.self.UniqueID then
|
||||
tbl.self.UniqueID = pac.Hash(tbl.self.UniqueID .. input)
|
||||
end
|
||||
|
||||
for _, val in pairs(tbl.children) do
|
||||
make_copy(val, input)
|
||||
end
|
||||
end
|
||||
|
||||
local function net_write_table(tbl)
|
||||
|
||||
local buffer = pac.StringStream()
|
||||
buffer:writeTable(tbl)
|
||||
|
||||
local data = buffer:getString()
|
||||
local ok, err = pcall(net.WriteStream, data)
|
||||
|
||||
if not ok then
|
||||
return ok, err
|
||||
end
|
||||
|
||||
return #data
|
||||
end
|
||||
|
||||
|
||||
pace.dupe_ents = pace.dupe_ents or {}
|
||||
|
||||
local uid2key = include("pac3/editor/server/legacy_network_dictionary_translate.lua")
|
||||
|
||||
local function translate_old_dupe(tableIn, target)
|
||||
for key, value2 in pairs(tableIn) do
|
||||
local value
|
||||
|
||||
if istable(value2) then
|
||||
value = translate_old_dupe(value2, {})
|
||||
else
|
||||
value = value2
|
||||
end
|
||||
|
||||
if isnumber(key) and key > 10000 then
|
||||
local str = uid2key[key] or key
|
||||
target[str] = value
|
||||
else
|
||||
target[key] = value
|
||||
end
|
||||
end
|
||||
|
||||
return target
|
||||
end
|
||||
|
||||
duplicator.RegisterEntityModifier("pac_config", function(ply, ent, parts)
|
||||
if parts.json then
|
||||
parts = util.JSONToTable(parts.json)
|
||||
parts = translate_old_dupe(parts, {})
|
||||
end
|
||||
|
||||
local id = ent:EntIndex()
|
||||
|
||||
if parts.part then
|
||||
parts = {[parts.part.self.UniqueID] = parts}
|
||||
end
|
||||
|
||||
ent.pac_parts = parts
|
||||
pace.dupe_ents[ent:EntIndex()] = {owner = ply, ent = ent}
|
||||
|
||||
-- give source engine time
|
||||
timer.Simple(0, function()
|
||||
for _, data in pairs(parts) do
|
||||
if istable(data.part) then
|
||||
make_copy(data.part, id)
|
||||
|
||||
data.part.self.Name = tostring(ent)
|
||||
data.part.self.OwnerName = id
|
||||
end
|
||||
|
||||
data.owner = ply
|
||||
data.uid = pac.Hash(ply)
|
||||
data.is_dupe = true
|
||||
|
||||
-- clientside sent variables cleanup for sanity
|
||||
data.wear_filter = nil
|
||||
data.partID = nil
|
||||
data.totalParts = nil
|
||||
data.transmissionID = nil
|
||||
|
||||
pace.SubmitPart(data)
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
function pace.SubmitPartNow(data, filter)
|
||||
local part = data.part
|
||||
local owner = data.owner
|
||||
|
||||
-- last arg "true" is pac3 only in case you need to do your checking differently from pac2
|
||||
local allowed, reason = hook.Run("PrePACConfigApply", owner, data, true)
|
||||
if allowed == false then return allowed, reason end
|
||||
|
||||
local uid = data.uid
|
||||
if uid ~= false and pace.IsBanned(owner) then
|
||||
return false, "you are banned from using pac"
|
||||
end
|
||||
|
||||
if istable(part) then
|
||||
local ent = Entity(tonumber(part.self.OwnerName) or -1)
|
||||
|
||||
if ent:IsValid() then
|
||||
if not pace.CanPlayerModify(owner, ent) then
|
||||
local entOwner = ent.CPPIGetOwner and ent:CPPIGetOwner()
|
||||
entOwner = tostring(entOwner or "world")
|
||||
|
||||
return false, "you are not allowed to modify this entity: " .. tostring(ent) .. " owned by: " .. entOwner
|
||||
else
|
||||
if not data.is_dupe then
|
||||
ent.pac_parts = ent.pac_parts or {}
|
||||
ent.pac_parts[pac.Hash(owner)] = data
|
||||
|
||||
pace.dupe_ents[ent:EntIndex()] = {owner = owner, ent = ent}
|
||||
|
||||
duplicator.ClearEntityModifier(ent, "pac_config")
|
||||
-- fresh table copy
|
||||
duplicator.StoreEntityModifier(ent, "pac_config", {json = util.TableToJSON(table.Copy(ent.pac_parts))})
|
||||
end
|
||||
|
||||
ent:CallOnRemove("pac_config", function(e)
|
||||
if e.pac_parts then
|
||||
for _, eData in pairs(e.pac_parts) do
|
||||
if istable(eData.part) then
|
||||
eData.part = eData.part.self.UniqueID
|
||||
end
|
||||
pace.RemovePart(eData)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
pace.Parts[uid] = pace.Parts[uid] or {}
|
||||
|
||||
if istable(part) then
|
||||
pace.Parts[uid][part.self.UniqueID] = data
|
||||
else
|
||||
if part == "__ALL__" then
|
||||
pace.Parts[uid] = {}
|
||||
filter = true
|
||||
|
||||
for key, v in pairs(pace.dupe_ents) do
|
||||
if v.owner:IsValid() and v.owner == owner then
|
||||
if v.ent:IsValid() and v.ent.pac_parts then
|
||||
v.ent.pac_parts = nil
|
||||
duplicator.ClearEntityModifier(v.ent, "pac_config")
|
||||
end
|
||||
end
|
||||
|
||||
pace.dupe_ents[key] = nil
|
||||
end
|
||||
elseif part then
|
||||
pace.Parts[uid][part] = nil
|
||||
end
|
||||
end
|
||||
|
||||
local players
|
||||
if IsValid(data.temp_wear_filter) and type(data.temp_wear_filter) == "Player" then
|
||||
players = {data.temp_wear_filter}
|
||||
elseif istable(data.wear_filter) then
|
||||
players = {}
|
||||
|
||||
for _, id in ipairs(data.wear_filter) do
|
||||
local ply = pac.ReverseHash(id, "Player")
|
||||
if ply:IsValid() then
|
||||
table.insert(players, ply)
|
||||
end
|
||||
end
|
||||
else
|
||||
players = player.GetAll()
|
||||
end
|
||||
|
||||
if filter == false then
|
||||
filter = owner
|
||||
elseif filter == true then
|
||||
local tbl = {}
|
||||
|
||||
for _, v in pairs(players) do
|
||||
if v ~= owner then
|
||||
table.insert(tbl, v)
|
||||
end
|
||||
end
|
||||
|
||||
filter = tbl
|
||||
end
|
||||
|
||||
if not data.server_only then
|
||||
if owner:IsValid() then
|
||||
data.player_uid = pac.Hash(owner)
|
||||
end
|
||||
|
||||
players = filter or players
|
||||
|
||||
if istable(players) then
|
||||
for key = #players, 1, -1 do
|
||||
local ply = players[key]
|
||||
if not ply.pac_requested_outfits and ply ~= owner then
|
||||
table.remove(players, key)
|
||||
end
|
||||
end
|
||||
|
||||
if pace.GlobalBans and owner:IsValid() then
|
||||
local owner_steamid = owner:SteamID()
|
||||
|
||||
for key, ply in pairs(players) do
|
||||
local steamid = ply:SteamID()
|
||||
|
||||
for var in pairs(pace.GlobalBans) do
|
||||
if var == steamid or istable(var) and (table.HasValue(var, steamid) or table.HasValue(var, util.CRC(ply:IPAddress():match("(.+):") or ""))) then
|
||||
table.remove(players, key)
|
||||
|
||||
if owner_steamid == steamid then
|
||||
pac.Message("Dropping data transfer request by '", ply:Nick(), "' due to a global PAC ban.")
|
||||
return false, "You have been globally banned from using PAC. See global_bans.lua for more info."
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif type(players) == "Player" and (not players.pac_requested_outfits and players ~= owner) then
|
||||
data.transmissionID = nil
|
||||
return true
|
||||
end
|
||||
|
||||
if not players or istable(players) and not next(players) then return true end
|
||||
|
||||
-- Alternative transmission system
|
||||
local ret = hook.Run("pac_SendData", players, data)
|
||||
if ret == nil then
|
||||
net.Start("pac_submit")
|
||||
local bytes, err = net_write_table(data)
|
||||
|
||||
if not bytes then
|
||||
local errStr = tostring(err)
|
||||
ErrorNoHalt("[PAC3] Outfit broadcast failed for " .. tostring(owner) .. ": " .. errStr .. '\n')
|
||||
|
||||
if owner and owner:IsValid() then
|
||||
owner:ChatPrint('[PAC3] ERROR: Could not broadcast your outfit: ' .. errStr)
|
||||
end
|
||||
else
|
||||
net.Send(players)
|
||||
end
|
||||
end
|
||||
|
||||
if istable(part) then
|
||||
pace.CallHook("OnWoreOutfit", owner, part)
|
||||
end
|
||||
end
|
||||
|
||||
-- nullify transmission ID
|
||||
data.transmissionID = nil
|
||||
|
||||
return true
|
||||
end
|
||||
|
||||
-- Inserts the given part into the StreamQueue
|
||||
function pace.SubmitPart(data, filter, callback)
|
||||
if istable(data.part) then
|
||||
pac.dprint("queuing part %q from %s", data.part.self.Name, tostring(data.owner))
|
||||
table.insert(pace.StreamQueue, {
|
||||
data = data,
|
||||
filter = filter,
|
||||
callback = callback
|
||||
})
|
||||
|
||||
return "queue"
|
||||
end
|
||||
|
||||
return pace.SubmitPartNow(data, filter)
|
||||
end
|
||||
|
||||
-- Inserts the given part into the StreamQueue, and notifies when it completes
|
||||
function pace.SubmitPartNotify(data)
|
||||
local part = data.part
|
||||
local partName = part.self.Name or "no name"
|
||||
|
||||
pac.dprint("submitted outfit %q from %s with %i children to set on %s", partName, data.owner:GetName(), table.Count(part.children), part.self.OwnerName or "")
|
||||
|
||||
local function callback(allowed, reason)
|
||||
if allowed == "queue" then return end
|
||||
if not data.owner:IsPlayer() then return end
|
||||
|
||||
reason = reason or ""
|
||||
|
||||
if not reason and allowed and istable(part) then
|
||||
reason = string.format("Your part %q has been applied", partName or "<unknown>")
|
||||
end
|
||||
|
||||
net.Start("pac_submit_acknowledged")
|
||||
net.WriteBool(allowed)
|
||||
net.WriteString(reason)
|
||||
net.WriteString(partName)
|
||||
net.Send(data.owner)
|
||||
|
||||
hook.Run("PACSubmitAcknowledged", data.owner, not not allowed, reason, partName, data)
|
||||
end
|
||||
|
||||
pace.SubmitPart(data, nil, callback)
|
||||
end
|
||||
|
||||
function pace.RemovePart(data)
|
||||
local part = data.part
|
||||
local owner = data.owner
|
||||
pac.dprint("%s is removed %q", owner and owner:IsValid() and owner:GetName(), part)
|
||||
|
||||
if part == "__ALL__" then
|
||||
pace.CallHook("RemoveOutfit", owner)
|
||||
end
|
||||
|
||||
pace.SubmitPart(data, data.filter)
|
||||
end
|
||||
|
||||
function pace.HandleReceivedData(ply, data)
|
||||
data.owner = ply
|
||||
data.uid = pac.Hash(ply)
|
||||
|
||||
if data.wear_filter and #data.wear_filter > game.MaxPlayers() then
|
||||
pac.Message("Player ", ply, " tried to submit extraordinary wear filter size of ", #data.wear_filter, ", dropping.")
|
||||
data.wear_filter = nil
|
||||
end
|
||||
|
||||
if istable(data.part) and data.part.self then
|
||||
if istable(data.part.self) and not data.part.self.UniqueID then return end -- bogus data
|
||||
|
||||
pac.Message("Received pac group ", data.partID or 0 , "/", data.totalParts or 0, " from ", ply)
|
||||
pace.SubmitPartNotify(data)
|
||||
elseif isstring(data.part) then
|
||||
local clearing = data.part == "__ALL__"
|
||||
|
||||
pac.Message("Clearing ", clearing and "Oufit" or "Part" , " from ", ply)
|
||||
pace.RemovePart(data)
|
||||
end
|
||||
end
|
||||
|
||||
util.AddNetworkString("pac_submit")
|
||||
|
||||
local pac_submit_spam = CreateConVar('pac_submit_spam', '1', {FCVAR_NOTIFY, FCVAR_ARCHIVE}, 'Prevent users from spamming pac_submit')
|
||||
local pac_submit_limit = CreateConVar('pac_submit_limit', '30', {FCVAR_NOTIFY, FCVAR_ARCHIVE}, 'pac_submit spam limit')
|
||||
|
||||
pace.PCallNetReceive(net.Receive, "pac_submit", function(len, ply)
|
||||
if len < 64 then return end
|
||||
if pac_submit_spam:GetBool() and not game.SinglePlayer() then
|
||||
local allowed = pac.RatelimitPlayer( ply, "pac_submit", pac_submit_limit:GetInt(), 5, {"Player ", ply, " is spamming pac_submit!"} )
|
||||
if not allowed then return end
|
||||
end
|
||||
|
||||
if pac.CallHook("CanWearParts", ply) == false then
|
||||
return
|
||||
end
|
||||
|
||||
net.ReadStream(ply, function(data)
|
||||
if not data then
|
||||
pac.Message("message from ", ply, " timed out")
|
||||
return
|
||||
end
|
||||
if not ply:IsValid() then
|
||||
pac.Message("received message from ", ply, " but player is no longer valid!")
|
||||
return
|
||||
end
|
||||
local buffer = pac.StringStream(data)
|
||||
pace.HandleReceivedData(ply, buffer:readTable())
|
||||
end)
|
||||
end)
|
||||
|
||||
function pace.ClearOutfit(ply)
|
||||
local uid = pac.Hash(ply)
|
||||
|
||||
pace.SubmitPart({part = "__ALL__", uid = pac.Hash(ply), owner = ply})
|
||||
pace.CallHook("RemoveOutfit", ply)
|
||||
end
|
||||
|
||||
function pace.RequestOutfits(ply)
|
||||
if not ply:IsValid() then return end
|
||||
|
||||
if ply.pac_requested_outfits_time and ply.pac_requested_outfits_time > RealTime() then return end
|
||||
ply.pac_requested_outfits_time = RealTime() + 30
|
||||
ply.pac_requested_outfits = true
|
||||
|
||||
ply.pac_gonna_receive_outfits = true
|
||||
|
||||
pace.UpdateWearFilters()
|
||||
|
||||
timer.Simple(6, function()
|
||||
if not IsValid(ply) then return end
|
||||
ply.pac_gonna_receive_outfits = false
|
||||
|
||||
for id, outfits in pairs(pace.Parts) do
|
||||
local owner = pac.ReverseHash(id, "Player")
|
||||
|
||||
if owner:IsValid() and owner:IsPlayer() and owner.GetPos and id ~= pac.Hash(ply) then
|
||||
for key, outfit in pairs(outfits) do
|
||||
if not outfit.wear_filter or table.HasValue(outfit.wear_filter, pac.Hash(ply)) then
|
||||
pace.SubmitPart(outfit, ply)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
concommand.Add("pac_request_outfits", pace.RequestOutfits)
|
||||
64
lua/pac3/editor/server/wear_filter.lua
Normal file
64
lua/pac3/editor/server/wear_filter.lua
Normal file
@@ -0,0 +1,64 @@
|
||||
--[[
|
||||
| This file was obtained through the combined efforts
|
||||
| of Madbluntz & Plymouth Antiquarian Society.
|
||||
|
|
||||
| Credits: lifestorm, Gregory Wayne Rossel JR.,
|
||||
| Maloy, DrPepper10 @ RIP, Atle!
|
||||
|
|
||||
| Visit for more: https://plymouth.thetwilightzone.ru/
|
||||
--]]
|
||||
|
||||
|
||||
util.AddNetworkString('pac_submit_acknowledged')
|
||||
util.AddNetworkString('pac_update_playerfilter')
|
||||
|
||||
local function find_outfits(ply)
|
||||
for id, outfits in pairs(pace.Parts) do
|
||||
local owner = pac.ReverseHash(id, "Player")
|
||||
if owner:IsValid() then
|
||||
if owner == ply then
|
||||
return outfits
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
return {}
|
||||
end
|
||||
|
||||
pace.PCallNetReceive(net.Receive, "pac_update_playerfilter", function(len, ply)
|
||||
local sizeof = net.ReadUInt(8)
|
||||
|
||||
if sizeof > game.MaxPlayers() then
|
||||
pac.Message("Player ", ply, " tried to submit extraordinary wear filter size of ", sizeof, ", dropping.")
|
||||
return
|
||||
end
|
||||
|
||||
local ids = {}
|
||||
|
||||
for i = 1, sizeof do
|
||||
table.insert(ids, net.ReadString())
|
||||
end
|
||||
|
||||
for _, outfit in pairs(find_outfits(ply)) do
|
||||
|
||||
if outfit.wear_filter then
|
||||
for _, id in ipairs(ids) do
|
||||
if not table.HasValue(outfit.wear_filter, id) then
|
||||
local ply = pac.ReverseHash(id, "Player")
|
||||
if ply:IsValid() then
|
||||
if ply.pac_requested_outfits and not ply.pac_gonna_receive_outfits then
|
||||
pace.SubmitPart(outfit, ply)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
outfit.wear_filter = ids
|
||||
end
|
||||
end)
|
||||
|
||||
function pace.UpdateWearFilters()
|
||||
net.Start('pac_update_playerfilter')
|
||||
net.Broadcast()
|
||||
end
|
||||
Reference in New Issue
Block a user