removed all changes to helpers

This commit is contained in:
AngelRionCervi 2019-06-09 22:30:28 +02:00
parent eb1c4e7c6d
commit e50025de6d
5 changed files with 15 additions and 15 deletions

View file

@ -372,13 +372,13 @@ const GatherActions = React.createClass({
pickPatternIndicator = <ul className="list-inline"> pickPatternIndicator = <ul className="list-inline">
{gather.pickingPattern.map((team, index) => { {gather.pickingPattern.map((team, index) => {
if (team === 'alien') { if (team === 'alien') {
if(index <= pickIndex){ if (index <= pickIndex) {
return <li className="padding-y-1"><div className="pick-pattern-box alien-box-active"></div></li> return <li className="padding-y-1"><div className="pick-pattern-box alien-box-active"></div></li>
}else{ }else{
return <li className="padding-y-1"><div className="pick-pattern-box alien-box"></div></li> return <li className="padding-y-1"><div className="pick-pattern-box alien-box"></div></li>
} }
} else { } else {
if(index <= pickIndex){ if (index <= pickIndex) {
return <li className="padding-y-1"><div className="pick-pattern-box marine-box-active"></div></li> return <li className="padding-y-1"><div className="pick-pattern-box marine-box-active"></div></li>
}else{ }else{
return <li className="padding-y-1"><div className="pick-pattern-box marine-box"></div></li> return <li className="padding-y-1"><div className="pick-pattern-box marine-box"></div></li>

View file

@ -106,7 +106,7 @@ module.exports = function (namespace) {
}); });
// ***** Generate Test Users ***** // ***** Generate Test Users *****
//if (process.env.POPULATE_GATHER) { if (process.env.POPULATE_GATHER) {
let helper = require("./helper"); let helper = require("./helper");
GatherPool.forEach(gatherManager => { GatherPool.forEach(gatherManager => {
@ -114,7 +114,7 @@ module.exports = function (namespace) {
gather: gatherManager.current gather: gatherManager.current
}, refreshGather()); }, refreshGather());
}); });
//} }
namespace.on("connection", function (socket) { namespace.on("connection", function (socket) {
ArchivedGather.recent((error, recentGathers) => { ArchivedGather.recent((error, recentGathers) => {

View file

@ -48,7 +48,7 @@ function Gather (options) {
this.description = options.description || "No player requirements"; this.description = options.description || "No player requirements";
this.election = { this.election = {
INTERVAL: 5000, // 1 Minute INTERVAL: 60000, // 1 Minute
startTime: null, startTime: null,
timer: null timer: null
}; };
@ -259,7 +259,7 @@ Gather.prototype.modifyGatherer = function (user, callback){
Gather.prototype.getPickingPattern = function () { Gather.prototype.getPickingPattern = function () {
const pickingPattern = [ // 1-2-2-2-2-2-1 const pickingPattern = [ // 1-2-2-2-2-2-1
"alien", "marine",
"alien", "alien",
"alien", "alien",
"marine", "marine",
@ -278,7 +278,7 @@ Gather.prototype.getPickingPattern = function () {
// Determines picking order of teams // Determines picking order of teams
// Marine pick first // Marine pick first
Gather.prototype.pickingTurn = function () { Gather.prototype.pickingTurnIndex = function () {
if (this.current !== 'selection') return null; if (this.current !== 'selection') return null;
const captainCount = 2; const captainCount = 2;
@ -309,7 +309,7 @@ Gather.prototype.moveToMarine = function (user, mover) {
let leader = this.getGatherer(mover); let leader = this.getGatherer(mover);
if (leader.team !== "marine" || if (leader.team !== "marine" ||
!leader.leader || !leader.leader ||
this.pickingPattern()[this.pickingTurn()] !== "marine") return; this.pickingPattern()[this.pickingTurnIndex()] !== "marine") return;
if (user && this.containsUser(user)) { if (user && this.containsUser(user)) {
if (this.getGatherer(user).team !== "lobby") return; if (this.getGatherer(user).team !== "lobby") return;
@ -330,7 +330,7 @@ Gather.prototype.moveToAlien = function (user, mover) {
let leader = this.getGatherer(mover); let leader = this.getGatherer(mover);
if (leader.team !== "alien" || if (leader.team !== "alien" ||
!leader.leader || !leader.leader ||
this.getPickingPattern()[this.pickingTurn()] !== "alien") return; this.getPickingPattern()[this.pickingTurnIndex()] !== "alien") return;
if (user && this.containsUser(user)) { if (user && this.containsUser(user)) {
if (this.getGatherer(user).team !== "lobby") return; if (this.getGatherer(user).team !== "lobby") return;
@ -374,8 +374,8 @@ Gather.prototype.toJson = function () {
gatherers: this.gatherers, gatherers: this.gatherers,
servers: this.getServers(), servers: this.getServers(),
state: this.current, state: this.current,
pickingTurn: this.getPickingPattern()[this.pickingTurn()], pickingTurn: this.getPickingPattern()[this.pickingTurnIndex()],
pickingTurnIndex: this.pickingTurn(), pickingTurnIndex: this.pickingTurnIndex(),
pickingPattern: this.getPickingPattern().splice(0, this.getPickingPattern().length-2), //why is the picking pattern length 12 anyway ? 12 - 2 captains pickingPattern: this.getPickingPattern().splice(0, this.getPickingPattern().length-2), //why is the picking pattern length 12 anyway ? 12 - 2 captains
election: { election: {
startTime: this.electionStartTime(), startTime: this.electionStartTime(),

View file

@ -23,7 +23,7 @@ const GATHER_CONFIGS = [
name: "Classic Gather", name: "Classic Gather",
description: "No Requirements", description: "No Requirements",
serverMembershipTest: function (server) { 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); return InvitationalGather.list.some(m => m.id === user.id);
}, },
serverMembershipTest: function (server) { serverMembershipTest: function (server) {
//return server.name.toLowerCase().indexOf("promod") === -1; return server.name.toLowerCase().indexOf("promod") === -1;
} }
} }
// { // {

View file

@ -26,10 +26,10 @@ var createTestUsers = (options, callback) => {
console.log("Error while adding gatherers", error); console.log("Error while adding gatherers", error);
} else { } else {
console.log("Loaded gatherers"); console.log("Loaded gatherers");
/*gather.gatherers.forEach((gatherer, index, array) => { gather.gatherers.forEach((gatherer, index, array) => {
var candidate = Math.floor(Math.random() * array.length); var candidate = Math.floor(Math.random() * array.length);
array[index].leaderVote = array[candidate].id; array[index].leaderVote = array[candidate].id;
});*/ });
console.log("Assigned vote for each gatherer"); console.log("Assigned vote for each gatherer");
if (typeof callback === 'function') return callback(gather); if (typeof callback === 'function') return callback(gather);
} }