diff --git a/.gitignore b/.gitignore index f2b9338..f35317f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,4 @@ node_modules/ log/ +public/static/css/*.css +*.log diff --git a/npm-debug.log b/npm-debug.log deleted file mode 100644 index 5d3d345..0000000 --- a/npm-debug.log +++ /dev/null @@ -1,50 +0,0 @@ -0 info it worked if it ends with ok -1 verbose cli [ '/usr/local/bin/node', -1 verbose cli '/usr/local/bin/npm', -1 verbose cli 'start', -1 verbose cli '--', -1 verbose cli '-p', -1 verbose cli '70' ] -2 info using npm@3.7.3 -3 info using node@v5.9.1 -4 verbose run-script [ 'prestart', 'start', 'poststart' ] -5 info lifecycle wingbase@0.0.1~prestart: wingbase@0.0.1 -6 silly lifecycle wingbase@0.0.1~prestart: no script for prestart, continuing -7 info lifecycle wingbase@0.0.1~start: wingbase@0.0.1 -8 verbose lifecycle wingbase@0.0.1~start: unsafe-perm in lifecycle true -9 verbose lifecycle wingbase@0.0.1~start: PATH: /usr/local/lib/node_modules/npm/bin/node-gyp-bin:/home/asraelite/code/nodejs/wingbase/node_modules/.bin:/usr/local/bin:/usr/local/heroku/bin:/home/asraelite/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/asraelite/bin:/usr/local/java/jdk1.7.0_45/bin:/home/asraelite/bin:/usr/local/java/jdk1.7.0_45/jre/bin:/home/asraelite/.rvm/bin:/usr/local/bin:/usr/local/bin:/usr/local/go/bin:/home/asraelite/Code/go/bin:/home/asraelite/.rvm/bin -10 verbose lifecycle wingbase@0.0.1~start: CWD: /home/asraelite/code/nodejs/wingbase -11 silly lifecycle wingbase@0.0.1~start: Args: [ '-c', 'node index.js "-p" "70"' ] -12 silly lifecycle wingbase@0.0.1~start: Returned: code: 1 signal: null -13 info lifecycle wingbase@0.0.1~start: Failed to exec start script -14 verbose stack Error: wingbase@0.0.1 start: `node index.js "-p" "70"` -14 verbose stack Exit status 1 -14 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/lib/utils/lifecycle.js:239:16) -14 verbose stack at emitTwo (events.js:100:13) -14 verbose stack at EventEmitter.emit (events.js:185:7) -14 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/spawn.js:24:14) -14 verbose stack at emitTwo (events.js:100:13) -14 verbose stack at ChildProcess.emit (events.js:185:7) -14 verbose stack at maybeClose (internal/child_process.js:850:16) -14 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:215:5) -15 verbose pkgid wingbase@0.0.1 -16 verbose cwd /home/asraelite/code/nodejs/wingbase -17 error Linux 3.13.0-24-generic -18 error argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" "--" "-p" "70" -19 error node v5.9.1 -20 error npm v3.7.3 -21 error code ELIFECYCLE -22 error wingbase@0.0.1 start: `node index.js "-p" "70"` -22 error Exit status 1 -23 error Failed at the wingbase@0.0.1 start script 'node index.js "-p" "70"'. -23 error Make sure you have the latest version of node.js and npm installed. -23 error If you do, this is most likely a problem with the wingbase package, -23 error not with npm itself. -23 error Tell the author that this fails on your system: -23 error node index.js "-p" "70" -23 error You can get information on how to open an issue for this project with: -23 error npm bugs wingbase -23 error Or if that isn't available, you can get their info via: -23 error npm owner ls wingbase -23 error There is likely additional logging output above. -24 verbose exit [ 1, true ] diff --git a/public/static/css/styles.css b/public/static/css/styles.css index 92cb5fd..1bf3b3d 100644 --- a/public/static/css/styles.css +++ b/public/static/css/styles.css @@ -1,74 +1,59 @@ @font-face { - font-family: 'FreePixel'; - src: url('/css/FreePixel.ttf'); + font-family: 'FreePixel'; + src: url("/css/FreePixel.ttf"); } - * { - margin: 0; - padding: 0; - font-family: FreePixel; + margin: 0; + padding: 0; + font-family: FreePixel; } - body { - overflow: hidden; + overflow: hidden; } - #gui { - color: #fff; + color: #fff; } - -#gui > .container { - position: fixed; +.container { + position: fixed; } - -#gui #chat { - bottom: 0; - left: 0; - width: 400px; - max-height: 300px; - overflow: hidden; - background-color: rgba(0, 0, 0, 0.55); +#chat { + bottom: 0; + left: 0; + width: 400px; + max-height: 300px; + overflow: hidden; + background-color: rgba(0,0,0,0.55); } - -#gui #chat-messages > span { - display: block; - margin-top: 5px; +#chat #chat-messages > span { + display: block; + margin-top: 5px; } - -#gui #chat span > span { - color: #afa; +#chat #chat-messages > span > span { + color: #afa; } - -#gui #chat span > span.teama { - color: #f76; +#chat #chat-messages > span > span.teama { + color: #f76; } - -#gui #chat span > span.teamb { - color: #8af; +#chat #chat-messages > span > span.teamb { + color: #8af; } - -#gui #chat span.server { - color: #68c; +#chat #chat-messages > span.server { + color: #68c; } - -#gui #chat input { - font-family: inherit; - font-size: 16px; - border: 0; - display: block; - width: 100%; - padding: 2px 0 2px 0; - background-color: rgba(20, 20, 20, 0.5); +#chat input { + font-family: inherit; + font-size: 16px; + border: 0; + display: block; + width: 100%; + padding: 2px 0 2px 0; + background-color: rgba(20,20,20,0.5); } - -#gui #chat input:focus { - background-color: #eee; +#chat input:focus { + background-color: #eee; } - -#gui #weapons { - bottom: 0; - left: 50%; - transform: translate(-50%, 0); +#weapons { + bottom: 0; + left: 50%; + transform: translate(-50%, 0); } - -#gui #weapons diff --git a/public/static/css/test.css b/public/static/css/test.css deleted file mode 100644 index 6e3c5dd..0000000 --- a/public/static/css/test.css +++ /dev/null @@ -1,3 +0,0 @@ -# test { - ayy: 5; -} diff --git a/public/static/img/favicon_256.png b/public/static/img/favicon_256.png new file mode 100644 index 0000000..b108877 Binary files /dev/null and b/public/static/img/favicon_256.png differ diff --git a/public/stylus/styles.styl b/public/stylus/styles.styl new file mode 100644 index 0000000..6b24c59 --- /dev/null +++ b/public/stylus/styles.styl @@ -0,0 +1,52 @@ +@font-face { + font-family: 'FreePixel'; + src: url('/css/FreePixel.ttf'); +} + +* { + margin: 0; + padding: 0; + font-family: FreePixel; +} + +body { + overflow: hidden; +} + +#gui + color #fff + .container + position fixed + #chat + bottom 0 + left 0 + width 400px + max-height 300px + overflow hidden + background-color rgba(0, 0, 0, 0.55) + #chat-messages + > span + display block + margin-top 5px + > span + color #afa + &.teama + color #f76 + &.teamb + color #8af + &.server + color #68c + input + font-family inherit + font-size 16px + border 0 + display block + width 100% + padding 2px 0 2px 0 + background-color rgba(20, 20, 20, 0.5) + &:focus + background-color #eee + #weapons + bottom 0 + left 50% + transform translate(-50%, 0) diff --git a/public/stylus/test.css b/public/stylus/test.css deleted file mode 100644 index f545d87..0000000 --- a/public/stylus/test.css +++ /dev/null @@ -1,4 +0,0 @@ -# test { - ayy: 5; - b: 2; -} diff --git a/public/stylus/test.styl b/public/stylus/test.styl deleted file mode 100644 index 6f91c77..0000000 --- a/public/stylus/test.styl +++ /dev/null @@ -1,3 +0,0 @@ -# test { - ayy: 5; -} diff --git a/server/game/room/index.js b/server/game/room/index.js index 3449206..abd44eb 100644 --- a/server/game/room/index.js +++ b/server/game/room/index.js @@ -13,7 +13,7 @@ class Room { this.teamB = new Set(); this.world = new World(this); this.name = (Math.random() * 100000 | 0).toString(36); - this.tps = 5; + this.tps = wingbase.args.development ? 5 : 60; this.idGenerator = (function*() { let i = 0; diff --git a/server/index.js b/server/index.js index 1b2dff7..031b6ab 100644 --- a/server/index.js +++ b/server/index.js @@ -17,11 +17,10 @@ class WingbaseServer extends ServerInterface { commander .version(packageJson.version) .option('-d, --development', 'run in development mode') - .option('-p, --port [port]', 'specify port to use', port) + .option('-p, --port ', 'specify port to use', parseInt, port) .parse(process.argv); this.args = commander; - console.log(commander.port); process.on('SIGINT', this.stop.bind(this)); } diff --git a/server/web/index.js b/server/web/index.js index 1e5a07a..3277a14 100644 --- a/server/web/index.js +++ b/server/web/index.js @@ -25,6 +25,7 @@ class WebServer { app.use(stylus.middleware({ src: 'public/stylus', dest: 'public/static/css', + force: wingbase.args.development, compile: (str, path) => { return stylus(str) .set('filename', path)