Skip to content

Adding more network features for scripts. #709

Open
Toys0125 wants to merge 5 commits intoBasisVR:developerfrom
Toys0125:Expose-Network-Time
Open

Adding more network features for scripts. #709
Toys0125 wants to merge 5 commits intoBasisVR:developerfrom
Toys0125:Expose-Network-Time

Conversation

@Toys0125
Copy link
Copy Markdown
Contributor

@Toys0125 Toys0125 commented Apr 2, 2026

  • At the current moment we don't have direct way to assume if an object has no real owner easily.
    For instance the server normally sends a remove owner and set the ID=0. Which works for everyone, except the first person. We start the player Id at 0. Which breaks this assumption with single player or low player count servers. So went and added a simple bool that the NetworkContent class will track if there is an owner assigned.
  • Added NetworkTime, and NetworkDeltaTime to NetworkShim, to allow scripts to adjust delay based on it.

Toys0125 added 2 commits April 1, 2026 21:05
Had to do this as we can not assume Id=0 means no owner as we start at id 0 for first user.
@Toys0125
Copy link
Copy Markdown
Contributor Author

Toys0125 commented Apr 2, 2026

Other option is when we release the owner we set currentOwnedPlayer to null. And make it hasCurrentOwner => {currentOwnedPlayer != null}

@dooly123
Copy link
Copy Markdown
Collaborator

dooly123 commented Apr 2, 2026

We really should just have a trygetownershipid that gives you back false or true, done that a few places in the code base.

I like using zero as the starting point as well, that's programming

@Toys0125
Copy link
Copy Markdown
Contributor Author

Toys0125 commented Apr 3, 2026

We really should just have a trygetownershipid that gives you back false or true, done that a few places in the code base.

I like using zero as the starting point as well, that's programming

Okay added the TryGetOwnerId in which checks if we have it cached, and outputs the owner id, otherwise returns false.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants