Skip to content

Commit d7717aa

Browse files
committed
updated lint and babel and refactored server
1 parent 3433536 commit d7717aa

11 files changed

+14148
-202
lines changed

.babelrc

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"presets": [
3+
["@babel/env", {
4+
"targets": {
5+
"node": "current"
6+
}
7+
}]
8+
]
9+
}

.eslintrc

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"env": {
3+
"es6": true,
4+
"browser": true,
5+
"node": true,
6+
"jquery": true
7+
},
8+
"rules" : { },
9+
"parser": "@babel/eslint-parser"
10+
}

config.js

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
module.exports = {
2+
host: "0.0.0.0",
3+
port: 3000,
4+
logpath: "logger.php",
5+
foodMass: 1,
6+
fireFood: 20,
7+
limitSplit: 16,
8+
defaultPlayerMass: 10,
9+
virus: {
10+
fill: "#33ff33",
11+
stroke: "#19D119",
12+
strokeWidth: 20,
13+
defaultMass: {
14+
from: 100,
15+
to: 150
16+
},
17+
splitMass: 180
18+
},
19+
gameWidth: 5000,
20+
gameHeight: 5000,
21+
adminPass: "DEFAULT",
22+
gameMass: 20000,
23+
maxFood: 1000,
24+
maxVirus: 50,
25+
slowBase: 4.5,
26+
logChat: 0,
27+
networkUpdateFactor: 40,
28+
maxHeartbeatInterval: 5000,
29+
foodUniformDisposition: true,
30+
virusUniformDisposition: false,
31+
newPlayerInitialPosition: "farthest",
32+
massLossRate: 1,
33+
minMassLoss: 50,
34+
mergeTimer: 15,
35+
sqlinfo: {
36+
connectionLimit: 100,
37+
host: "DEFAULT",
38+
user: "root",
39+
password: "DEFAULT",
40+
database: "DEFAULT",
41+
debug: false
42+
}
43+
};

config.json

-43
This file was deleted.

gulpfile.js

+6-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
/* jshint esversion: 8 */
2+
13
const gulp = require('gulp');
24
const babel = require('gulp-babel');
3-
const jshint = require('gulp-jshint');
5+
const eslint = require('gulp-eslint');
46
const nodemon = require('gulp-nodemon');
57
const uglify = require('gulp-uglify');
68
const util = require('gulp-util');
@@ -10,11 +12,9 @@ const webpack = require('webpack-stream');
1012

1113
gulp.task('lint', () => {
1214
return gulp.src(['**/*.js', '!node_modules/**/*.js', '!bin/**/*.js'])
13-
.pipe(jshint({
14-
esnext: true
15-
}))
16-
.pipe(jshint.reporter('default', { verbose: true}))
17-
.pipe(jshint.reporter('fail'));
15+
.pipe(eslint())
16+
.pipe(eslint.format())
17+
.pipe(eslint.failAfterError())
1818
});
1919

2020
gulp.task('test', gulp.series('lint', () => {
@@ -63,7 +63,6 @@ gulp.task('run', gulp.series('build', () => {
6363
delay: 10,
6464
script: './server/server.js',
6565
cwd: "./bin/",
66-
args: ["config.json"],
6766
ext: 'html,js,css'
6867
})
6968
.on('restart', function () {
@@ -76,7 +75,6 @@ gulp.task('run-only', () => {
7675
delay: 10,
7776
script: './server/server.js',
7877
cwd: "./bin/",
79-
args: ["config.json"],
8078
ext: 'html js css'
8179
})
8280
.on('restart', function () {

0 commit comments

Comments
 (0)