From 6ffab8daa6d95b2ccb7c426a662e6ada86bae4bd Mon Sep 17 00:00:00 2001 From: molleindustria Date: Mon, 6 Apr 2020 09:18:49 -0400 Subject: [PATCH] added .env info Added clarifications and fallback if env vars are not present --- .env | 2 ++ README.md | 14 ++++++++++---- public/client.js | 2 +- server.js | 4 +++- 4 files changed, 16 insertions(+), 6 deletions(-) create mode 100644 .env diff --git a/.env b/.env new file mode 100644 index 0000000..899da82 --- /dev/null +++ b/.env @@ -0,0 +1,2 @@ +ADMINS=adminname1|pass1,adminname2|pass2 +PORT = 3000 \ No newline at end of file diff --git a/README.md b/README.md index 5e0a8b1..c9ba7eb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # LIKELIKE Online -The tiniest MMORPG. Choose an avatar and hang out with your friends in a virtual version of [LIKELIKE](http://likelike.org/) a videogame gallery in Pittsburgh, PA. +The tiniest MMORPG. Choose an avatar and hang out with your friends in a virtual version of [LIKELIKE](http://likelike.org/shows) a videogame gallery in Pittsburgh, PA. + +>>>Try it here<<< This project was created during the COVID-19 quarantine and was meant to evoke the social aspect of LIKELIKE's exhibitions. You can mod it to create your own virtual exhibitions, multi-user environments or games. @@ -45,11 +47,15 @@ Alternatively you can follow this process to deploy it starting from a zipped pr * Refresh our app so the new files are shown in the editor and published `refresh` -* **Important** The .env file contains the private variables like admin usernames and passwords. It won't be zipped or overwritten so if you have to copy its content manually in the glitch editor +## The .env file + +.env is a text file in the root folder that contains private variables, in this case admin usernames and passwords and the port used by the project. It's not published on github and it's not automatically published on glitch so you have to create it manually and copy paste the content in the glitch editor and/or in your code editor if you are running is as a local project. -An example of .env file: +An example of .env file for LIKELIKE online: ```javascript -ADMINS=username1|pass1,username2|pass2 +ADMINS=adminname1|pass1,adminname2|pass2 PORT = 3000 ``` + +The admin names are reserved. Logging in as "adminname|pass" (nickname and password separated by a "|") will grant the user admin priviledges such as banning IP or sending special messages. diff --git a/public/client.js b/public/client.js index 900690e..904897c 100644 --- a/public/client.js +++ b/public/client.js @@ -18,7 +18,7 @@ var QUICK_LOGIN = false; //true: preview the room as invisible user //false: go directly to the login without previewing the room //ignored if QUICK_LOGIN is true -var LURK_MODE = false; +var LURK_MODE = true; //expose the room locations on the url and make them them shareable //you can access the world from any point. False ignores diff --git a/server.js b/server.js index 2faa95b..5851dcc 100644 --- a/server.js +++ b/server.js @@ -58,7 +58,9 @@ and it's never shared to other clients, unlike player.nickName admins can call admin commands from the chat like /kick nickName */ -var admins = process.env.ADMINS.split(","); +var admins = []; +if (process.env.ADMINS != null) + admins = process.env.ADMINS.split(","); //We want the server to keep track of the whole game state //in this case the game state are the attributes of each player