diff options
author | Tor Andersson <tor@ccxvii.net> | 2025-04-24 12:48:51 +0200 |
---|---|---|
committer | Tor Andersson <tor@ccxvii.net> | 2025-04-25 16:06:05 +0200 |
commit | ed2361980b455d1825d811670f329cbcf5624927 (patch) | |
tree | a1e620490bf305635c3a0f22a6f695e22c14ff2f /public/docs/architecture.html | |
parent | 71a98cbbe0657880cfb1d81962786188b009fc5c (diff) | |
download | server-ed2361980b455d1825d811670f329cbcf5624927.tar.gz |
Move docs to Markdown and use markdown renderer in server.
Diffstat (limited to 'public/docs/architecture.html')
-rw-r--r-- | public/docs/architecture.html | 104 |
1 files changed, 0 insertions, 104 deletions
diff --git a/public/docs/architecture.html b/public/docs/architecture.html deleted file mode 100644 index 4b22f8f..0000000 --- a/public/docs/architecture.html +++ /dev/null @@ -1,104 +0,0 @@ -<!doctype html> -<meta name="viewport" content="width=device-width"> -<title>Architecture Overview</title> -<link rel="stylesheet" href="style.css"> -<body> -<article> - -<h1> -Architecture Overview -</h1> - -<p> -The basic architecture of Rally the Troops is a single server process storing all data in an sqlite database. -This server handles both HTTP requests for the "meta-site" and websocket requests for the rules when playing a game. - -<h2> -Meta-site -</h2> - -<p> -The meta-site consists of all the web pages showing the login, signup, active game lists, the create a game page, forum, etc. -These pages are all created using PUG templates in the "view" directory. -The "join" page is the most complicated, and also uses javascript and server sent events for live updates. - -<h2> -Database -</h2> - -<p> -See the <a href="database.html">database overview</a> for a brief introduction to the tables involved. - -<h2> -Client/Server -</h2> - -<p> -When playing a game, the browser (client) connects to the server with a web socket. -The query string indicates which game and role to connect to. - -<p> -The game state is stored in a JSON object. A redacted version of this game state is sent to the clients, which then update the game display in real time. -One part of the view object is a list of possible actions a player can take. -When a player clicks on a possible action, a message is sent to the server with this action. -The server then processes the action, updates the game state, and sends out a new view object to all the clients that are connected to the game. - -<p> -The client code for connecting to the server, sending actions, and managing the player list, game log, chat, and notes is shared between all modules. -The following files contain the code and styling for the client display: -<ul> -<li> -<a href="https://git.rally-the-troops.com/common/server/tree/public/fonts/fonts.css">public/fonts/fonts.css</a> -<li> -<a href="https://git.rally-the-troops.com/common/server/tree/public/common/client.css">public/common/client.css</a> -<li> -<a href="https://git.rally-the-troops.com/common/server/tree/public/common/client.js">public/common/client.js</a> -</ul> - -<h2> -Tools -</h2> - -<p> -The "tools" directory holds a number of other useful scripts for administrating the server and debugging modules. - -<dl> - -<dt> -<code>bash tools/export-game.sh <i>game_id</i> > <i>file.json</i></code> -<dd> -Export full game state to a JSON file. -<dt> -<code>node tools/import-game.js [title_id=<i>title</i>] <i>file.json</i></code> -<dd> -Import a game from an export JSON file. - -<dt> -<code>node tools/patchgame.js <i>game_id</i></code> -<dd> -Patch game state for one game (by replaying the action log). - -<dt> -<code>node tools/patchgame.js <i>title_id</i></code> -<dd> -Patch game state for all active games of one module. - -<dt> -<code>bash tools/undo.sh <i>game_id</i></code> -<dd> -Undo an action by removing the last entry in the replay log and running patchgame.js - -<!-- -<dt> -<code>bash tools/gencovers.sh</code> -<dd> -Generate cover images and thumbnails. Requires imagemagick. - -<dt> -<code>bash tools/showgame.sh <i>game_id</i></code> -<dd> -Print game state JSON object. - ---> - -</dl> |