How UOJS is laid out, for those changing it

DrBoon

Administrator
Staff member
Nov 26, 2026
15
0
1
This forum is for working on the server itself. Here is the lay of the land.

Three packages
  • server/: the server.
  • client/: a headless client that logs in and plays, used to drive and test the server.
  • protocol/: the wire format both share.

Core and scripts
The server's own code in server/src is what sits close to the metal: the network and the client's protocol, the game loop, the world and its saving, movement and line of sight. Everything that is the game lives in server/scripts/game as scripts. A change to how the game plays almost always belongs in a script, not in the core.

No build step
Node runs the TypeScript as it is, removing the types as it loads. So the code keeps to TypeScript that can simply be removed: no enum, no namespace, no parameter properties, and imports that name the .ts file.

Before you send a change
Code:
npm run typecheck
npm test
npm run lint
npm run format
The tests run real shards and real logins with the headless client. A change to the game should come with a test that shows it working.

Getting the game right
Where a rule differs between eras, it follows the era the world is in. If you are not sure how the game did something, say what you found and where, and ask here.