From 0c405911184de242908093c4c1096765070fbc63 Mon Sep 17 00:00:00 2001 From: AngelRionCervi Date: Tue, 4 Jun 2019 18:58:08 +0200 Subject: [PATCH 1/5] disabled prog mod gather --- lib/gather/gather_pool.js | 4 +- package-lock.json | 336 +++----------------------------------- 2 files changed, 24 insertions(+), 316 deletions(-) diff --git a/lib/gather/gather_pool.js b/lib/gather/gather_pool.js index febae61..ff49409 100644 --- a/lib/gather/gather_pool.js +++ b/lib/gather/gather_pool.js @@ -26,7 +26,7 @@ const GATHER_CONFIGS = [ return server.name.toLowerCase().indexOf("promod") === -1; } }, - { + /*{ type: "progmod", icon: '/progmodGather.png', name: "Progressive Mod Gather", @@ -34,7 +34,7 @@ const GATHER_CONFIGS = [ serverMembershipTest: function (server) { return server.name.toLowerCase().indexOf("promod") !== -1; } - }, + },*/ { type: "invitational", icon: '/inviteGather.png', diff --git a/package-lock.json b/package-lock.json index 9b7406d..4e340e3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -2469,11 +2469,13 @@ }, "balanced-match": { "version": "1.0.0", - "bundled": true + "bundled": true, + "optional": true }, "brace-expansion": { "version": "1.1.11", "bundled": true, + "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -2486,15 +2488,18 @@ }, "code-point-at": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "concat-map": { "version": "0.0.1", - "bundled": true + "bundled": true, + "optional": true }, "console-control-strings": { "version": "1.1.0", - "bundled": true + "bundled": true, + "optional": true }, "core-util-is": { "version": "1.0.2", @@ -2597,7 +2602,8 @@ }, "inherits": { "version": "2.0.3", - "bundled": true + "bundled": true, + "optional": true }, "ini": { "version": "1.3.5", @@ -2607,6 +2613,7 @@ "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, + "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -2619,17 +2626,20 @@ "minimatch": { "version": "3.0.4", "bundled": true, + "optional": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.8", - "bundled": true + "bundled": true, + "optional": true }, "minipass": { "version": "2.2.4", "bundled": true, + "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -2646,6 +2656,7 @@ "mkdirp": { "version": "0.5.1", "bundled": true, + "optional": true, "requires": { "minimist": "0.0.8" } @@ -2718,7 +2729,8 @@ }, "number-is-nan": { "version": "1.0.1", - "bundled": true + "bundled": true, + "optional": true }, "object-assign": { "version": "4.1.1", @@ -2728,6 +2740,7 @@ "once": { "version": "1.4.0", "bundled": true, + "optional": true, "requires": { "wrappy": "1" } @@ -2833,6 +2846,7 @@ "string-width": { "version": "1.0.2", "bundled": true, + "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -5997,313 +6011,7 @@ "adm-zip": "^0.4", "buffer-crc32": "^0.2", "bytebuffer": "^5.0", - "steam-crypto": "^0.0", - "steam-resources": "git+https://github.com/seishun/node-steam-resources.git#1403939a12ba467a4b82c8ccbc279bbcdad43588" - }, - "dependencies": { - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=" - }, - "steam-resources": { - "version": "git+https://github.com/seishun/node-steam-resources.git#1403939a12ba467a4b82c8ccbc279bbcdad43588", - "from": "git+https://github.com/seishun/node-steam-resources.git#v1.0.0", - "requires": { - "bytebuffer": "^5.0", - "protobufjs": "^4.1" - }, - "dependencies": { - "bytebuffer": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-5.0.0.tgz", - "integrity": "sha1-TpLJKvedXsPWpllVQSfj+NA9IOc=", - "requires": { - "long": "~3" - }, - "dependencies": { - "long": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/long/-/long-3.0.1.tgz", - "integrity": "sha1-uZKB/nmPpk6jt6dMj+ExUbMxCwU=" - } - } - }, - "protobufjs": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-4.1.2.tgz", - "integrity": "sha1-Cmsb0nz39YcLI9cxPdvnCBWHb8Q=", - "requires": { - "ascli": "~1", - "bytebuffer": "~4 >=4.1", - "glob": "^5.0.10", - "yargs": "^3.10.0" - }, - "dependencies": { - "ascli": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/ascli/-/ascli-1.0.0.tgz", - "integrity": "sha1-A6gEDoYzgkQwBQlwhgKmWRa1OjE=", - "requires": { - "colour": "^0.7.1", - "optjs": "^3.2.2" - }, - "dependencies": { - "colour": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/colour/-/colour-0.7.1.tgz", - "integrity": "sha1-nLFpkX7F0SwHNtPoaFdG3xyt93g=" - }, - "optjs": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/optjs/-/optjs-3.2.2.tgz", - "integrity": "sha1-aabOicRCpEQDFBrS+bNwvVu29O4=" - } - } - }, - "bytebuffer": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/bytebuffer/-/bytebuffer-4.1.0.tgz", - "integrity": "sha1-TFgmngUqseSx9/82T9+zzogpBqo=", - "requires": { - "bufferview": "~1", - "long": "~2 >=2.3.0" - }, - "dependencies": { - "bufferview": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/bufferview/-/bufferview-1.0.1.tgz", - "integrity": "sha1-ev10pF+Tf6QiodM4wIu/3HbNcl0=" - }, - "long": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/long/-/long-2.4.0.tgz", - "integrity": "sha1-n6GAux2VAM3CnEFWdmoZleH0Uk8=" - } - } - }, - "glob": { - "version": "5.0.15", - "resolved": "https://registry.npmjs.org/glob/-/glob-5.0.15.tgz", - "integrity": "sha1-G8k2ueAvSmA/zCIuz3Yz0wuLk7E=", - "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "dependencies": { - "inflight": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", - "integrity": "sha1-bLtFIevVHODsCpNr/XZX736bFyo=", - "requires": { - "once": "^1.3.0", - "wrappy": "1" - }, - "dependencies": { - "wrappy": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz", - "integrity": "sha1-HmWWmWXMvC20VIxrhKbyxa7dRzk=" - } - } - }, - "minimatch": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.0.tgz", - "integrity": "sha1-UjYVelHk8ATBd/s8Un/33Xjw74M=", - "requires": { - "brace-expansion": "^1.0.0" - }, - "dependencies": { - "brace-expansion": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.1.tgz", - "integrity": "sha1-2l+3iu9MRMnkrPUlBk+zII66sEU=", - "requires": { - "balanced-match": "^0.2.0", - "concat-map": "0.0.1" - }, - "dependencies": { - "balanced-match": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-0.2.1.tgz", - "integrity": "sha1-e8ZYtL7WHu5CStdPdfXD4sTfPMc=" - }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" - } - } - } - } - }, - "once": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.2.tgz", - "integrity": "sha1-2P7sqTsDnsHc3ud0HJK9rF4oCBs=", - "requires": { - "wrappy": "1" - }, - "dependencies": { - "wrappy": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz", - "integrity": "sha1-HmWWmWXMvC20VIxrhKbyxa7dRzk=" - } - } - }, - "path-is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", - "integrity": "sha1-Jj2tpmqz8vsQv3+dJN2PPlcO+RI=" - } - } - }, - "yargs": { - "version": "3.29.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.29.0.tgz", - "integrity": "sha1-GquWYOrnnYuPZ1vK7qtu40ws9pw=", - "requires": { - "camelcase": "^1.2.1", - "cliui": "^3.0.3", - "decamelize": "^1.0.0", - "os-locale": "^1.4.0", - "window-size": "^0.1.2", - "y18n": "^3.2.0" - }, - "dependencies": { - "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=" - }, - "cliui": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.0.3.tgz", - "integrity": "sha1-R23l40QskhsWW8+FVq7pww5+FE4=", - "requires": { - "string-width": "^1.0.1", - "strip-ansi": "^3.0.0", - "wrap-ansi": "^1.0.0" - }, - "dependencies": { - "string-width": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.1.tgz", - "integrity": "sha1-ySEptvHX9SrPmvQkom44ZKBc6wo=", - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" - }, - "dependencies": { - "code-point-at": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.0.0.tgz", - "integrity": "sha1-9psZLT99keOC5Lcb3bd4eGGasMY=", - "requires": { - "number-is-nan": "^1.0.0" - }, - "dependencies": { - "number-is-nan": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", - "integrity": "sha1-wCD1KcUoKt/dIz2R1LGBw9aG3Es=" - } - } - }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "requires": { - "number-is-nan": "^1.0.0" - }, - "dependencies": { - "number-is-nan": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.0.tgz", - "integrity": "sha1-wCD1KcUoKt/dIz2R1LGBw9aG3Es=" - } - } - } - } - }, - "strip-ansi": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.0.tgz", - "integrity": "sha1-dRC2ZVZ8qRTMtdfgcnY6yWi+NyQ=", - "requires": { - "ansi-regex": "^2.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.0.0.tgz", - "integrity": "sha1-xQYbbg74qBd15Q9dZhUb9r83EQc=" - } - } - }, - "wrap-ansi": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-1.0.0.tgz", - "integrity": "sha1-9XO7nuI89DiR8zYvXzWaHfo4/DQ=", - "requires": { - "string-width": "^1.0.1" - } - } - } - }, - "decamelize": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.1.1.tgz", - "integrity": "sha1-iHFHmmwEh/VlPUipkvHQOBym8DE=" - }, - "os-locale": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-1.4.0.tgz", - "integrity": "sha1-IPnxeuKe00XoveWDsT0gCYA8FNk=", - "requires": { - "lcid": "^1.0.0" - }, - "dependencies": { - "lcid": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-1.0.0.tgz", - "integrity": "sha1-MIrMr6C8SDo4Z7S28rlQYlHRuDU=", - "requires": { - "invert-kv": "^1.0.0" - }, - "dependencies": { - "invert-kv": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-1.0.0.tgz", - "integrity": "sha1-EEqOSqym09jNFXqO+L+rLXo//bY=" - } - } - } - } - }, - "window-size": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.2.tgz", - "integrity": "sha1-ENU/D47oZ+OoUfC+DjEAhyMp2zo=" - }, - "y18n": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-3.2.0.tgz", - "integrity": "sha1-O+xkyTtzDZJKYUjHZXV5MkM+NMg=" - } - } - } - } - } - } - } + "steam-crypto": "^0.0" } }, "steam-crypto": { From eb1c4e7c6d1f8b1e89a1dfaf5704e5c4e3d10795 Mon Sep 17 00:00:00 2001 From: AngelRionCervi Date: Sun, 9 Jun 2019 16:14:19 +0200 Subject: [PATCH 2/5] added picking pattern --- app/javascripts/components/gather.js | 37 ++++++++++++++++++---- app/stylesheets/app.css | 47 +++++++++++++++++++++++++++- lib/gather/controller.js | 4 +-- lib/gather/gather.js | 38 +++++++++++++--------- lib/gather/gather_pool.js | 4 +-- lib/gather/helper.js | 4 +-- lib/user/helper.js | 2 ++ 7 files changed, 108 insertions(+), 28 deletions(-) diff --git a/app/javascripts/components/gather.js b/app/javascripts/components/gather.js index 40d4870..531dfda 100644 --- a/app/javascripts/components/gather.js +++ b/app/javascripts/components/gather.js @@ -349,10 +349,12 @@ const GatherActions = React.createClass({ render() { let regatherButton; + let pickPatternIndicator; const user = this.props.user; const gather = this.props.gather; const socket = this.props.socket; const thisGatherer = this.props.thisGatherer; + let pickIndex = this.props.gather.pickingTurnIndex - 1; if (thisGatherer) { let regatherVotes = this.regatherVotes(); if (thisGatherer.regatherVote) { @@ -366,19 +368,42 @@ const GatherActions = React.createClass({ {`Vote Regather (${regatherVotes}/8)`} ; } + + pickPatternIndicator = ; } return (
-
    +
    • - -
    • -
    • - {regatherButton} + {pickPatternIndicator}
    • +
        +
      • + +
      • +
      • + {regatherButton} +
      • +
diff --git a/app/stylesheets/app.css b/app/stylesheets/app.css index 60104c8..4edd893 100644 --- a/app/stylesheets/app.css +++ b/app/stylesheets/app.css @@ -332,7 +332,52 @@ html, body { /* minimized drawer gather icons */ -.gatherTypeIcons{ +.gatherTypeIcons { width: 35px; } +/* pick pattern */ + +.float-left { + float: left; +} + +.pick-pattern-box { + width: 75px; + height: 6px; + border-radius: 1px; +} + +.marine-box { + background-color: #2c689c; +} + +.alien-box { + background-color: #9c602c; +} + +.marine-box-active { + box-shadow: 0px 0px 4px 0px #0072ff; + background-color: #0072ff; +} + +.alien-box-active { + box-shadow: 0px 0px 4px 0px #ff8e00; + background-color: #ff8e00; +} + +.content-center { + display: flex; + align-items: center; + justify-content: space-between; +} + +.padding-right-0 { + padding-right: 0 !important; +} + +.padding-y-1 { + padding-top: 2px; + padding-bottom: 2px; +} + diff --git a/lib/gather/controller.js b/lib/gather/controller.js index 17c71d5..0eb017f 100644 --- a/lib/gather/controller.js +++ b/lib/gather/controller.js @@ -106,7 +106,7 @@ module.exports = function (namespace) { }); // ***** Generate Test Users ***** - if (process.env.POPULATE_GATHER) { + //if (process.env.POPULATE_GATHER) { let helper = require("./helper"); GatherPool.forEach(gatherManager => { @@ -114,7 +114,7 @@ module.exports = function (namespace) { gather: gatherManager.current }, refreshGather()); }); - } + //} namespace.on("connection", function (socket) { ArchivedGather.recent((error, recentGathers) => { diff --git a/lib/gather/gather.js b/lib/gather/gather.js index 71ebde7..0f986d7 100644 --- a/lib/gather/gather.js +++ b/lib/gather/gather.js @@ -48,7 +48,7 @@ function Gather (options) { this.description = options.description || "No player requirements"; this.election = { - INTERVAL: 60000, // 1 Minute + INTERVAL: 5000, // 1 Minute startTime: null, timer: null }; @@ -257,17 +257,9 @@ Gather.prototype.modifyGatherer = function (user, callback){ .forEach(callback); }; -// Determines picking order of teams -// Marine pick first -Gather.prototype.pickingTurn = function () { - if (this.current !== 'selection') return null; - - const captainCount = 2; - const alienCount = this.aliens().length; - const marineCount = this.marines().length; - const alreadyPickedCount = (marineCount + alienCount) - captainCount; +Gather.prototype.getPickingPattern = function () { const pickingPattern = [ // 1-2-2-2-2-2-1 - "marine", + "alien", "alien", "alien", "marine", @@ -280,6 +272,20 @@ Gather.prototype.pickingTurn = function () { "alien", "marine", ]; + + return pickingPattern; +} + +// Determines picking order of teams +// Marine pick first +Gather.prototype.pickingTurn = function () { + if (this.current !== 'selection') return null; + + const captainCount = 2; + const alienCount = this.aliens().length; + const marineCount = this.marines().length; + const alreadyPickedCount = (marineCount + alienCount) - captainCount; + const pickingPattern = this.getPickingPattern(); const pickingTurn = alreadyPickedCount % pickingPattern.length; @@ -290,7 +296,7 @@ Gather.prototype.pickingTurn = function () { return "marine"; } - return pickingPattern[pickingTurn]; + return pickingTurn; }; // Moves player to marine @@ -303,7 +309,7 @@ Gather.prototype.moveToMarine = function (user, mover) { let leader = this.getGatherer(mover); if (leader.team !== "marine" || !leader.leader || - this.pickingTurn() !== "marine") return; + this.pickingPattern()[this.pickingTurn()] !== "marine") return; if (user && this.containsUser(user)) { if (this.getGatherer(user).team !== "lobby") return; @@ -324,7 +330,7 @@ Gather.prototype.moveToAlien = function (user, mover) { let leader = this.getGatherer(mover); if (leader.team !== "alien" || !leader.leader || - this.pickingTurn() !== "alien") return; + this.getPickingPattern()[this.pickingTurn()] !== "alien") return; if (user && this.containsUser(user)) { if (this.getGatherer(user).team !== "lobby") return; @@ -368,7 +374,9 @@ Gather.prototype.toJson = function () { gatherers: this.gatherers, servers: this.getServers(), state: this.current, - pickingTurn: this.pickingTurn(), + pickingTurn: this.getPickingPattern()[this.pickingTurn()], + pickingTurnIndex: this.pickingTurn(), + pickingPattern: this.getPickingPattern().splice(0, this.getPickingPattern().length-2), //why is the picking pattern length 12 anyway ? 12 - 2 captains election: { startTime: this.electionStartTime(), interval: this.election.INTERVAL diff --git a/lib/gather/gather_pool.js b/lib/gather/gather_pool.js index ff49409..06b2091 100644 --- a/lib/gather/gather_pool.js +++ b/lib/gather/gather_pool.js @@ -23,7 +23,7 @@ const GATHER_CONFIGS = [ name: "Classic Gather", description: "No Requirements", serverMembershipTest: function (server) { - return server.name.toLowerCase().indexOf("promod") === -1; + //return server.name.toLowerCase().indexOf("promod") === -1; } }, /*{ @@ -45,7 +45,7 @@ const GATHER_CONFIGS = [ return InvitationalGather.list.some(m => m.id === user.id); }, serverMembershipTest: function (server) { - return server.name.toLowerCase().indexOf("promod") === -1; + //return server.name.toLowerCase().indexOf("promod") === -1; } } // { diff --git a/lib/gather/helper.js b/lib/gather/helper.js index d612389..0c3ce70 100644 --- a/lib/gather/helper.js +++ b/lib/gather/helper.js @@ -26,10 +26,10 @@ var createTestUsers = (options, callback) => { console.log("Error while adding gatherers", error); } else { console.log("Loaded gatherers"); - gather.gatherers.forEach((gatherer, index, array) => { + /*gather.gatherers.forEach((gatherer, index, array) => { var candidate = Math.floor(Math.random() * array.length); array[index].leaderVote = array[candidate].id; - }); + });*/ console.log("Assigned vote for each gatherer"); if (typeof callback === 'function') return callback(gather); } diff --git a/lib/user/helper.js b/lib/user/helper.js index 232648e..8eb83db 100644 --- a/lib/user/helper.js +++ b/lib/user/helper.js @@ -15,3 +15,5 @@ var getRandomUser = callback => { module.exports = { getRandomUser: getRandomUser }; + + From e50025de6db9a43075019012dd9a756197ef82ea Mon Sep 17 00:00:00 2001 From: AngelRionCervi Date: Sun, 9 Jun 2019 22:30:28 +0200 Subject: [PATCH 3/5] removed all changes to helpers --- app/javascripts/components/gather.js | 4 ++-- lib/gather/controller.js | 4 ++-- lib/gather/gather.js | 14 +++++++------- lib/gather/gather_pool.js | 4 ++-- lib/gather/helper.js | 4 ++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/app/javascripts/components/gather.js b/app/javascripts/components/gather.js index 531dfda..223c182 100644 --- a/app/javascripts/components/gather.js +++ b/app/javascripts/components/gather.js @@ -372,13 +372,13 @@ const GatherActions = React.createClass({ pickPatternIndicator =
    {gather.pickingPattern.map((team, index) => { if (team === 'alien') { - if(index <= pickIndex){ + if (index <= pickIndex) { return
  • }else{ return
  • } } else { - if(index <= pickIndex){ + if (index <= pickIndex) { return
  • }else{ return
  • diff --git a/lib/gather/controller.js b/lib/gather/controller.js index 0eb017f..17c71d5 100644 --- a/lib/gather/controller.js +++ b/lib/gather/controller.js @@ -106,7 +106,7 @@ module.exports = function (namespace) { }); // ***** Generate Test Users ***** - //if (process.env.POPULATE_GATHER) { + if (process.env.POPULATE_GATHER) { let helper = require("./helper"); GatherPool.forEach(gatherManager => { @@ -114,7 +114,7 @@ module.exports = function (namespace) { gather: gatherManager.current }, refreshGather()); }); - //} + } namespace.on("connection", function (socket) { ArchivedGather.recent((error, recentGathers) => { diff --git a/lib/gather/gather.js b/lib/gather/gather.js index 0f986d7..6c394e1 100644 --- a/lib/gather/gather.js +++ b/lib/gather/gather.js @@ -48,7 +48,7 @@ function Gather (options) { this.description = options.description || "No player requirements"; this.election = { - INTERVAL: 5000, // 1 Minute + INTERVAL: 60000, // 1 Minute startTime: null, timer: null }; @@ -259,7 +259,7 @@ Gather.prototype.modifyGatherer = function (user, callback){ Gather.prototype.getPickingPattern = function () { const pickingPattern = [ // 1-2-2-2-2-2-1 - "alien", + "marine", "alien", "alien", "marine", @@ -278,7 +278,7 @@ Gather.prototype.getPickingPattern = function () { // Determines picking order of teams // Marine pick first -Gather.prototype.pickingTurn = function () { +Gather.prototype.pickingTurnIndex = function () { if (this.current !== 'selection') return null; const captainCount = 2; @@ -309,7 +309,7 @@ Gather.prototype.moveToMarine = function (user, mover) { let leader = this.getGatherer(mover); if (leader.team !== "marine" || !leader.leader || - this.pickingPattern()[this.pickingTurn()] !== "marine") return; + this.pickingPattern()[this.pickingTurnIndex()] !== "marine") return; if (user && this.containsUser(user)) { if (this.getGatherer(user).team !== "lobby") return; @@ -330,7 +330,7 @@ Gather.prototype.moveToAlien = function (user, mover) { let leader = this.getGatherer(mover); if (leader.team !== "alien" || !leader.leader || - this.getPickingPattern()[this.pickingTurn()] !== "alien") return; + this.getPickingPattern()[this.pickingTurnIndex()] !== "alien") return; if (user && this.containsUser(user)) { if (this.getGatherer(user).team !== "lobby") return; @@ -374,8 +374,8 @@ Gather.prototype.toJson = function () { gatherers: this.gatherers, servers: this.getServers(), state: this.current, - pickingTurn: this.getPickingPattern()[this.pickingTurn()], - pickingTurnIndex: this.pickingTurn(), + pickingTurn: this.getPickingPattern()[this.pickingTurnIndex()], + pickingTurnIndex: this.pickingTurnIndex(), pickingPattern: this.getPickingPattern().splice(0, this.getPickingPattern().length-2), //why is the picking pattern length 12 anyway ? 12 - 2 captains election: { startTime: this.electionStartTime(), diff --git a/lib/gather/gather_pool.js b/lib/gather/gather_pool.js index 06b2091..ff49409 100644 --- a/lib/gather/gather_pool.js +++ b/lib/gather/gather_pool.js @@ -23,7 +23,7 @@ const GATHER_CONFIGS = [ name: "Classic Gather", description: "No Requirements", serverMembershipTest: function (server) { - //return server.name.toLowerCase().indexOf("promod") === -1; + return server.name.toLowerCase().indexOf("promod") === -1; } }, /*{ @@ -45,7 +45,7 @@ const GATHER_CONFIGS = [ return InvitationalGather.list.some(m => m.id === user.id); }, serverMembershipTest: function (server) { - //return server.name.toLowerCase().indexOf("promod") === -1; + return server.name.toLowerCase().indexOf("promod") === -1; } } // { diff --git a/lib/gather/helper.js b/lib/gather/helper.js index 0c3ce70..d612389 100644 --- a/lib/gather/helper.js +++ b/lib/gather/helper.js @@ -26,10 +26,10 @@ var createTestUsers = (options, callback) => { console.log("Error while adding gatherers", error); } else { console.log("Loaded gatherers"); - /*gather.gatherers.forEach((gatherer, index, array) => { + gather.gatherers.forEach((gatherer, index, array) => { var candidate = Math.floor(Math.random() * array.length); array[index].leaderVote = array[candidate].id; - });*/ + }); console.log("Assigned vote for each gatherer"); if (typeof callback === 'function') return callback(gather); } From a9e8d0848afb7d37755615000ad414066b8ab811 Mon Sep 17 00:00:00 2001 From: AngelRionCervi Date: Mon, 10 Jun 2019 09:50:43 +0200 Subject: [PATCH 4/5] renamed pickingPattern -> getPickingPattern --- lib/gather/gather.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gather/gather.js b/lib/gather/gather.js index 6c394e1..38a7f1d 100644 --- a/lib/gather/gather.js +++ b/lib/gather/gather.js @@ -309,7 +309,7 @@ Gather.prototype.moveToMarine = function (user, mover) { let leader = this.getGatherer(mover); if (leader.team !== "marine" || !leader.leader || - this.pickingPattern()[this.pickingTurnIndex()] !== "marine") return; + this.getPickingPattern()[this.pickingTurnIndex()] !== "marine") return; if (user && this.containsUser(user)) { if (this.getGatherer(user).team !== "lobby") return; From 7402dbcdd0a085003a102a44fceb4edbd93f8f07 Mon Sep 17 00:00:00 2001 From: AngelRionCervi Date: Tue, 18 Jun 2019 23:31:16 +0200 Subject: [PATCH 5/5] replaced all teamspeak with all discord --- app/javascripts/components/discord.js | 71 ++++++++++++++++++++++ app/javascripts/components/main.js | 4 +- app/javascripts/components/teamspeak.js | 81 ------------------------- app/stylesheets/app.css | 6 ++ 4 files changed, 79 insertions(+), 83 deletions(-) create mode 100644 app/javascripts/components/discord.js delete mode 100644 app/javascripts/components/teamspeak.js diff --git a/app/javascripts/components/discord.js b/app/javascripts/components/discord.js new file mode 100644 index 0000000..d857ff5 --- /dev/null +++ b/app/javascripts/components/discord.js @@ -0,0 +1,71 @@ +const React = require("react"); + +const discordDefaults = { + url: "https://discord.gg/Bvs3KjX", + alien: { + channel: "https://discord.gg/UcN724q", + }, + marine: { + channel: "https://discord.gg/eGwfHXz", + } +}; + +const DiscordButton = exports.DiscordButton = React.createClass({ + getInitialState() { + return { + open: false + }; + }, + + toggleOpen(e) { + e.preventDefault(); + this.setState({ open: !this.state.open }); + }, + getDefaultProps() { + return discordDefaults + }, + + marineUrl() { + return discordDefaults.marine.channel; + }, + + alienUrl() { + return discordDefaults.alien.channel; + }, + + chevron() { + if (this.state.open) { + return ; + } else { + return ; + } + }, + + render() { + const open = this.state.open; + let componentClass = ["treeview"]; + let dropdown; + if (open) { + componentClass.push("active"); + dropdown = ( + + ); + } + + return ( +
  • + + Discord + {this.chevron()} + + {dropdown} +
  • + ); + } +}); + diff --git a/app/javascripts/components/main.js b/app/javascripts/components/main.js index eaaf65e..4e0ad7e 100644 --- a/app/javascripts/components/main.js +++ b/app/javascripts/components/main.js @@ -8,7 +8,7 @@ import {SoundPanel} from "javascripts/components/sound"; import {SettingsPanel} from "javascripts/components/settings"; import {ArchivedGathers} from "javascripts/components/gatherArchive"; import {CurrentUser, ProfileModal, UserMenu} from "javascripts/components/user"; -import {TeamSpeakButton, TeamSpeakModal} from "javascripts/components/teamspeak"; +import {DiscordButton, DiscordModal} from "javascripts/components/discord"; const React = require("react"); @@ -485,7 +485,7 @@ const GatherPage = React.createClass({ gatherSelectedCallback={this.onGatherSelected} />
    • Information
    • - +
      diff --git a/app/javascripts/components/teamspeak.js b/app/javascripts/components/teamspeak.js deleted file mode 100644 index f69f90a..0000000 --- a/app/javascripts/components/teamspeak.js +++ /dev/null @@ -1,81 +0,0 @@ -const React = require("react"); - -const teamspeakDefaults = { - url: "ts3server://ensl.org/", - password: "ns2gather", - alien: { - channel: "NS2 Gather/Gather #1/Alien", - password: "ns2gather" - }, - marine: { - channel: "NS2 Gather/Gather #1/Marine", - password: "ns2gather" - } -}; - -const TeamSpeakButton = exports.TeamSpeakButton = React.createClass({ - getInitialState() { - return { - open: false - }; - }, - - toggleOpen(e) { - e.preventDefault(); - this.setState({ open: !this.state.open }); - }, - getDefaultProps() { - return teamspeakDefaults - }, - - marineUrl() { - return this.teamSpeakUrl(this.props.marine); - }, - - alienUrl() { - return this.teamSpeakUrl(this.props.alien); - }, - - teamSpeakUrl(conn) { - let params = `channel=${encodeURIComponent(conn.channel)}& - channelpassword=${encodeURIComponent(conn.password)}`; - return (`${this.props.url}?${params}`); - }, - - chevron() { - if (this.state.open) { - return ; - } else { - return ; - } - }, - - render() { - const open = this.state.open; - let componentClass = ["treeview"]; - let dropdown; - if (open) { - componentClass.push("active"); - dropdown = ( - - ); - } - - return ( -
    • - - Teamspeak - {this.chevron()} - - {dropdown} -
    • - ); - } -}); - diff --git a/app/stylesheets/app.css b/app/stylesheets/app.css index 4edd893..a7c6cd9 100644 --- a/app/stylesheets/app.css +++ b/app/stylesheets/app.css @@ -381,3 +381,9 @@ html, body { padding-bottom: 2px; } +.let-me-copy { + padding: 5px 5px 5px 15px; + display: block; + font-size: 14px; +} +