v1.10.0 — Configs, teleports and leaderboards
Six new modules cover configs, asynchronous work, pooling, cross-server budgets, teleports and leaderboards, and player data can refuse a bad save.
Before upgrading
Section titled “Before upgrading”Four changes can reach existing code.
Admin.Cmdris Cmdr v1.13.0. Calling a registry method on the Cmdr object, such asAdmin.Cmdr:RegisterCommandsIn, logs a deprecation warning. Call it throughAdmin.Cmdr.Registryinstead.DefaultCommands = truealso registers Cmdr’sban,unbanandexit, atMinimumRankunlessCommandsnames them.Data.SaveNowconfirms only a save that read the data after the call. Code that relied on an earlier save landing first now waits for its own.- Code that matches every
Data.EditorData.Resetoutcome should expectrefusedonce a scope has aValidatecheck.
Six new modules
Section titled “Six new modules”| Module | What it does |
|---|---|
Async | Gives yielding work a deadline (Timeout), runs several calls together (All), and retries with randomised backoff (Retry). Every call returns an answer. |
Pool | Hands out copies of a part or model, parked out of the world instead of cloned and destroyed. |
Config | Reads experience configs without yielding. Every key has a default, which also stands in for a value of the wrong type. |
Shared | Publishes, subscribes and uses memory store maps within one budget per server. |
Teleport | Sends groups in calls of 50, keeps a group on one reserved server, brings parties along, and keeps carried data off the client. |
Board | Shows an ordered data store leaderboard from a cache, and writes gathered changes within the write budget. |
local sent, code = Twill.Teleport.Send(ARENA_PLACE, squad, { Reserve = true, Party = true, Data = { Mode = "ranked" },})Player data refuses a bad save
Section titled “Player data refuses a bad save”A bug that sets Coins below zero used to be saved like any other change. A
Validate check now stops it: a save the check refuses is skipped, and the last
good data stays stored.
Twill.Data.Configure({ Store = "PlayerData", Template = { Coins = 0 }, Validate = function(data) return data.Coins >= 0, "coins cannot go below zero" end,})Admin edits go through the same check. Data.Edit and Data.Reset try the
change on a copy, and return refused without touching the live data when the
check fails. See Store and save player data.
Saves are cheaper and shutdown is safer
Section titled “Saves are cheaper and shutdown is safer”- A burst of saves for one key costs one write. A save asked for while another still waits to read the key joins it.
- When a server begins shutting down, calls that are already retrying stop at two attempts, so the final saves are not left waiting behind them.
Data.SaveNownow returns at its timeout, and counts only a save that read the data after the call.
Tested under Server Authority
Section titled “Tested under Server Authority”Twill’s test suite, 1115 checks, passes with Workspace.AuthorityMode set to
Server. A two-sided playtest also delivered Replication writes, Net
pushes, and Ask replies under the deferred signals that mode requires.
Other changes
Section titled “Other changes”Tree.Buildtakes an owner bag, which destroys the tree and its events when it closes.- A
Navigationagent is destroyed along with its model, and an agent for a player’s own character no longer takes network ownership of parts added to it later. - Mail on a key written by ProfileStore keeps that format’s count of letters sent, so a new letter never reuses an old number.
Storesends and listens for release requests throughShared, so they count against the same budget as the game’s own messages.
Full changelog
Section titled “Full changelog”Every change in this release is listed in the changelog.