{"id":16968500,"url":"https://github.com/squallstar/consequence","last_synced_at":"2026-04-20T05:03:54.175Z","repository":{"id":27969893,"uuid":"31463064","full_name":"squallstar/consequence","owner":"squallstar","description":"Consequence","archived":false,"fork":false,"pushed_at":"2015-03-19T18:11:27.000Z","size":176,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-26T13:13:03.642Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://staging.consequence.io","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"vuejs-templates/webpack","license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/squallstar.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-28T13:15:45.000Z","updated_at":"2015-10-04T10:39:05.000Z","dependencies_parsed_at":"2022-09-04T11:11:19.109Z","dependency_job_id":null,"html_url":"https://github.com/squallstar/consequence","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squallstar%2Fconsequence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squallstar%2Fconsequence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squallstar%2Fconsequence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/squallstar%2Fconsequence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/squallstar","download_url":"https://codeload.github.com/squallstar/consequence/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244844531,"owners_count":20519790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T00:12:17.779Z","updated_at":"2026-04-20T05:03:54.162Z","avatar_url":"https://github.com/squallstar.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Consequence\n\n[![Circle CI](https://circleci.com/gh/squallstar/consequence.svg?style=svg)](https://circleci.com/gh/squallstar/consequence)\n\n## Development\n\n```\n# Install deps\nnpm install\n\n# Run everything\ngrunt\n```\n\nand then, just open http://localhost/\n\n# Deployment\n\n```\n# Create the app\nheroku create appname\n\n# Set up Nodejs buildpack\nheroku config:set BUILDPACK_URL=https://github.com/heroku/heroku-buildpack-nodejs\n\n# Push master branch to heroku app\ngit push heroku master\n\n# Open the app\nheroku open\n```\n\nSimple as that.\n\n# Structure\n\n## Endpoints\n\n### 1. Auth\n\n```\nGET /login/twitter\nGET /login/twtter/callback\nGET /logout\n```\n\n### 2. Socket\n\n```\nPOST /session\n```\n\n## Tables\n\n### 1. Users\n\n```\nid\nfull_name\nusername\ntwitter_oauth_key\ntwitter_oauth_secret\n```\n\n## Socket structure\n\nNotes:\n\n- Save player status (e.g. location) to DB whenever a socket disconnects, and every minute of activity.\n- Disconnect multiple sessions of the same user\n- Read room JSON/YAML files on startup. If YAML, try http://nodeca.github.io/js-yaml/\n\n### On connect\n\nPlayer data on socket:\n\n```\nposition = area_id\nlast_request = null\nlast_response = null\n```\n\nSend player instructions if in starting area.\n\n### Example conversation\n\n```\nSERVER\n- open socket\n- setup player last position\n- give player instructions (like a tutorial, just ask)\n- emit \"message\": { \"description\": \"You are in the middle of a wooden forest.\" }\n\nCLIENT\n- emit \"message\": \"look around\"\n\nSERVER\n- emit \"message\": { \"description\": \"There is a small house on the left\" }\n\nCLIENT\n- emit \"message\": \"enter house\"\n\nSERVER\n- emit \"message\": { \"description\" : \"You are inside a house. There are some keys on the ground, and a bottle of water\" }\n\nCLIENT\n- emit \"message\": \"exit\"\n\nSERVER\n- emit \"message\": { \"description\" : \"You are in front of the building\" }\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquallstar%2Fconsequence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquallstar%2Fconsequence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquallstar%2Fconsequence/lists"}