-
-
Notifications
You must be signed in to change notification settings - Fork 234
add tracker timeout setting #1787
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| package dev.slimevr.config | ||
|
|
||
| import dev.slimevr.VRServer | ||
| import dev.slimevr.tracking.trackers.Tracker | ||
|
|
||
| class TimeoutConfig { | ||
| // Timeout duration in seconds | ||
| var duration = 3.0f | ||
|
|
||
| fun updateTimeoutDuration() { | ||
| if (this.duration.isNaN() || this.duration.isInfinite()) { | ||
| this.duration = 3.0f | ||
| } | ||
| if (this.duration < 1f) { | ||
| this.duration = 1f | ||
| } | ||
| if (this.duration > 1000000000000000f) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. the idea was that it's a floating point setting which is being multiplied by 1000 and turned into a "Long", so I put an upper bound to prevent potential overflow
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. make it long then maybe...
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. maybe, but if it was a long, it would be in ms, which I think typing values in milliseconds in the ui would be weird. I could make it so the server stores the number as a long, and the gui uses floats but performs all of the conversion before sending it, but from what I understand the solarxr stuff allows other apps to also listen to the same messages, in which case receiving a time in seconds as a float is 'nicer' than milliseconds as a long in my opinion |
||
| this.duration = 1000000000000000f | ||
| } | ||
| Tracker.DISCONNECT_MS = (this.duration * 1000L).toLong() + Tracker.TIMEOUT_MS | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not use a NumberSelector?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to be able to type into it