This instruction based on ags131's and coteyr's instructions and scripts.
For more information visit
there are some additional answers and instructions here.
- Node6 (good Linux instruction at the official page)
- g++ 4.9.2 and above
- build-essential (Ubuntu) or other bulding instruments for your OS
- Steamworks SDK v1.37 (Steam login required)
- Greenworks sources
-
Download Steamworks SDK v1.37 (zip file);
-
Clone Greenworks:
git clone https://github.com/greenheartgames/greenworks.gitand move to its folder:
cd greenworks; -
Follow the Greenworks building instructions very carefully:
The most and only "difficult" step here is provide correct directories tree after Steamworks unzip'ing, it must be like:
greenworks |-- deps | |-- misc | |-- steamworks_sdk # <===== newly unpacked Steamworks SDK | | |-- client | | |-- glmgr | | |-- public | | |-- redistributable_bin | | |-- steamworksexample | | `-- tools | `-- zlib | |-- contrib | `-- google
You can check it by
$ tree -d -L 3insidegreenworks/dir. -
Run npm to build Greenworks:
npm install- as ordinary userOR
npm install --unsafe-perm- as root (to avoid warnings and force building) -
Not sure about
node-gyp configureandnode-gyp rebuildfrom Greenworks building instructions, so I didn't do that; -
Now you can copy
serverdir to the current machine from a machine with Steam and installed Screeps+Server. The location ofserveris smth like:/home/USER/.steam/steam/steamapps/common/Screeps/server/; -
To be sure all modules are valid and rebuilt for the current machine, you can run this script inside
serverdirectory (create a filerebuild.sh, copy-paste this script here and call itbash rebuild.sh):#!/bin/bash # Comment this out if not needed #npm install -g node-gyp for M in modules/*/ do pushd $M # npm install graceful-fs # coteyr? rm node_modules -Rf npm install npm build popd done pushd modules/driver/native/ node-gyp configure node-gyp build popd
-
The last step is replace incorrect Greenworks lib with newly built one, just copy it from Greenwork's
build:cp -f greenworks/build/Release/*.node server/modules/backend/greenworks/lib/
Due to Steam authentification you should set steam_api_key in .screepsrc file, you can get it from here (Steam login required).
Now you can try node modules/launcher/bin/screeps start to start server on the remote machine.
-
Greenworks version mismatch:
Error: Module version mismatch. Expected 48, got XX. at Error (native) at Object.Module._extensions..node (module.js:597:18) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.<anonymous> (/home/screeps/server/modules/backend/greenworks/greenworks.js:22:18) at Module._compile (module.js:570:32) at Object.Module._extensions..js (module.js:579:10)Solution: check out you rebuilt Greenworks and replaced
*.nodelibs correctly -
libsteam_api.so:
Error: /home/screeps/server/modules/driver/native/build/Release/native.node: invalid ELF header ...or
Error: libsteam_api.so: cannot open shared object file: No such file or directory at Error (native) at Object.Module._extensions..node (module.js:568:18) at Module.load (module.js:458:32) at tryModuleLoad (module.js:417:12) at Function.Module._load (module.js:409:3) at Module.require (module.js:468:17) at require (internal/module.js:20:19) at Object.<anonymous> (/home/XXX/screeps/server/modules/backend/greenworks/greenworks.js:22:18) at Module._compile (module.js:541:32) at Object.Module._extensions..js (module.js:550:10)Solution: OS version mismatch: replace Steam libraries with native from Steamworks SDK (see
steamworks_sdk/sdk/redistributable_bin). -
Steamworks SDK version mismatch (while greenworks building):
In file included from ../src/api/steam_api_friends.cc:12:0: ../src/api/steam_api_friends.cc: In function ‘void greenworks::api::{anonymous}::InitFriendRelationship(v8::Handle<v8::Object>)’: ../src/api/steam_api_friends.cc:54:39: error: ‘k_EFriendRelationshipSuggested’ was not declared in this scope SET_TYPE(relationship, "Suggested", k_EFriendRelationshipSuggested); ^ ../src/api/steam_api_registry.h:18:23: note: in definition of macro ‘SET_TYPE’Solution: check your downloaded steamworks_sdk_XXX.zip to be 1.37.
-
"<some Steam lib> not found" errors while greenworks building.
Solution: check greenworks' directory tree (see step #3).