You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add per player time quota for E2
I think this would be beneficial for servers, because servers care more about the overall load from a player than about their specific chip. Currently, players can simply spread the load across multiple chips to bypass the quota limit, but this won't eliminate it; it will only increase the overhead
* Use CurTime for it
* Count the execution cycle in ticks for accuracy
* Don't round this
* Use selfTbl
* Fix typo
* Use the total load from all E2s of one player, also calculating the average load (code from Redox, slightly modified)
* Code styling/small optimization
* Typo fix/use tabs
* Fix one more typo
* Optimizations
* One more small optimization
* Do some cleanup
* Don't use median
* Remove now unused
* Kill chips until the cpu time drops to the maximum threshold
* Fix typo
* Use OOP style add new e2 functions
* Don't chips subtable
localcvar=CreateConVar("wire_expression2_pause_on_disconnect", 0, 0, "Decides if chips should pause execution on their owner's disconnect.\n0 = no, 1 = yes, 2 = non-admins only.")
722
-
-- This is a global function so it can be overwritten for greater control over whose chips are frozenated
CreateConVar("wire_expression2_quotatime", "-1", {FCVAR_REPLICATED}, "Time in (ms) the e2 can consume before killing (-1 is infinite)")
15
+
CreateConVar("wire_expression2_quotatime", "-1", {FCVAR_REPLICATED}, "Time in (ms) that all E2s of one player can consume before killing (-1 is infinite)")
Copy file name to clipboardExpand all lines: lua/wire/client/e2descriptions.lua
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -939,6 +939,8 @@ E2Helper.Descriptions["setName(e:s)"] = "Set the name of another E2 or component
939
939
E2Helper.Descriptions["setOverlayText(s)"] ="Set the overlay text of the E2"
940
940
E2Helper.Descriptions["cpuUsage()"] ="Returns the average time per tick the server spends running this E2, in seconds (multiply it by 1000000 to get the same value as is displayed on the E2 overlay)"
941
941
E2Helper.Descriptions["cpuUsage(e:)"] ="Returns the average time per tick the server spends running the specified E2, in seconds (multiply it by 1000000 to get the same value as is displayed on the E2 overlay)"
942
+
E2Helper.Descriptions["totalCpuUsage()"] ="Returns the average time per tick the server spends running all yours E2s, in seconds (multiply it by 1000000 to get the same value as is displayed on the E2 overlay)"
943
+
E2Helper.Descriptions["totalCpuUsage(e:)"] ="Returns the average time per tick the server spends running specified player E2s, in seconds (multiply it by 1000000 to get the same value as is displayed on the E2 overlay)"
942
944
E2Helper.Descriptions["error(s)"] ="Shuts down the E2 with specified script error message"
943
945
E2Helper.Descriptions["assert(n)"] ="If the argument is 0, shut down the E2 with an error message"
944
946
E2Helper.Descriptions["assert(ns)"] ="If the first argument is 0, shut down the E2 with the given error message string"
0 commit comments