Skip to content

Commit e587aec

Browse files
authored
sentSpawn functionality (#3086)
* sentSpawn functionality * Comply with linter * Move castings to E2/Wire lib Moved casting and typeIdToString to E2Lib and WireLib. Fixed major bug, where registered sents didn't check for prop protection, when creating constrains. Changed comments a bit * Update sents_default_params.lua * Update prop.lua * Moved sents_default_params.lua Moved sents_default_params.lua Renamed sents_default_params.lua Changed the way to block sents, and renamed whitelist to registry, to reinforce reusability for thirdparty addons * gmod_wire_value bug fixes * remove whitespace -_- * WireLib.SentSpawn.Unregister table removal fix
1 parent 7ee8185 commit e587aec

File tree

7 files changed

+1840
-2
lines changed

7 files changed

+1840
-2
lines changed

lua/autorun/wire_load.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ if SERVER then
8888
include("wire/server/wirelib.lua")
8989
include("wire/server/modelplug.lua")
9090
include("wire/server/debuggerlib.lua")
91+
include("wire/server/sents_registry.lua")
9192

9293
if CreateConVar("wire_force_workshop", "1", FCVAR_ARCHIVE, "Should Wire force all clients to download the Workshop edition of Wire, for models? (requires restart to disable)"):GetBool() then
9394
if select(2, WireLib.GetVersion()):find("Workshop", 1, true) then

lua/entities/gmod_wire_expression2/core/custom/cl_prop.lua

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ E2Helper.Descriptions["propSpawn(san)"] = "Model path, Rotation, Frozen Spawns a
99
E2Helper.Descriptions["propSpawn(ean)"] = "Rotation, Frozen Spawns a prop with the model of the template entity and rotated to the angle given. If frozen is 0, then it will spawn unfrozen."
1010
E2Helper.Descriptions["propSpawn(svan)"] = "Model path, Position, Rotation, Frozen Spawns a prop with the model denoted by the string file path, at the position denoted by the vector, and rotated to the angle given. If frozen is 0, then it will spawn unfrozen."
1111
E2Helper.Descriptions["propSpawn(evan)"] = "Position, Rotation, Frozen Spawns a prop with the model of the template entity, at the position denoted by the vector, and rotated to the angle given. If frozen is 0, then it will spawn unfrozen."
12+
E2Helper.Descriptions["sentSpawn(s)"] = "Sent class - Spawns a SENT with no parameters. (Attempts to default the required values). (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!)"
13+
E2Helper.Descriptions["sentSpawn(sv)"] = "Sent class, Position - Spawns a SENT with no parameters. (Attempts to default the required values). (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!)"
14+
E2Helper.Descriptions["sentSpawn(st)"] = "Sent class, Sent data - Spawns a SENT with provided data as parameters. (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!)"
15+
E2Helper.Descriptions["sentSpawn(sva)"] = "Sent class, Position, Rotation - Spawns a SENT with no parameters. (Attempts to default the required values). (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!)"
16+
E2Helper.Descriptions["sentSpawn(svat)"] = "Sent class, Position, Rotation, Sent data - Spawns a SENT with provided data as parameters. (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!)"
17+
E2Helper.Descriptions["sentSpawn(svan)"] = "Sent class, Position, Rotation, Frozen - Spawns a SENT with no parameters. (Attempts to default the required values). (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!)"
18+
E2Helper.Descriptions["sentSpawn(svant)"] = "Sent class, Position, Rotation, Frozen, Sent data - Spawns a SENT with provided data as parameters. (Requires wire_expression2_propcore_sents_whitelist 0 to spawn sents from entity tab!)"
19+
E2Helper.Descriptions["sentGetWhitelisted()"] = "Returns an array of classes, which is registered to the whitelist (can be spawned regardless of wire_expression2_propcore_sents_whitelist). (Can be used to make a lookup table)"
20+
E2Helper.Descriptions["sentGetData(s)"] = "Returns a table, where keys are parameter names (key sensitive!) and values as a table, where first value is the (lua-)type and second value is the default value. (When spawning a sent values is being turned from E2 to Lua types. For example - vec(255,0,0) or vec4(255,0,0,255) is being turned to type Color (red))"
21+
E2Helper.Descriptions["sentGetDataTypes(s)"] = "Returns a table, where keys are parameter names (key sensitive!) and values as (lua-)types. (When spawning a sent values is being turned from E2 to Lua types. For example - vec(255,0,0) or vec4(255,0,0,255) is being turned to type Color (red))"
22+
E2Helper.Descriptions["sentGetDataDefaultValues(s)"] = "Returns a table, where keys are parameter names (key sensitive!) and values as default values, which will be applied if none would be provided."
23+
E2Helper.Descriptions["sentCanCreate()"] = "Returns 1 if you can spawn a SENT, 0 otherwise. (Complete alias of propCanCreate())"
24+
E2Helper.Descriptions["sentCanCreate(s)"] = "Returns 1 if you can spawn a provided class(type) SENT, 0 otherwise. (Accounts both for antispam and whitelist)"
25+
E2Helper.Descriptions["sentIsWhitelist()"] = "Returns 1 if the whitelist is enabled, 0 otherwise."
26+
E2Helper.Descriptions["sentIsEnabled()"] = "Returns 1 if server allows spawning sents, 0 otherwise."
1227
E2Helper.Descriptions["seatSpawn(sn)"] = "Model path, Frozen Spawns a prop with the model denoted by the string filepath. If frozen is 0, then it will spawn unfrozen."
1328
E2Helper.Descriptions["seatSpawn(svan)"] = E2Helper.Descriptions["seatSpawn(sn)"]
1429
E2Helper.Descriptions["seatSpawn(svans)"] = E2Helper.Descriptions["seatSpawn(sn)"] .. " String seatType, determines what animations the seat will have. For example phx_seat2 and phx_seat3 will have Jeep and Airboat animations."

0 commit comments

Comments
 (0)