Skip to content

Commit

Permalink
note
Browse files Browse the repository at this point in the history
  • Loading branch information
lesleyrs committed Jul 10, 2024
1 parent b025637 commit 33217a7
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,26 @@ This project is a comprehensive source port of our [Client refactor](https://git

Click [here](https://github.com/2004scape/Client2/tree/gh-pages) to view the current deployment summary. 🚀

## Singleplayer

When worker=1 is set in the url it will load the server inside the browser on login, world=0 is also set by default to avoid being dependant on 2004scape.org. Locally this takes only a few seconds but on github pages it can take around 2 minutes.

To update server code you have to:
1. pack server caches, copy `data/pack` from server to `src/public/` in client
2. run `npm run embed` in server, optionally minify, this will turn LoginThread into a worker blob and copies the server to `../Client2/src/public`
3. for production builds `app.js` server will give an error, add parenthesis like: `await (world_default.start());` (this sucks, also had to change terser settings)

NOTE: modpow, crc, and randomuuid are disabled, crypto.randomuuid() needs https. Cache and midis are fetched locally, but crcs are a http request.
NOTE: maybe simplify build if needed by having LoginThread be a separate worker file instead of an imported variable. But it's nice having only 1 file.

TODO: exclude dirs from being modified as crc checks fail due to it, then enable them again
TODO: use a specific worker world to avoid getting stuck on fetching world data from 2004scape.org when world isn't 0
TODO: figure out why editing app.js for world_default parenthesis is needed, added to .prettierignore for commits but still requires edits every change
TODO: let server store player saves + packs in db
TODO: webrtc p2p multiplayer, possibly login server entrypoint?
TODO: fix bug where worker instances aren't being terminated/closed, might have to use a message to let the server close it.
TODO: fix see-through player models

## Site Index

### Client
Expand Down

0 comments on commit 33217a7

Please sign in to comment.