Skip to content

CraftOS-PC v2.8

Compare
Choose a tag to compare
@MCJack123 MCJack123 released this 02 Jan 03:33
· 48 commits to master since this release
72392cc

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 supports r+/w+ modes.
    • Add allow_repetitions option to textutils.serialiseJSON.
    • math.random now uses Lua 5.4's random number generator.
    • tostring now correctly obeys __name.
  • 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
    • server.close() closes the server
    • Events are now under the websocket_server_ domain
      • websocket_server_connect <port> <handle>: Sent when a client connects to the server
      • websocket_server_message <clientID> <message> <binary>: Sent when a client sends a message
      • websocket_server_closed <clientID> [closeCode] [closeMessage]: Sent when a client disconnects from the server
  • 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.