Skip to content

feature: add net.shared #16

Description

@PyXiion

Parent: #13

Add the network-synchronized reference built on the ref API.

Required API:

local state = net.shared("state", initial, {
  player = player,
  player_write = false,
})

state:get()
state:set(value)
state:update(function(old) return new end)
state:watch(function(new, old) end)
state:ready(function(state) end)
state:await()

Acceptance criteria:

  • Server owns shared values.
  • Client lookup returns a pending handle.
  • Initial synchronization is separate from change watchers.
  • Updates batch until tick end.
  • Multiple updates in one tick are coalesced.
  • Player-bound values are visible only to the target player.
  • Read-only clients cannot mutate values.
  • Writable clients can submit replacements when enabled.
  • Serialization and size limits are enforced.
  • Wire representation remains internal to Ignis.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions