CraftOS-PC v2.8
Happy new year! This release of CraftOS-PC finally brings Lua 5.2 support along with compatibility with CC: Tweaked 1.109.2. In addition, it adds a new WebSocket server API, and lots and lots of critical crash fixes.
This version is a breaking release. Notably, all files are now handled in binary mode, which may break programs that have embedded UTF-8 characters (this was always discouraged for this reason). In addition, bytecode dumping and loading is disabled in standards mode, but it remains enabled when standards mode is disabled. However, despite the introduction of the goto
keyword, it remains a valid identifier, so programs with variables or functions named goto
should continue to function.
Note that the plugin API's major version has been updated due to the switch to Lua 5.2. This will result in preexisting plugins failing to load. The CCEmuX plugin has been updated for the new API, but other plugins will need to be rebuilt for the new API.
- Update CC:T version to 1.109.2
- Update to Lua 5.2
getfenv
/setfenv
now only work on Lua functions.- Add support for
goto
. - Remove support for dumping and loading binary chunks.
- Only disabled in standards mode
- File handles, HTTP requests and websocket messages now use raw bytes rather than converting to UTF-8.
fs.open
now supportsr+
/w+
modes.- Add
allow_repetitions
option totextutils.serialiseJSON
. math.random
now uses Lua 5.4's random number generator.tostring
now correctly obeys__name
.
- Update to Lua 5.2
- Rewrote WebSocket server API (#337)
- Use
server = http.websocketServer(port)
to create a server handle server.listen()
waits for a new connection, and returns a new WebSocket handle- Handles have an additional
clientID
field for identifying the client connection
- Handles have an additional
server.close()
closes the server- Events are now under the
websocket_server_
domainwebsocket_server_connect <port> <handle>
: Sent when a client connects to the serverwebsocket_server_message <clientID> <message> <binary>
: Sent when a client sends a messagewebsocket_server_closed <clientID> [closeCode] [closeMessage]
: Sent when a client disconnects from the server
- Use
- Bumped plugin major version to 12
- Lua 5.2 breaks old plugins - please reinstall/rebuild any plugins (ccemux is updated)
- WebSocket close events now send the close code if available
- Fixed WebSocket ping messages causing the socket to close
- Fixed many memory corruption issues around ropes
- Fixed some issues with debug hooks and yielding
- Fixed crash when erroring from a debug hook (#326)
- Debuggers now inherit the mount list from the original computer (#327)
- Fixed memory reporting when using
string.rep
(#328) - Fixed
fs.getFreeSpace
not checking parent directories if the path doesn't exist (#330) - Fixed crash when using HTTP in the VS Code extension (#332)
- Fixed repeated
websocket.close
calls causing a crash (#336) xpcall
error handlers can now yield- Mobile: Added onboarding screen for navigation bar instructions
If you need help using CraftOS-PC, I'm available on the CraftOS-PC Discord server as @jackmacwindows
. Feel free to leave a message there if you need anything.