From c69087e4955c11c9a317c8b0d30e73b11205a1b2 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sat, 14 Dec 2024 00:25:08 +0300 Subject: [PATCH 1/3] tickRate function --- lua/entities/gmod_wire_expression2/core/serverinfo.lua | 4 ++++ lua/wire/client/e2descriptions.lua | 1 + 2 files changed, 5 insertions(+) diff --git a/lua/entities/gmod_wire_expression2/core/serverinfo.lua b/lua/entities/gmod_wire_expression2/core/serverinfo.lua index 08ecf3ce05..d72616434a 100644 --- a/lua/entities/gmod_wire_expression2/core/serverinfo.lua +++ b/lua/entities/gmod_wire_expression2/core/serverinfo.lua @@ -78,3 +78,7 @@ end e2function number tickInterval() return engine.TickInterval() end + +e2function number tickRate() + return 1 / engine.AbsoluteFrameTime() +end diff --git a/lua/wire/client/e2descriptions.lua b/lua/wire/client/e2descriptions.lua index d2d85c3fe0..a7067124d5 100644 --- a/lua/wire/client/e2descriptions.lua +++ b/lua/wire/client/e2descriptions.lua @@ -976,6 +976,7 @@ E2Helper.Descriptions["printCaption(sn)"] = "Emits a closed caption with the pro -- Time E2Helper.Descriptions["tickClk()"] = "DEPRECATED. Use 'event tick()' instead! Returns 1 if the current execution was caused by \"runOnTick\"" E2Helper.Descriptions["tickInterval()"] = "Returns the time (in seconds) between each server tick" +E2Helper.Descriptions["tickRate()"] = "Returns the current server tickrate. Allows detecting lags" E2Helper.Descriptions["curtime()"] = "Returns the current game time since server-start in seconds" E2Helper.Descriptions["realtime()"] = "Returns the current real time since server-start in seconds" E2Helper.Descriptions["systime()"] = "Returns a highly accurate time (also in seconds) since the server was started. Ideal for benchmarking" From 50d4c219a234ef121ee419988cf19245fbd4797c Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sat, 14 Dec 2024 09:28:03 +0300 Subject: [PATCH 2/3] tickRealInterval --- lua/entities/gmod_wire_expression2/core/serverinfo.lua | 2 +- lua/wire/client/e2descriptions.lua | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lua/entities/gmod_wire_expression2/core/serverinfo.lua b/lua/entities/gmod_wire_expression2/core/serverinfo.lua index d72616434a..5580f25417 100644 --- a/lua/entities/gmod_wire_expression2/core/serverinfo.lua +++ b/lua/entities/gmod_wire_expression2/core/serverinfo.lua @@ -79,6 +79,6 @@ e2function number tickInterval() return engine.TickInterval() end -e2function number tickRate() +e2function number tickRealInterval() return 1 / engine.AbsoluteFrameTime() end diff --git a/lua/wire/client/e2descriptions.lua b/lua/wire/client/e2descriptions.lua index a7067124d5..d936659436 100644 --- a/lua/wire/client/e2descriptions.lua +++ b/lua/wire/client/e2descriptions.lua @@ -976,7 +976,7 @@ E2Helper.Descriptions["printCaption(sn)"] = "Emits a closed caption with the pro -- Time E2Helper.Descriptions["tickClk()"] = "DEPRECATED. Use 'event tick()' instead! Returns 1 if the current execution was caused by \"runOnTick\"" E2Helper.Descriptions["tickInterval()"] = "Returns the time (in seconds) between each server tick" -E2Helper.Descriptions["tickRate()"] = "Returns the current server tickrate. Allows detecting lags" +E2Helper.Descriptions["tickRealInterval()"] = "Returns the current time (in seconds) between each server tick" E2Helper.Descriptions["curtime()"] = "Returns the current game time since server-start in seconds" E2Helper.Descriptions["realtime()"] = "Returns the current real time since server-start in seconds" E2Helper.Descriptions["systime()"] = "Returns a highly accurate time (also in seconds) since the server was started. Ideal for benchmarking" From 92cf459092166177aa72814687b66afb0e9d3752 Mon Sep 17 00:00:00 2001 From: Astralcircle <142503363+Astralcircle@users.noreply.github.com> Date: Sat, 14 Dec 2024 09:28:38 +0300 Subject: [PATCH 3/3] Forgot --- lua/entities/gmod_wire_expression2/core/serverinfo.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lua/entities/gmod_wire_expression2/core/serverinfo.lua b/lua/entities/gmod_wire_expression2/core/serverinfo.lua index 5580f25417..b2ddc14334 100644 --- a/lua/entities/gmod_wire_expression2/core/serverinfo.lua +++ b/lua/entities/gmod_wire_expression2/core/serverinfo.lua @@ -80,5 +80,5 @@ e2function number tickInterval() end e2function number tickRealInterval() - return 1 / engine.AbsoluteFrameTime() + return engine.AbsoluteFrameTime() end