Merge pull request #169 from AngelRionCervi/afk-timer-fix

can't kick when election or selection is started
This commit is contained in:
Absurdon 2020-08-10 18:00:52 +02:00 committed by GitHub
commit be40a45c7e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 12 deletions

View file

@ -29,7 +29,7 @@ npm run watch # Compile and watch frontend assets
RANDOM_USER=true npm run dev # Run dev server, loading yourself as a random user
# or
Fixed_USER=989 npm run dev # Run dev server, loading yourself as any user with the specified id
FIXED_USER=989 npm run dev # Run dev server, loading yourself as any user with the specified id
```
## Run in production

View file

@ -25,7 +25,7 @@ const ArchivedGather = mongoose.model("ArchivedGather");
const Event = mongoose.model("Event");
const _ = require("lodash");
const winston = require("winston");
const kickTimeout = 300 // sec
const kickTimeout = 600 // sec
module.exports = function (namespace) {
const emitGather = (socket, gather) => {
@ -53,10 +53,10 @@ module.exports = function (namespace) {
refreshGather(gather.type);
}
const removeAfkGathererTimer = (gather, user) => {
const interval = setInterval(() => {
if (gather.getGatherer(user).user.online) {
console.log(gather.current)
if (gather.getGatherer(user).user.online || gather.current !== "gathering") {
clearInterval(interval);
}
const now = Date.now();

View file

@ -257,20 +257,21 @@ Gather.prototype.modifyGatherer = function (user, callback){
.forEach(callback);
};
// 08/04/20 : 1-1-1-1-1
Gather.prototype.getPickingPattern = function () {
const pickingPattern = [ // 1-2-2-2-2-2-1
const pickingPattern = [
"marine",
"alien",
"alien",
"marine",
"marine",
"alien",
"alien",
"marine",
"marine",
"alien",
"marine",
"alien",
"marine",
"alien",
"marine",
"alien",
];
return pickingPattern;