[Freeciv-Dev] [bug #18886] fix loading of shuffle information
Update of bug #18886 (project freeciv): Planned Release: 2.3.1,2.4.0 = 2.3.1, 2.4.0, 2.5.0 ___ Reply to this item at: http://gna.org/bugs/?18886 ___ 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 #18886] fix loading of shuffle information
Follow-up Comment #6, bug #18886 (project freeciv): Here is an explanation for this fix: In freeciv 2.2 and before the number of players was limited. A player could only be added and never be removed. Thus, the player shuffle information was saved as a simple list index = player id. There index is a counter from 0 to the number of players. The remaining numbers up to the limit of 32 there simply automatically filled at the time of loading the game. After player slots there introduced, the logic was not changed. It does work fine as long as no player is _removed_. If one player is removed, the highest player index is equal to the number of players. At the time of loading a savegame, the available numbers fill the shuffle array index 0 to (number of players - 1). The remaining numbers are automatically filled with the remaining indices. As result, one number (= number of players) is used twice. This would print an error and force a reshuffle of the players. Example for 3 players: player shuffle: 0 = player index 1 1 = player index 2 2 = player index 0 (remaining numbers as 3 = 3, 4 = 4 ...) remove player 1 (saved like this in the savegame): 0 = player index 2 1 = player index 0 (remaining numbers as 2 = 2, 3 = 3, 4 = 4 ...) reload (old): 0 = player index 2 1 = player index 0 2 = (automatically set) index 2 3 = (automatically set) index 3 (remaining numbers as 4 = 4, 5 =5 ...) The new algorithm fills the remaining indices with the unused numbers ... I hope I the explanation helps. If not I will try it again. ___ Reply to this item at: http://gna.org/bugs/?18886 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18886] fix loading of shuffle information
Follow-up Comment #7, bug #18886 (project freeciv): Thanks, that's grand. I've boiled it down to a sentence for NEWS-2.3.1 http://freeciv.wikia.com/wiki/NEWS-2.3.1. ___ Reply to this item at: http://gna.org/bugs/?18886 ___ 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 #18886] fix loading of shuffle information
Follow-up Comment #5, bug #18886 (project freeciv): For the sake of release notes, can you briefly explain what was wrong, and what effects users may have seen? The new code is clearly more robust against unusual savefiles, but on a quick look I haven't spotted a problem with loading savefiles in the expected format. (Player slots went in in 2008, RT#40524 http://bugs.freeciv.org/Ticket/Display.html?id=40524, r15284 http://svn.gna.org/viewcvs/freeciv?revision=15284view=revision. But since this change only tweaks savegame2.c, any breakage it fixes can clearly only date back to 2.3.0. Is a similar change needed to savegame.c?) ___ Reply to this item at: http://gna.org/bugs/?18886 ___ 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 #18886] fix loading of shuffle information
Update of bug #18886 (project freeciv): Status: Ready For Test = Fixed Open/Closed:Open = Closed ___ Reply to this item at: http://gna.org/bugs/?18886 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18886] fix loading of shuffle information
URL: http://gna.org/bugs/?18886 Summary: fix loading of shuffle information Project: Freeciv Submitted by: syntron Submitted on: So 30 Okt 2011 15:22:32 CET Category: general Severity: 3 - Normal Priority: 5 - Normal Status: Ready For Test Assigned to: syntron Originator Email: Open/Closed: Open Release: Discussion Lock: Any Operating System: None Planned Release: 2.3.1,2.4.0 ___ Details: - was broken since introduction of player slots(?) /* Loading the shuffle list is quite complex. At the time of saving the * shuffle data is saved as * shuffled_player_number = player_slot_id * where number is n increasing number and player_slot_id is a number * between 0 and the maximum number of player slots. Now we have to create * a list * shuffler_players[number] = player_slot_id * where all player slot IDs are used exactly one time. The code below * handles this ... */ ___ File Attachments: --- Date: So 30 Okt 2011 15:22:32 CET Name: 0035-fix-loading-of-shuffle-information.patch Size: 5kB By: syntron http://gna.org/bugs/download.php?file_id=14320 ___ Reply to this item at: http://gna.org/bugs/?18886 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #18886] fix loading of shuffle information
Follow-up Comment #1, bug #18886 (project freeciv): see also bug #18776 comment #2 ___ Reply to this item at: http://gna.org/bugs/?18886 ___ Nachricht geschickt von/durch Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev