v2.0.0 — One Twill module per side
Twill installs as two modules named Twill, one per side, and adds traffic counting and the Trade kit.
Before upgrading
Section titled “Before upgrading”The server half moved, so every path to it changes. Paths under
ReplicatedStorage.Twill stay the same.
-
Replace
ReplicatedStorage.Twilland theServerScriptService.TwillServerfolder with the two modules from the release. -
Rename every server path in your own code:
Twill 1 Twill 2 @game/ServerScriptService/TwillServer/@game/ServerScriptService/Twill/ServerScriptService.TwillServerServerScriptService.TwillWaitForChild("TwillServer")WaitForChild("Twill") -
Delete the
TwillServerfolder. One left in place is reported at boot, and nothing reads it.
One module per side
Section titled “One module per side”Twill is two ModuleScripts, both named Twill. The one in ReplicatedStorage
holds what both sides use. The one in ServerScriptService holds what only the
server uses, and hands back the same root.
-- Serverlocal Twill = require("@game/ServerScriptService/Twill")
-- Clientlocal Twill = require("@game/ReplicatedStorage/Twill")Requiring the server module checks the install. It refuses to load when the shared module is missing or comes from another release, and names both versions. See Installing Twill.
Kits, starting with Trade
Section titled “Kits, starting with Trade”A kit covers one kind of game feature. Kits ship inside Twill and load only
when named, so a game that never names one pays nothing for it.
Twill.Kits.Trade is the server half on the server and the client half on a
client.
The Trade kit runs a trade between two players on one server, from invite to saved result:
- Every item is checked against live data when it is offered, and again at the swap.
- The swap is tried on copies first, and refused when either copy fails the
store’s
Validatecheck. - Both players are saved before the trade lets go.
local Trade = require("@game/ServerScriptService/Twill").Kits.Trade
Trade.Configure({ Kinds = { Coins = Trade.Currency("Coins"), Pets = Trade.Unique("Pets") },})Traffic you can measure on a live server
Section titled “Traffic you can measure on a live server”Studio reports no network traffic, so bandwidth has to be read on a published
server. Net.GetStats returns what each side sent, received and refused, per
remote and in total, and Net.ResetStats starts a window. twill traffic in
the admin console shows the same count. See
Measuring traffic and
Check what Studio cannot.
Tested with two clients
Section titled “Tested with two clients”Twill’s test suite gained a client half, which checks Net, Replication,
Lifecycle and the Trade kit against a real client. With two clients, it runs
a whole trade between them. All 1232 checks pass.
Other changes
Section titled “Other changes”Data.Checkruns a store’sValidatecheck without saving.Limit.Throttlespeaks on the first report of each key. On a freshly started server it used to stay silent for its first interval.- A log line from a script named like
TwillShopnames its call site. It used to be taken as coming from inside Twill.
Full changelog
Section titled “Full changelog”Every change in this release is listed in the changelog.