OpenFactorioServerManager / factorio-server-manager

A tool to help manage Factorio multiplayer servers including mods and save games.
MIT License
544 stars 132 forks source link

IIS Build Available? #34

Closed xeroiv closed 8 years ago

xeroiv commented 8 years ago

Is it possible to release a package to setup on a windows server running IIS? Instructions on setting up the dependencies for windows were are clear in the wiki. npm run build gives an error when executed.

C:\factorio-server-manager-0.4.1\ui>npm run build

factorio-mod-manager@0.1.0 build C:\factorio-server-manager-0.4.1\ui
NODE_ENV=production ./node_modules/webpack/bin/webpack.js --progress --profile --colors

NODE_ENV is not recognized as an internal or external command, operable program or batch file.

npm ERR! Windows_NT 6.3.9600
npm ERR! argv C:\\Program Files\\nodejs\\node.exe C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js run build
npm ERR! node v4.4.6
npm ERR! npm  v2.15.5
npm ERR! code ELIFECYCLE
npm ERR! factorio-mod-manager@0.1.0 build: NODE_ENV=production ./node_modules/webpack/bin/webpack.js --progress --profile --colors
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the factorio-mod-manager@0.1.0 build script NODE_ENV=production ./node_modules/webpack/bin/webpack.js --progress --profile --colors.
npm ERR! This is most likely a problem with the factorio-mod-manager package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     NODE_ENV=production ./node_modules/webpack/bin/webpack.js --progress --profile --colors
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs factorio-mod-manager
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR!     npm owner ls factorio-mod-manager
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     C:\factorio-server-manager-0.4.1\ui\npm-debug.log

npm-debug.txt

mroote commented 8 years ago

Hmm I'm not too sure about building the UI on Windows but if you just grab the bundle.js file from the release that will be the already built JS file you need for the UI.

I'm hoping I can test a Windows build this weekend, the application itself runs a webserver so you could just setup IIS to reverse proxy the connection as the docker container does with Nginx.

xeroiv commented 8 years ago

I copied the bundle.js to the directory and it worked for the front end. There appears to be a difference in the file structure for a Linux factorio install vs Windows factorio install. In windows the default directory for install is "c:/program files/factorio". This directory has the bin and data structures but the save file directory / config directory / mod directory are just shortcuts to the roaming profile folder. This leads to a problem when trying to start the factorio-server-manager. It looks for the bin files in the program files directory but it fails to find the save files or mods. I corrected this by manually moving the bin and data structure to the same root directory that the save files are stored in. I was able to use the start server button but the terminal log shows that the server does not start due to an error.

2016/07/01 11:16:11 Starting Factorio server.
2016/07/01 11:16:11 Starting Factorio server with settings: {"savefile":"_autosave1.zip","latency":100,"autosave_interval":5,"autosave_slots":10,"port":34197,"disallow_cmd":false,"peer2peer":false,"auto_pause":false}
2016/07/01 11:16:11 Starting server with command:  C:\Users\Administrator\AppData\Roaming\Factorio\bin\x64\factorio [--start-server _autosave1.zip --latency-ms 100 --autosave-interval 5 --autosave-slots 10 --port 34197]
   0.002 2016-07-01 11:16:11; Factorio 0.13.2 (Build 22949, win64, alpha)
   0.003 Operating system: Windows 8.1
   0.004 Program arguments: "C:\Users\Administrator\AppData\Roaming\Factorio\bin\x64\factorio" "--start-server" "_autosave1.zip" "--latency-ms" "100" "--autosave-interval" "5" "--autosave-slots" "10" "--port" "34197"
   0.006 Read data path: C:/Users/Administrator/AppData/Roaming/Factorio/data
   0.007 Write data path: C:/Users/Administrator/AppData/Roaming/Factorio
   0.008 Binaries path: C:/Users/Administrator/AppData/Roaming/Factorio/bin
   0.071 Running in headless mode
   0.082 Loading mod core 0.0.0 (data.lua)
   0.098 Loading mod base 0.13.2 (data.lua)
   0.376 Checksum for core: 1399339455
   0.377 Checksum for mod base: 234403436
2016/07/01 11:16:12 Factorio server started on port: %!s(int=34197)
2016/07/01 11:16:12 Factorio server started on port: %!s(int=34197)
2016/07/01 11:16:12 Creating server status response
2016/07/01 11:16:12 Server status sent with data: map[status:running port:34197 savefile:_autosave1.zip]
2016/07/01 11:16:12 Creating server status response
2016/07/01 11:16:12 Server status sent with data: map[status:running port:34197 savefile:_autosave1.zip]
   1.678 Custom inputs active: 0
   1.680 Factorio initialised
   1.682 Info Router.cpp:557: Router peerID(65535) shutting down.
   1.683 Info Router.cpp:588: Router state -> Disconnected
   1.751 Info MultiplayerManager.cpp:996: networkTick(0) mapTick(-1) changing state from(Ready) to(PreparedToHostGame)
   1.753 Info MultiplayerManager.cpp:996: networkTick(0) mapTick(-1) changing state from(PreparedToHostGame) to(CreatingGame)
   1.755 Loading map C:\factorio-server-manager-0.4.1\_autosave1.zip
   1.778 Error MultiplayerManager.cpp:129: MultiplayerManager failed: "Opening zip C:/factorio-server-manager-0.4.1/_autosave1.zip failed: No such file or directory"
   1.780 Info MultiplayerManager.cpp:996: networkTick(0) mapTick(-1) changing state from(CreatingGame) to(InitializationFailed)
   1.782 Error Main.cpp:455: Couldn't load the game for MP: Opening zip C:/factorio-server-manager-0.4.1/_autosave1.zip failed: No such file or directory

It appears that the 0.13.2 factorio start-server command bug still exists in the way that you need to pass the entire save file path as an argument otherwise the server start script looks in the active directory of the terminal. So despite the factorio server failing to start the web-interface of factorio-server-manager shows the status as started. Clicking the stop-server button produces an invalid argument error.

2016/07/01 11:32:20 Error sending SIGINT to Factorio process: invalid argument
2016/07/01 11:32:20 Error in stop server handler: invalid argument
2016/07/01 11:32:20 Creating server status response
2016/07/01 11:32:20 Server status sent with data: map[savefile:_autosave1.zip status:running port:34197]
2016/07/01 11:32:20 Creating server status response
2016/07/01 11:32:20 Server status sent with data: map[status:running port:34197 savefile:_autosave1.zip]
mroote commented 8 years ago

Fixed in https://github.com/MajorMJR/factorio-server-manager/pull/35

Thanks @xeroiv

xeroiv commented 8 years ago

#35 only fixes the savefile startup issue. It does not address the default windows factorio installation directory structure difference from the linux headless version. The windows factorio install has different root folders for the binaries vs the savefile/configuration/mod directory.