[Freeciv-Dev] [bug #13419] civscore.log does not record final turn.

2009-04-29 Thread Marko Lindqvist

Update of bug #13419 (project freeciv):

  Status:None = Fixed  
 Assigned to:None = cazfi  
 Open/Closed:Open = Closed 


___

Reply to this item at:

  http://gna.org/bugs/?13419

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #13419] civscore.log does not record final turn.

2009-04-27 Thread Marko Lindqvist

Follow-up Comment #8, bug #13419 (project freeciv):

S2_1 version

(file #5713)
___

Additional Item Attachment:

File name: StartTurnScorelog_13419-S2_1.diff Size:2 KB


___

Reply to this item at:

  http://gna.org/bugs/?13419

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #13419] civscore.log does not record final turn.

2009-04-27 Thread Theodore Munk

Follow-up Comment #9, bug #13419 (project freeciv):

Patch succeeded! Thank you!
I've patched my server with all three logging patches:
https://gna.org/bugs/download.php?file_id=5695
https://gna.org/bugs/download.php?file_id=5677
and the most recent one below. I'll get some players on it and see how it
works, and rework my code when the game has generated a complete set of data.
(:

___

Reply to this item at:

  http://gna.org/bugs/?13419

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #13419] civscore.log does not record final turn.

2009-04-25 Thread Marko Lindqvist

Follow-up Comment #5, bug #13419 (project freeciv):

All things considered, I think attached patch is best solution.

It moves writing to civscore.log to the beginning of the turn, immediately
after score is calculated. Additional write is after game has ended. This
additional write seems like *next* turn after game has ended, just like final
autosave.

This means:
- Both starting and final situation is recorded. Starting situation recording
can be important in scenario games.
- Civscore.log and autosaves should have consistent data as they happen at
the same time

(file #5694)
___

Additional Item Attachment:

File name: StartTurnScorelog_13419.diff   Size:2 KB


___

Reply to this item at:

  http://gna.org/bugs/?13419

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #13419] civscore.log does not record final turn.

2009-04-25 Thread Theodore Munk

Follow-up Comment #6, bug #13419 (project freeciv):

tried to apply patch to 2.1.9 after already applying:
https://gna.org/bugs/download.php?file_id=5677
and 
https://gna.org/bugs/download.php?file_id=5695
in that order.

Result:
m...@thinkcentre:~/freeciv-2.1.9$ patch -p1  ./StartTurnScorelog_13419.diff

patching file server/report.c
Hunk #1 succeeded at 883 (offset -41 lines).
Hunk #2 succeeded at 938 with fuzz 2 (offset -39 lines).
Hunk #3 succeeded at 1071 (offset -39 lines).
patching file server/report.h
patching file server/srv_main.c
Hunk #1 succeeded at 631 (offset -13 lines).
Hunk #2 FAILED at 2072.
1 out of 2 hunks FAILED -- saving rejects to file server/srv_main.c.rej

server/srv_main.c.rej:
***
*** 2071,2076 
  calc_civ_score(pplayer);
} players_iterate_end;
  
report_final_scores();
show_map_to_all();
notify_player(NULL, NULL, E_GAME_END, _(The game is over...));
--- 2072,2079 
  calc_civ_score(pplayer);
} players_iterate_end;
  
+   log_civ_score();
+ 
report_final_scores();
show_map_to_all();
notify_player(NULL, NULL, E_GAME_END, _(The game is over...));


should I unapply the other two?

___

Reply to this item at:

  http://gna.org/bugs/?13419

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #13419] civscore.log does not record final turn.

2009-04-25 Thread Theodore Munk

Follow-up Comment #7, bug #13419 (project freeciv):

addendum: tried to apply just this patch to fresh copy of 2.1.9 source and
got same error.

___

Reply to this item at:

  http://gna.org/bugs/?13419

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #13419] civscore.log does not record final turn.

2009-04-24 Thread Marko Lindqvist

Follow-up Comment #1, bug #13419 (project freeciv):

Problem is that civscore.log contains information from the beginning of the
turn. Game ends in the end of the turn.

Same goes for autosaves, except that there is final, extra, save after game
has ended (See reason in savegame). Actually naming of that final save is
misleading, as it appears like save from one turn *after* game has ended. We
may want to name it as PREFIX_final.sav instead (in another ticket).

Currently AI needs scores calculated at the beginning of the turn, so we
cannot simply move score calculation to the end of turn. I think we should
calculate score twice each turn. In the beginning of the turn for AI and in
the end for logging purposes. Cons are that game starting situation is not
stored to civscore.log at all and savegames and civscore.log would not match
(as savegame contains situation in the beginning of the turn).

___

Reply to this item at:

  http://gna.org/bugs/?13419

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #13419] civscore.log does not record final turn.

2009-04-24 Thread Theodore Munk

Follow-up Comment #4, bug #13419 (project freeciv):

For the purposes of games run on longturn servers and metaservers, however,
it should probably be assumed that all saves are autosaves and happen each
turn, so presumably happen at the same point every turn.

___

Reply to this item at:

  http://gna.org/bugs/?13419

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #13419] civscore.log does not record final turn.

2009-04-23 Thread Theodore Munk

URL:
  http://gna.org/bugs/?13419

 Summary: civscore.log does not record final turn.
 Project: Freeciv
Submitted by: boozerbear
Submitted on: Friday 04/24/2009 at 04:55
Category: general
Severity: 2 - Minor
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any
 Release: 
Operating System: None

___

Details:

quote:
I also noticed that we now calculate the values at the beginning of the
turn, but write them to log only at the end of the turn. We should probably
move log writing to the beginning of the turn too.

I've run a test, and I'm pretty sure that civscore.log does not get written
to on the final game winning turn. This would mean that the ending scores are
not correct in civscore.log if for no other reason than a game won by
spacerace would not have the spaceship score tallied for the winning player.

Is it possible that if civscore.log does not get written to until the end of
a turn, that the final turn does not get recorded because a game win turn
might bypass the logging function?




___

Reply to this item at:

  http://gna.org/bugs/?13419

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev