Created
September 5, 2013 07:44
-
-
Save nakosung/6447127 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
erver = cargoship() | |
server.get /.*/, (m) -> m.end() | |
gameserver = (create) -> | |
log.info 'game created', create.id, create.secret | |
players = [] | |
(m) -> | |
unless m? | |
log.info 'game destroyed', create.id | |
players.forEach (m) -> m.end() | |
return | |
players.push m | |
log.info "GAME:hello", m.user.id | |
m.on 'end', -> | |
players = _.without players, m | |
log.info "GAME:bye", m.user.id | |
server.use require('partyroom') gameserver | |
server.launch '[email protected]', 9090 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment