Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game Scores not working (in some games) #90

Open
lonemadmax opened this issue Aug 11, 2017 · 3 comments
Open

Game Scores not working (in some games) #90

lonemadmax opened this issue Aug 11, 2017 · 3 comments

Comments

@lonemadmax
Copy link
Contributor

Reported by Civothy in the forum.

The console shows Problem showing score log graph: TypeError: Cannot read property 'turn' of undefined.

Changing start_turn to be the same in handle_scorelog init and turn info handling so that start_turn becomes whatever the first turn it finds in the log and resultdata[tag][] starts at 0 seems to work. If that's right, details.jsp should also be changed.

But then, there's also the problem that the scorelog seems to have only the last turn info, at least in the game reported (longturn 5).

@ghost
Copy link

ghost commented Aug 11, 2017

The game scores system can be improved in many ways. Feel free to try to improve it.

The problem described in this issue, I think is the following:

  • The Freeciv C server which creates the scorelog files which are used to display the game scores in Freeciv-web overwrites the previous scorelog files when the Freeciv server is restarted (for example saving and loading a LongTurn game because of server upgrades). That means that the scores for turns before the restart will be lost on a restart.
    -The JavaScript code in Freeciv-web is not able to read an incomplete scorelog file which does not start on turn 0.
    -The dialog in Freeciv-web which displays player scores does not scale well when there are many hundreds of players.

As a very short-term fix, I will disable the game score dialog for LongTurn games.

@lonemadmax
Copy link
Contributor Author

The C server seems to handle restarts fine, appending to the scorelog file if it exists and passes validations (same id as the game, previous turn, etc). The cause seems to be in publite2/init-freeciv-web.sh, where the scorelog is deleted.

That could be solved for longturn just not deleting in that case and doing it manually whenever a game finishes and the port get reused, but that wouldn't help for the other kind of games that get whatever port is free, and where the user may load a savegame from previous turns.

@lonemadmax
Copy link
Contributor Author

lonemadmax commented Aug 13, 2017

The C server seems to handle restarts fine

Well, it doesn't now due to a long comment in the headers with the new github address (https://www.hostedredmine.com/issues/690381), but it's supposed to work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant