Skip to content

Commit

Permalink
fixed server data not properly stored, fixed remote ip with ipv6 prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
Stalker2106x committed Aug 24, 2023
1 parent ebf9724 commit e811857
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
2 changes: 1 addition & 1 deletion App.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ class App {
this.initServerList()
this.initRouter()
this.initChat()
this.api = this.app.listen(this.config.gamePort, () => {
this.api = this.app.listen(this.config.gamePort, '0.0.0.0', () => {
utils.logger('game', `Game Server listening on ${this.config.publicIP}:${this.config.gamePort}...`)
})
}
Expand Down
31 changes: 16 additions & 15 deletions models/defaultData.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,43 +24,44 @@ module.exports = {
await app.db.models.Maps.create({ name: 'Awp_city4', author: 'JLB' })
await app.db.models.Maps.create({ name: 'bahu', author: 'Thixomag' })
await app.db.models.Maps.create({ name: 'Base_D02', author: 'Bonovox' })
await app.db.models.Maps.create({ name: 'calumpit', author: 'Bonovox' })
//await app.db.models.Maps.create({ name: 'calumpit', author: 'Bonovox' })
await app.db.models.Maps.create({ name: 'Castle_Rock2', author: 'Bonovox' })
await app.db.models.Maps.create({ name: 'chinatown', author: 'Jake' })
await app.db.models.Maps.create({ name: 'crash', author: '.Bacchus. et TDC' })
//await app.db.models.Maps.create({ name: 'Chinatown', author: 'Jake' })
//await app.db.models.Maps.create({ name: 'Crash', author: '.Bacchus. et TDC' })
await app.db.models.Maps.create({ name: 'CTF_Depot', author: 'Bonovox' })
await app.db.models.Maps.create({ name: 'Decharge', author: 'Deliorha481' })
await app.db.models.Maps.create({ name: 'Egypt', author: 'Laboss' })
await app.db.models.Maps.create({ name: 'forest_bunker', author: 'OVNI89' })
await app.db.models.Maps.create({ name: 'Furusato', author: 'Jake' })
await app.db.models.Maps.create({ name: 'hangar', author: 'Ares' })
await app.db.models.Maps.create({ name: 'LaGrange', author: '?????' })
await app.db.models.Maps.create({ name: 'living_room', author: 'OVNI89' })
await app.db.models.Maps.create({ name: 'Lost_Ark2', author: 'Bonovox' })
await app.db.models.Maps.create({ name: 'medievale', author: 'Ares' })
await app.db.models.Maps.create({ name: 'metro', author: 'TDC' })
//await app.db.models.Maps.create({ name: 'Living_room', author: 'OVNI89' })
//await app.db.models.Maps.create({ name: 'Lost_Ark2', author: 'Bonovox' })
//await app.db.models.Maps.create({ name: 'Medievale', author: 'Ares' })
//await app.db.models.Maps.create({ name: 'Metro', author: 'TDC' })
//await app.db.models.Maps.create({ name: 'old_city', author: 'TDC' })
await app.db.models.Maps.create({ name: 'normandie', author: 'Bonovox' })
await app.db.models.Maps.create({ name: 'nov5mber', author: '?????' })
await app.db.models.Maps.create({ name: 'old_city', author: 'JLB' })
//await app.db.models.Maps.create({ name: 'old_city', author: 'JLB' })
await app.db.models.Maps.create({ name: 'paintball', author: 'Stevo' })
await app.db.models.Maps.create({ name: 'paradise', author: '7LightMan' })
await app.db.models.Maps.create({ name: 'quadrat', author: 'Yaplus' })
await app.db.models.Maps.create({ name: 'RS_Assault', author: '7LightMan' })
await app.db.models.Maps.create({ name: 'RS_Aztec', author: '7LightMan' })
await app.db.models.Maps.create({ name: 'RS_Dust', author: 'Bonovox' })
//await app.db.models.Maps.create({ name: 'RS_Assault', author: '7LightMan' })
//await app.db.models.Maps.create({ name: 'RS_Aztec', author: '7LightMan' })
//await app.db.models.Maps.create({ name: 'RS_Dust', author: 'Bonovox' })
await app.db.models.Maps.create({ name: 'RS_Inferno', author: 'Bonovox' })
await app.db.models.Maps.create({ name: 'RS_Tours', author: 'Bonovox' })
await app.db.models.Maps.create({ name: 'Rue', author: 'JLB' })
await app.db.models.Maps.create({ name: 'seagate', author: 'Bonovox' })
//await app.db.models.Maps.create({ name: 'seagate', author: 'Bonovox' })
await app.db.models.Maps.create({ name: 'SGC', author: 'Electron' })
await app.db.models.Maps.create({ name: 'snip_beach', author: 'OVNI89' })
await app.db.models.Maps.create({ name: 'snip_castle5', author: 'Jake' })
//await app.db.models.Maps.create({ name: 'snip_castle5', author: 'Jake' })
await app.db.models.Maps.create({ name: 'sniper_snow2', author: 'OVNI89' })
await app.db.models.Maps.create({ name: 'StarSnip', author: 'Bonovox' })
await app.db.models.Maps.create({ name: 'station_orbitale', author: 'Jake' })
//await app.db.models.Maps.create({ name: 'station_orbitale', author: 'Jake' })
await app.db.models.Maps.create({ name: 'Sucrerie', author: '?????' })
await app.db.models.Maps.create({ name: 'Thermes', author: 'Bonovox' })
await app.db.models.Maps.create({ name: 'trenchwar', author: 'Bonovox' })
//await app.db.models.Maps.create({ name: 'trenchwar', author: 'Bonovox' })
await app.db.models.Maps.create({ name: 'tunisia', author: 'TDC' })
await app.db.models.Maps.create({ name: 'Valaperil', author: 'Yamamoto' })
await app.db.models.Maps.create({ name: 'Z51', author: 'Bonovox' })
Expand Down
6 changes: 3 additions & 3 deletions routes/server/createServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ module.exports = {
name: req.body.DESC,
version: req.body.LAVERSION,
host: (req.headers['cf-connecting-ip'] || req.headers['x-real-ip'] || req.headers['x-forwarded-for'] || req.connection.remoteAddress || '0.0.0.0').split(',')[0].trim(),
owner: req.body.LENUM,
owner: parseInt(req.body.LENUM),
level: req.body.LECOMMENT,
description: req.body.DESC,
slots: req.body.MAX_PLAYERS,
tournamentId: req.body.CLE_TOURNOIS,
slots: parseInt(req.body.MAX_PLAYERS),
tournamentId: parseInt(req.body.CLE_TOURNOIS),
private: req.body.PRIVEE === '0' ? true : false,
weapons: req.body.ARMES,
md5: req.body.MD5,
Expand Down
2 changes: 1 addition & 1 deletion routes/server/deleteServer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ module.exports = {
}
},
handler: (app, req, res, next) => {
const server = null
let server = null
for (const [serverId, srv] of app.serverList) {
if (srv.owner === parseInt(req.body.LENUM)) {
server = srv
Expand Down

0 comments on commit e811857

Please sign in to comment.