Skip to content
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

Let SendToUnsynced send tables #1704

Open
sprunk opened this issue Sep 28, 2024 · 0 comments
Open

Let SendToUnsynced send tables #1704

sprunk opened this issue Sep 28, 2024 · 0 comments
Labels
enhancement New feature or request Lua API

Comments

@sprunk
Copy link
Collaborator

sprunk commented Sep 28, 2024

Right now it only accepts simple types. The caveats are that

  • simple types can be passed just like that, but for tables the implementation will need to make a copy so that unsynced can't edit it
  • functions can't be passed at all (because they can be closures and/or sync-affecting C functions). Userdata is probably also unsafe to pass. So tables will need to be stripped to just simple types plus tables.

Both of those are done for the SYNCED. table so perhaps look there for inspiration.

static const int supportedTypes =
(1 << LUA_TNIL)
| (1 << LUA_TBOOLEAN)
| (1 << LUA_TNUMBER)
| (1 << LUA_TSTRING)
;

@sprunk sprunk added enhancement New feature or request Lua API labels Sep 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Lua API
Projects
None yet
Development

No branches or pull requests

1 participant