@@ -13,7 +13,7 @@ var tickrate: int:
13
13
if sync_to_physics :
14
14
return Engine .physics_ticks_per_second
15
15
else :
16
- return ProjectSettings . get_setting ( & "netfox/time/tickrate" , 30 )
16
+ return _tickrate
17
17
set (v ):
18
18
push_error ("Trying to set read-only variable tickrate" )
19
19
@@ -25,7 +25,7 @@ var tickrate: int:
25
25
## [i]read-only[/i], you can change this in the project settings
26
26
var sync_to_physics : bool :
27
27
get :
28
- return ProjectSettings . get_setting ( & "netfox/time/sync_to_physics" , false )
28
+ return _sync_to_physics
29
29
set (v ):
30
30
push_error ("Trying to set read-only variable sync_to_physics" )
31
31
@@ -40,7 +40,7 @@ var sync_to_physics: bool:
40
40
## [i]read-only[/i], you can change this in the project settings
41
41
var max_ticks_per_frame : int :
42
42
get :
43
- return ProjectSettings . get_setting ( & "netfox/time/max_ticks_per_frame" , 8 )
43
+ return _max_ticks_per_frame
44
44
set (v ):
45
45
push_error ("Trying to set read-only variable max_ticks_per_frame" )
46
46
@@ -100,7 +100,7 @@ var tick: int:
100
100
## @deprecated: Use [member _NetworkTimeSynchronizer.panic_threshold] instead.
101
101
var recalibrate_threshold : float :
102
102
get :
103
- return ProjectSettings . get_setting ( & "netfox/time/recalibrate_threshold" , 8.0 )
103
+ return _recalibrate_threshold
104
104
set (v ):
105
105
push_error ("Trying to set read-only variable recalibrate_threshold" )
106
106
@@ -113,7 +113,7 @@ var recalibrate_threshold: float:
113
113
## against.
114
114
var stall_threshold : float :
115
115
get :
116
- return ProjectSettings . get_setting ( & "netfox/time/stall_threshold" , 1.0 )
116
+ return _stall_threshold
117
117
set (v ):
118
118
push_error ("Trying to set read-only variable stall_threshold" )
119
119
@@ -266,15 +266,15 @@ var physics_factor: float:
266
266
## [i]read-only[/i], you can change this in the project settings
267
267
var clock_stretch_max : float :
268
268
get :
269
- return ProjectSettings . get_setting ( & "netfox/time/max_time_stretch" , 1.25 )
269
+ return _clock_stretch_max
270
270
set (v ):
271
271
push_error ("Trying to set read-only variable stretch_max" )
272
272
273
273
## Suppress warning when calling [member start] with an [OfflineMultiplayerPeer]
274
274
## active.
275
275
var suppress_offline_peer_warning : bool :
276
276
get :
277
- return ProjectSettings . get_setting ( & "netfox/time/suppress_offline_peer_warning" , false )
277
+ return _suppress_offline_peer_warning
278
278
set (v ):
279
279
push_error ("Trying to set read-only variable suppress_offline_peer_warning" )
280
280
@@ -364,8 +364,18 @@ const _STATE_INACTIVE := 0
364
364
const _STATE_SYNCING := 1
365
365
const _STATE_ACTIVE := 2
366
366
367
+ # Settings
368
+ var _tickrate : int = ProjectSettings .get_setting (& "netfox/time/tickrate" , 30 )
369
+ var _sync_to_physics : bool = ProjectSettings .get_setting (& "netfox/time/sync_to_physics" , false )
370
+ var _max_ticks_per_frame : int = ProjectSettings .get_setting (& "netfox/time/max_ticks_per_frame" , 8 )
371
+ var _recalibrate_threshold : float = ProjectSettings .get_setting (& "netfox/time/recalibrate_threshold" , 8.0 )
372
+ var _stall_threshold : float = ProjectSettings .get_setting (& "netfox/time/stall_threshold" , 1.0 )
373
+ var _clock_stretch_max : float = ProjectSettings .get_setting (& "netfox/time/max_time_stretch" , 1.25 )
374
+ var _suppress_offline_peer_warning : bool = ProjectSettings .get_setting (& "netfox/time/suppress_offline_peer_warning" , false )
375
+
367
376
var _state : int = _STATE_INACTIVE
368
377
378
+ # Timing
369
379
var _tick : int = 0
370
380
var _was_paused : bool = false
371
381
var _initial_sync_done = false
0 commit comments