From 3cb0b7a6f5583fd9b8f2c56c2f4e72863543da4c Mon Sep 17 00:00:00 2001 From: Mikko Saari Date: Mon, 8 Jul 2019 14:22:39 +0300 Subject: [PATCH] Readme and license. --- LICENSE | 21 +++++++++++++++++++++ readme.md | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 LICENSE create mode 100644 readme.md diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..952178c --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2019 Mikko Saari + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/readme.md b/readme.md new file mode 100644 index 0000000..f0a203f --- /dev/null +++ b/readme.md @@ -0,0 +1,44 @@ +# 18SH Cash Display + +[18SH](https://github.com/msaari/18sh) is great, except the cash information is unpleasantly hidden in the console. 18SH Cash Displays solves the problem by providing a separate display that will show player and company cash totals in larger, more easily visible format. + +18SH Cash Display is a web server that receives updates from 18SH and has a simple web interface that shows the status. It is very low on features on purpose and for example has very thin security features. The purpose is to run it on a temporary server during the game and then run down the server, so security is not much of an issue. + +## Installing + +Clone the project and install the dependencies: + + git clone https://github.com/msaari/18sh-display.git + cd 18sh-display + npm install + +Easiest solution to get a server live is to use a service like [Heroku](https://www.heroku.com/) – the free dynos Heroku provides are more than sufficient for this, and are completely free to use. Once you have Heroku installed and the CLI tools set up, getting a server running is as simple as + + heroku create + git push heroku + +This should get you a running server, with a name like `https://peaceful-sands-90210.herokuapp.com/`. To use this with 18SH, you need to set up an environmental variable that points to the running server. The exact method depends on your system ([see this helpful guide](https://www.schrodinger.com/kb/1842)). On my Mac running zsh, I do it like this: + + export DISPLAY18SH=https://peaceful-sands-90210.herokuapp.com/18sh/ + +In any case, the name of the environmental variable is `DISPLAY18SH` and you need to add `18sh/` to the end of the URL from Heroku (or wherever it is you host the server). This variable needs to be set on the system you use to run 18SH, not on the system that runs the Cash Display. + +## Use during play + +When you have the environmental variable set up and the server running, there's nothing else to do. 18SH will pick up the variable and will update the server with the new cash status after every move. All that remains is to point your browser to the server: + + https://peaceful-sands-90210.herokuapp.com/18sh/ + +where `` is the name of your game in 18SH. This should bring up the cash display. The display will refresh automatically every 30 seconds. + +## Company colors + +The display can show colors for companies. The colors are set from [a CSS file](/css/style.js) (it's a JavaScript module, but inside it's just CSS). Each name tag, company or player, will get a CSS class based on the name: it's the name with all non-alphanumeric characters replaced with underscores. + +These classes can be used to set up colors for companies. The CSS file has some familiar companies already set up (18xx staples like PRR, B&O, C&O, NYC and Erie), and you can add more to suit your needs (if you do add more companies, please do a pull request so I can add them in). + +## License + +Copyright 2019 [Mikko Saari](https://github.com/msaari/) mikko@mikkosaari.fi + +See [license information](LICENSE). \ No newline at end of file