NiHoel / Anno1800Calculator

Calculator for the production and consumption of goods in the computer game Anno 1800
MIT License
102 stars 28 forks source link

Feature Request: Display data from running Anno on different computer #53

Closed kickinJohn closed 3 years ago

kickinJohn commented 3 years ago

Hi,

first of all, great programm, I love it ! :)

I have Calculator 4.1 + Server 5.2 running on the same machine. Having only one monitor, you always have to tab out of the game to check the current status. I'd like to ask for a feature to seperate calculator and server machinewise. Server of course running the same computer as Anno does, calculator display on a laptop for example. I was not sure if this is a feature request of the calculator or the server..

That would be a killer feature :) Thanks !

NiHoel commented 3 years ago

That is actually pretty easy. In line 1969 of AnnoCalculator.js replace localhost by the ip address of your desktop PC.

https://github.com/NiHoel/Anno1800Calculator/blob/79155b673f89cab64849e7ae2ea2d3e417251e55/AnnoCalculator.js#L1969

But there are some things to keep in mind:

  1. You desktop computer must be reachable from the device where you run the calculator (e.g. be in the same network and inter device communication must be enabled by the router)
  2. The port 8000 must be open for incoming traffic (and responses). Check windows defender and / or your antivirus software

Then, you can receive updates on any mobile device. Even on Android or iPhone. The trick there is to open a local website: https://android.stackexchange.com/a/4777

NiHoel commented 3 years ago

Due to the caveats I do not offer a UI to enter the IP address. I fear that I'd then receive a lot of complaints "doesn't work for me".

kickinJohn commented 3 years ago

Thanks for the fast reply! Yes I also played around with the AnnoCalculator.js. Even though inter communication in home network is enabled and firewalls are turned off, accessing http://myip:8000/AnnoServer/Population from a different machine than server gives HTTP 400 invalid hostname. Is the server expecting localhost? Unfortunately I haven't found any clue to this in the https://github.com/NiHoel/Anno1800UXEnhancer/ files.

But nevertheless, as this is Server related and not Client Calculator related anymore I would just close this issue :) Thanks again !

NiHoel commented 3 years ago

I uploaded a new server version here: https://drive.google.com/drive/folders/1Vsy3kXGe11d28pISqR82VpaCGdZaNtyi?usp=sharing

The Readme contains instructions how to access the server from remote devices.

kickinJohn commented 3 years ago

Works like a charm with -h flag to start up the server! Thank you very much :)

FIrgolitsch commented 3 years ago

I'm not sure if I should comment here, but seeing that the version that is on Google Drive differs from the one available at https://github.com/NiHoel/Anno1800UXEnhancer/ isn't the same, I'll try my chances here.

Whenever I try to start the server with the -h flag I get the following message: image

I'm running the cmd prompt as admin, as I was getting errors before when trying it with a non-admin shell. The verbose logging didn't give me any additional info. I did follow the instructions as they were put in the readme included in the download from drive.

EDIT: I got it working by recompiling the source with different hostname. This works for me for now, though a non-hardcoded solution would be preferred.

NiHoel commented 3 years ago

I uploaded a new version with a command line flag. See the README.

I'm impressed that you manage to compile all the dependencies and the server!