summaryrefslogtreecommitdiff
path: root/public/docs/module.html
diff options
context:
space:
mode:
authorTor Andersson <tor@ccxvii.net>2024-08-20 11:19:18 +0200
committerTor Andersson <tor@ccxvii.net>2024-08-20 12:24:34 +0200
commitcb73d0710b0eb84d4f788ff9b1d36ed0b02bf970 (patch)
tree7ae6a504b526d2068ebe209325dc360b4b26e655 /public/docs/module.html
parent4f709b04cee3ee9a1df009a8021b84d4f8fe6b81 (diff)
downloadserver-cb73d0710b0eb84d4f788ff9b1d36ed0b02bf970.tar.gz
Use xmp tag for more docs.
Diffstat (limited to 'public/docs/module.html')
-rw-r--r--public/docs/module.html12
1 files changed, 9 insertions, 3 deletions
diff --git a/public/docs/module.html b/public/docs/module.html
index d392b3e..c75020f 100644
--- a/public/docs/module.html
+++ b/public/docs/module.html
@@ -67,7 +67,8 @@ The game landing page on the server has a bit of text introducing the game, and
<p>Put the about text in the about.html file.
-<xmp><p>
+<xmp>
+<p>
Dolorum fugiat dolor temporibus. Debitis ea non illo sed debitis cupiditate
ipsum illo. Eos eos molestias illo quisquam dicta.
@@ -87,7 +88,8 @@ However, if your game uses custom options these need to be added as form fields.
<p>
Add a create.html file to inject form fields into the create game page.
-<xmp><p>
+<xmp>
+<p>
Player count:
<br>
<select name="players">
@@ -113,7 +115,8 @@ Client HTML
<p>
The game needs a play.html file using the following template:
-<xmp><!doctype html>
+<xmp>
+<!doctype html>
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, height=device-height, user-scalable=no, interactive-widget=resizes-content, viewport-fit=cover">
@@ -268,6 +271,9 @@ Either a list of roles, or a function returning a list of roles.
Create the initial game object with a random number seed, scenario, and options object.
<p>
+The "setup" function takes three parameters provided by the server: the random seed (generated by the server when starting the game), the scenario (a string with the scenario name) and options (a plain javascript object with key/value pairs for the options chosen by the user when creating the game).
+
+<p>
The options object is filled in with values from the create.html form fields.
<h3> exports.view = function (game, player) </h3>