{"action":"closed","issue":{"url":"https://api.github.com/repos/swarmsim/swarm/issues/532","labels_url":"https://api.github.com/repos/swarmsim/swarm/issues/532/labels{/name}","comments_url":"https://api.github.com/repos/swarmsim/swarm/issues/532/comments","events_url":"https://api.github.com/repos/swarmsim/swarm/issues/532/events","html_url":"https://github.com/swarmsim/swarm/issues/532","id":66794992,"number":532,"title":"share code between server and client","user":{"login":"erosson","id":238846,"avatar_url":"https://avatars.githubusercontent.com/u/238846?v=3","gravatar_id":"","url":"https://api.github.com/users/erosson","html_url":"https://github.com/erosson","followers_url":"https://api.github.com/users/erosson/followers","following_url":"https://api.github.com/users/erosson/following{/other_user}","gists_url":"https://api.github.com/users/erosson/gists{/gist_id}","starred_url":"https://api.github.com/users/erosson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erosson/subscriptions","organizations_url":"https://api.github.com/users/erosson/orgs","repos_url":"https://api.github.com/users/erosson/repos","events_url":"https://api.github.com/users/erosson/events{/privacy}","received_events_url":"https://api.github.com/users/erosson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/swarmsim/swarm/labels/dev%20tools/env","name":"dev tools/env","color":"c7def8"}],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/swarmsim/swarm/milestones/12","html_url":"https://github.com/swarmsim/swarm/milestones/pre-1.1","labels_url":"https://api.github.com/repos/swarmsim/swarm/milestones/12/labels","id":1071548,"number":12,"title":"pre-1.1","description":"silent server-side users/characters.\r\n\r\nno visible changes to players. on the backend, everyone gets a server-side user account and character, and the game writes to the server with every action.\r\n\r\nserver data isn't yet used for anything - anything read from the server should be mostly ignored. the client-side savestate is still the authority. server stuff won't be visible to players until 1.1.\r\n\r\ndoing all this silently/invisibly lets us solve scaling problems before they impact players.","creator":{"login":"erosson","id":238846,"avatar_url":"https://avatars.githubusercontent.com/u/238846?v=3","gravatar_id":"","url":"https://api.github.com/users/erosson","html_url":"https://github.com/erosson","followers_url":"https://api.github.com/users/erosson/followers","following_url":"https://api.github.com/users/erosson/following{/other_user}","gists_url":"https://api.github.com/users/erosson/gists{/gist_id}","starred_url":"https://api.github.com/users/erosson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erosson/subscriptions","organizations_url":"https://api.github.com/users/erosson/orgs","repos_url":"https://api.github.com/users/erosson/repos","events_url":"https://api.github.com/users/erosson/events{/privacy}","received_events_url":"https://api.github.com/users/erosson/received_events","type":"User","site_admin":false},"open_issues":6,"closed_issues":4,"state":"open","created_at":"2015-04-17T01:09:24Z","updated_at":"2015-04-17T01:13:47Z","due_on":null,"closed_at":null},"comments":3,"created_at":"2015-04-07T06:39:23Z","updated_at":"2015-04-17T01:13:47Z","closed_at":"2015-04-17T01:13:47Z","body":"decide the best way to share some custom code between server and client. we need  gameplay code (game/unit/upgrade/effect/commands.coffee, and probably others) in both the server and client, to keep the two in sync.\r\n\r\n* packaging\r\n  * symlink (or build-script-copy) a shared dir; use angular+node headers\r\n  * bower + npm package releases; use angular+node headers\r\n  * node.js-style code, browserify during the build process\r\n  * node.js-style code, serve js from the server with browserify (but I want the game to work offline!)\r\n* shared code location\r\n  * `/shared/` dir in this project\r\n  * new git repo?\r\n\r\ncurrently leaning toward symlinks and a /shared/ dir: it's the simplest. package releases are the \"right\" way to do it, but I really don't wanna deal with a third thing to release, and I think bower also requires a separate repo.\r\n\r\nshare some dummy code between server and client, just to get a sharing mechanism working.\r\n\r\nthis one might need to wait until v1.2 - #533 is *big*."}}