]> git.cworth.org Git - lmno-api/commitdiff
Add a new protocol description for the new LMNO API
authorCarl Worth <cworth@cworth.org>
Sun, 17 May 2020 22:48:49 +0000 (15:48 -0700)
committerCarl Worth <cworth@cworth.org>
Sun, 17 May 2020 22:48:49 +0000 (15:48 -0700)
This exists above the level of any specific game implementation (such
as empires) and handles the allocation of unique IDs for games and
also allows for a namespace in which the API of games below are
mounted.

lmno.txt [new file with mode: 0644]

diff --git a/lmno.txt b/lmno.txt
new file mode 100644 (file)
index 0000000..3caa236
--- /dev/null
+++ b/lmno.txt
@@ -0,0 +1,78 @@
+Web interface for lmno.games server
+===================================
+https://lmno.games/*
+--------------------
+Serves static content (if file exists in filesystem),
+otherwise proxies to dynamic server.
+
+https://lmno.games/
+------------------
+Type: Static
+
+Form: "Join game: (ID)"
+
+  Dynamic lookup
+  Redirects to https://lmno.games/<game_engine>/<ID>/
+  For example: https://lmno.games/empires/WXYZ/
+
+Links: Host a new game:
+
+  "Empires" links to https://lmno.games/empires
+
+  "Other game" links to https://lmno.games/other_game
+
+  etc.
+
+https://lmno.games/WXYZ/
+------------------------
+Type: Dynamic
+
+  Redirects to https://lmno.games/<game_engine>/WXYZ/
+
+https//lmno.games/new/<engine> (POST)
+-------------------------------------
+Type: Dynamic
+
+Creates a new, unique game ID and returns it as a JSON string
+
+  Returns: "WXYZ"
+
+https://lmno.games/empires
+--------------------------
+Type: Static
+
+Form: Start a new game
+
+  Sends POST to https://lmno.games/new/empires
+  Receives game ID as a JSON string (for example, "WXYZ")
+
+https://lmno.games/empires/WXYZ?flavor=flutter
+----------------------------------------------
+Type: Dynamic (to lookup game ID), but otherwise a static result
+
+Serves game content (either the default or the "flutter" flavor)
+
+Buttons, forms, etc.:
+
+  https://lmno.games/WXYZ/empires/register (form action="/empires/register")
+  https://lmno.games/WXYZ/empires/events
+  etc.
+
+Native mobile client
+====================
+Join game (ID):
+
+  Client saves game ID (WXYZ, say)
+
+Client queries game state
+
+  https://lmno.games/WXYZ/empires/players
+
+Client posts game updates:
+
+  https://lmno.games/WXYZ/empires/register
+  etc.
+
+New game:
+
+  https://lmno.games/