Skip to content

Commit

Permalink
Fix crashes and add note about heap size.
Browse files Browse the repository at this point in the history
  • Loading branch information
antihax committed Jan 20, 2025
1 parent 1ed8571 commit 0ddda2e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 17 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,13 @@ Plugin for ATLAS dedicated server to extract resources, bosses, and other impora
8. using the ServerGridEditor from Grapeshot Games, export the slippymap tiles to the site directory
9. upload or host the site repository on a webserver

If you have a very large configuration you may run out of stack-size. You can increase with such:
`node --max-old-space-size=8096 .\build_json.js`


## Support
Please note I cannot offer support. If you manage to get it to work for you, that is awesome; this was not designed with unofficials clusters in mind.

## Commandline arguments
- `nobuild` - Only process JSON and do not run servers. Useful for debugging.
- `debug` - Print more information
- `manualmanagedmods` - Don't use steamcmd to download mods.
32 changes: 16 additions & 16 deletions build_json.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,9 @@ const worldUnitsY = yGrids * serverConfig.gridSize;

async function runServer(grid, pool, x, y) {
pool.setMaxListeners(250);
let extraArgs = '';
// if (process.argv.includes("manualmanagedmods")) {
extraArgs += ' -manualmanagedmods';
//}

extraArgs += ' -culture=en';

// We are managing the mods now.
let extraArgs = '-manualmanagedmods -culture=en';
let cmd =
'start /min ' + process.cwd() +
`\\server\\ShooterGame\\Binaries\\Win64\\ShooterGameServer.exe Ocean?ServerX=${
Expand Down Expand Up @@ -67,8 +63,6 @@ async function generateAllGridFiles(pool) {
// Run remaining servers in parallel
const tasks = [];

// We don't need to keep downloading mods
process.argv.push('manualmanagedmods');
for (let y = 0; y < yGrids; y++) {
for (let x = 0; x < xGrids; x++) {
// Skip the first server since we already ran it
Expand Down Expand Up @@ -135,6 +129,7 @@ async function main() {
for (let x = 0; x < xGrids; x++) {
for (let y = 0; y < yGrids; y++) {
let grid = helpers.gridName(x, y);
console.log('Building ' + grid);
grids[grid] = helpers.parseJSONFile(resourceDir + grid + '.json');

// save power stones
Expand Down Expand Up @@ -438,27 +433,32 @@ async function main() {
'./json/assettypes.json',
JSON.stringify(sortObjByKey(allassettype), null, '\t'));
fs.writeFileSync(
'./json/stones.json', JSON.stringify(sortObjByKey(stones), null, '\t'));
'./json/stones.json',
JSON.stringify(sortObjByKey(stones || []), null, '\t'));
fs.writeFileSync(
'./json/altars.json', JSON.stringify(sortObjByKey(altars), null, '\t'));
'./json/altars.json',
JSON.stringify(sortObjByKey(altars || []), null, '\t'));
fs.writeFileSync(
'./json/regions.json', JSON.stringify(sortObjByKey(regions), null, '\t'));
'./json/regions.json',
JSON.stringify(sortObjByKey(regions || []), null, '\t'));
fs.writeFileSync(
'./json/bosses.json', JSON.stringify(sortObjByKey(bosses), null, '\t'));
'./json/bosses.json',
JSON.stringify(sortObjByKey(bosses || []), null, '\t'));
fs.writeFileSync(
'./json/islands.json', JSON.stringify(sortObjByKey(islands), null, '\t'));
fs.writeFileSync(
'./json/islandExtended.json',
JSON.stringify(sortObjByKey(islandExtended), null, '\t'));
JSON.stringify(sortObjByKey(islandExtended || []), null, '\t'));
fs.writeFileSync(
'./json/gridList.json',
JSON.stringify(sortObjByKey(gridList), null, '\t'));
JSON.stringify(sortObjByKey(gridList || []), null, '\t'));
fs.writeFileSync(
'./json/shipPaths.json',
JSON.stringify(sortObjByKey(serverConfig.shipPaths), null, '\t'));
JSON.stringify(sortObjByKey(serverConfig.shipPaths || []), null, '\t'));

fs.writeFileSync(
'./json/tradeWinds.json',
JSON.stringify(sortObjByKey(serverConfig.tradeWinds), null, '\t'));
JSON.stringify(sortObjByKey(serverConfig.tradeWinds || []), null, '\t'));
fs.writeFileSync(
'./json/portals.json',
JSON.stringify(sortObjByKey(serverConfig.portalPaths || []), null, '\t'));
Expand Down
3 changes: 3 additions & 0 deletions resourceTypes.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,9 @@
"Iridium": "Metal",
"Iron": "Metal",
"Ironwood": "Wood",
"Toxic Flora": "Special",
"Toxic Sludge": "Special",
"Venom": "Special",
"Jute": "Fiber",
"Kala Namak": "Salt",
"Licorice": "Herb",
Expand Down

0 comments on commit 0ddda2e

Please sign in to comment.