Re: [Freeciv-Dev] (PR#39627) [Bug] assert fail when taking player
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39627 2007/8/30 Marko Lindqvist cazf...@gmail.com: On 30/08/2007, Pepeto _ pepet...@hotmail.fr wrote: On 29/08/07, Michael Kaufman kauf...@physics.wisc.edu wrote: The last time I checked, not doing a client reset on player switch caused bad things to happen, but I can't be more specific than that. there should be a game_free() game_init() Problem with game_free() + game_init() are is-info packets. Delta code needs changes so that we can force sending those packets again. Delta code is already updated. Attached patch makes game_free() + game_init() reset at client side and server side is forced to send tile info packets after that. Even though protocol doesn't change, new client will fail to work with old server (as it makes the reset, but server will not serve tile infos again) so I bumped capability string. - ML diff -Nurd -X.diff_ignore freeciv/client/packhand.c freeciv/client/packhand.c --- freeciv/client/packhand.c 2009-05-03 18:59:38.0 +0300 +++ freeciv/client/packhand.c 2009-05-04 14:52:00.0 +0300 @@ -2492,9 +2492,9 @@ * the nation selection dialog if it is open. */ popdown_races_dialog(); - ruleset_data_free(); - + game_free(); ruleset_cache_init(); + game_init(); game.control = *packet; diff -Nurd -X.diff_ignore freeciv/common/effects.c freeciv/common/effects.c --- freeciv/common/effects.c 2009-04-29 20:40:43.0 +0300 +++ freeciv/common/effects.c 2009-05-04 14:52:36.0 +0300 @@ -338,7 +338,7 @@ } /** - Initialize the ruleset cache. The ruleset cache should be emtpy + Initialize the ruleset cache. The ruleset cache should be empty before this is done (so if it's previously been initialized, it needs to be freed (see ruleset_cache_free) before it can be reused). **/ diff -Nurd -X.diff_ignore freeciv/server/citytools.c freeciv/server/citytools.c --- freeciv/server/citytools.c 2009-03-19 18:05:44.0 +0200 +++ freeciv/server/citytools.c 2009-05-04 14:36:41.0 +0300 @@ -2126,7 +2126,7 @@ int city_x, int city_y) { tile_set_worked(ptile, NULL); - send_tile_info(NULL, ptile, FALSE); + send_tile_info(NULL, ptile, FALSE, FALSE); pcity-city_map[city_x][city_y] = C_TILE_EMPTY; pcity-server.synced = FALSE; } @@ -2140,7 +2140,7 @@ int city_x, int city_y) { tile_set_worked(ptile, pcity); - send_tile_info(NULL, ptile, FALSE); + send_tile_info(NULL, ptile, FALSE, FALSE); pcity-city_map[city_x][city_y] = C_TILE_WORKER; pcity-server.synced = FALSE; } @@ -2158,7 +2158,7 @@ !is_free_worked(pwork, ptile) !city_can_work_tile(pwork, ptile)) { tile_set_worked(ptile, NULL); -send_tile_info(NULL, ptile, FALSE); +send_tile_info(NULL, ptile, FALSE, FALSE); pwork-specialists[DEFAULT_SPECIALIST]++; /* keep city sanity */ pwork-server.synced = FALSE; diff -Nurd -X.diff_ignore freeciv/server/connecthand.c freeciv/server/connecthand.c --- freeciv/server/connecthand.c 2008-12-15 21:55:50.0 +0200 +++ freeciv/server/connecthand.c 2009-05-04 14:37:20.0 +0300 @@ -120,7 +120,7 @@ /* Player and other info is only updated when the game is running. * See the comment in lost_connection_to_client(). */ send_packet_freeze_hint(pconn); - send_all_info(dest); + send_all_info(dest, TRUE); send_diplomatic_meetings(pconn); send_packet_thaw_hint(pconn); dsend_packet_start_phase(pconn, game.info.phase); diff -Nurd -X.diff_ignore freeciv/server/edithand.c freeciv/server/edithand.c --- freeciv/server/edithand.c 2009-01-27 12:17:08.0 +0200 +++ freeciv/server/edithand.c 2009-05-04 14:38:31.0 +0300 @@ -104,7 +104,7 @@ hash_delete_all_entries(unfixed_tile_table); assign_continent_numbers(); - send_all_known_tiles(NULL); + send_all_known_tiles(NULL, FALSE); } / @@ -377,7 +377,7 @@ /* Send the new state to all affected. */ if (changed) { update_tile_knowledge(ptile); -send_tile_info(NULL, ptile, FALSE); +send_tile_info(NULL, ptile, FALSE, FALSE); } } @@ -1132,7 +1132,7 @@ map_clear_known(ptile, pplayer); } -send_tile_info(NULL, ptile, TRUE); +send_tile_info(NULL, ptile, TRUE, FALSE); } square_iterate_end; conn_list_do_unbuffer(game.est_connections); } @@ -1230,7 +1230,7 @@ map_set_startpos(ptile, pnation); if (old != pnation) { -send_tile_info(NULL, ptile, FALSE); +send_tile_info(NULL, ptile, FALSE, FALSE); } } diff -Nurd -X.diff_ignore freeciv/server/maphand.c freeciv/server/maphand.c --- freeciv/server/maphand.c 2009-03-08 13:54:37.0 +0200 +++ freeciv/server/maphand.c 2009-05-04 14:44:49.0 +0300 @@ -294,7 +294,7 @@
Re: [Freeciv-Dev] (PR#2581) Patch: layered combat
As currently implemented, this patch is huge step backwards in relation to gen-movement. It even restores some functions we have worked so hard to get rid of. It assumes a lot of unit class related things to always be like they are in default ruleset (checking is_ground_unit() co instead of actual unit class properties). My stealthy super spies are considered submarines :-) I've not spent time on detailed analysis if, and how, these issues can be corrected. It seems obvious starting point that layer unit belongs to is part of unit class definition. Good thing is that this is implemented as ruleset option. If above issues can be solved, I'm all for taking this option to game. - ML ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #13476] [Patch] MinYear requirement
URL: http://gna.org/bugs/?13476 Summary: [Patch] MinYear requirement Project: Freeciv Submitted by: cazfi Submitted on: Monday 05/04/2009 at 19:17 Category: None Severity: 3 - Normal Priority: 1 - Later Status: None Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Release: Operating System: None ___ Details: This patch adds MinYear requirement type. Related code extracted from engla's patch effects_timeline_effect_req_v3.diff in RT ticket #39413, updated against svn and modified a bit. ___ File Attachments: --- Date: Monday 05/04/2009 at 19:17 Name: MinYear.diff Size: 6kB By: cazfi http://gna.org/bugs/download.php?file_id=5742 ___ Reply to this item at: http://gna.org/bugs/?13476 ___ 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] (PR#20855) Starting techs and team play
URL: http://bugs.freeciv.org/Ticket/Display.html?id=20855 [cazf...@gmail.com - Mon May 04 12:31:15 2009]: 2007/10/18 Pepeto _ pepet...@hotmail.fr: My previous patches are wrong. It seems that global_init_tech, init_tech and techlevel never worked well with team games, since the team research is polled. I have only read the patch, not tested. - Why are you removing check if game is new from around game.info.max_players reset? Either it should not be removed, or comment should be updated I have no idea why. It looks to me now a mistake, but maybe I had one idea 2 years ago. - I'm not sure about making init_techs to count toward (free) techlevel. Techlevel is documented to be random techs, so it probably should apply on top of init_techs. At least leave it to another ticket, so this one can go forward now It's a rule question. I have no idea what is better. I used my brain to imagine the different ways, and takes the one which looks to me the best (2 years ago). Please, if you want to ask me some questions, send me an e-mail since I don't always look the mailing list. Pepeto. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] [bug #13477] [Patch] Fix wrong windows executable name is ./civ
URL: http://gna.org/bugs/?13477 Summary: [Patch] Fix wrong windows executable name is ./civ Project: Freeciv Submitted by: cazfi Submitted on: Monday 05/04/2009 at 23:12 Category: None Severity: 3 - Normal Priority: 1 - Later Status: None Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Release: Operating System: None ___ Details: Search for client uses wrong executable names if there is EXEEXT (freeciv.exe-gtk2 instead of freeciv-gtk2.exe). Fix attached ___ File Attachments: --- Date: Monday 05/04/2009 at 23:12 Name: CivScriptEXEEXTFix.diff Size: 572B By: cazfi http://gna.org/bugs/download.php?file_id=5743 ___ Reply to this item at: http://gna.org/bugs/?13477 ___ 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 #13477] [Patch] Fix wrong windows executable name is ./civ
Update of bug #13477 (project freeciv): Priority: 1 - Later = 9 - Immediate Status:None = Fixed Assigned to:None = cazfi Open/Closed:Open = Closed ___ Reply to this item at: http://gna.org/bugs/?13477 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39530) Wonders don't allow units
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39530 2007/8/11 ba...@actrix.co.nz ba...@actrix.co.nz: Hi With rndCiv i use Wonders to define special races, ie if you build The Elves wonder you can build Elvish units. I found that this didn't work, so i made building The Elves allowed you to build Elveshome in your cities which allowed you to build Elvish units. Only now I understood this bug report; how badly broken that part of code is. This far I assumed you referred to wonders at different range, but actually even local wonders cannot enable unit building. So they do *worse* than normal buildings. Untested fix attached - ML diff -Nurd -X.diff_ignore freeciv/common/improvement.c freeciv/common/improvement.c --- freeciv/common/improvement.c 2008-10-27 04:13:30.0 +0200 +++ freeciv/common/improvement.c 2009-05-05 01:23:15.0 +0300 @@ -532,6 +532,20 @@ } /** + Get the player owning this small wonder. +**/ +struct player *great_wonder_owner(const struct impr_type *pimprove) +{ + struct city *pcity = find_city_from_great_wonder(pimprove); + + if (!pcity) { +return NULL; + } + + return city_owner(pcity); +} + +/** Get the player city with this small wonder. **/ struct city *find_city_from_small_wonder(const struct player *pplayer, diff -Nurd -X.diff_ignore freeciv/common/improvement.h freeciv/common/improvement.h --- freeciv/common/improvement.h 2008-10-27 04:13:30.0 +0200 +++ freeciv/common/improvement.h 2009-05-05 01:24:30.0 +0300 @@ -116,6 +116,7 @@ struct city *find_city_from_great_wonder(const struct impr_type *pimprove); struct city *find_city_from_small_wonder(const struct player *pplayer, const struct impr_type *pimprove); +struct player *great_wonder_owner(const struct impr_type *pimprove); /* player related improvement functions */ bool improvement_obsolete(const struct player *pplayer, diff -Nurd -X.diff_ignore freeciv/common/unittype.c freeciv/common/unittype.c --- freeciv/common/unittype.c 2008-10-27 04:13:30.0 +0200 +++ freeciv/common/unittype.c 2009-05-05 01:24:02.0 +0300 @@ -697,9 +697,21 @@ /* If the unit has a building requirement, we check to see if the player * can build that building. Note that individual cities may not have * that building, so they still may not be able to build the unit. */ - if (punittype-need_improvement - !can_player_build_improvement_direct(p, punittype-need_improvement)) { -return FALSE; + if (punittype-need_improvement) { +if (is_great_wonder(punittype-need_improvement) +great_wonder_was_built(punittype-need_improvement)) { + /* It's already built great wonder */ + if (great_wonder_owner(punittype-need_improvement) != p) { +/* Not owned by this player. Either destroyed or owned by somebody + * else. */ +return FALSE; + } +} else { + if (!can_player_build_improvement_direct(p, + punittype-need_improvement)) { +return FALSE; + } +} } return TRUE; diff -Nurd -X.diff_ignore freeciv/common/improvement.c freeciv/common/improvement.c --- freeciv/common/improvement.c 2008-07-09 10:44:51.0 +0300 +++ freeciv/common/improvement.c 2009-05-05 01:31:31.0 +0300 @@ -473,6 +473,20 @@ } /** + Get the player owning this small wonder. +**/ +struct player *great_wonder_owner(Impr_type_id id) +{ + struct city *pcity = find_city_from_great_wonder(id); + + if (!pcity) { +return NULL; + } + + return city_owner(pcity); +} + +/** Get the player city with this small wonder. **/ struct city *find_city_from_small_wonder(const struct player *pplayer, diff -Nurd -X.diff_ignore freeciv/common/improvement.h freeciv/common/improvement.h --- freeciv/common/improvement.h 2008-07-09 10:44:51.0 +0300 +++ freeciv/common/improvement.h 2009-05-05 01:30:48.0 +0300 @@ -132,6 +132,7 @@ struct city *find_city_from_great_wonder(Impr_type_id id); struct city *find_city_from_small_wonder(const struct player *pplayer, Impr_type_id id); +struct player *great_wonder_owner(Impr_type_id id); bool great_wonder_was_built(Impr_type_id id); diff -Nurd -X.diff_ignore freeciv/common/unittype.c freeciv/common/unittype.c --- freeciv/common/unittype.c 2007-07-04 14:04:25.0 +0300 +++ freeciv/common/unittype.c 2009-05-05 01:34:53.0
[Freeciv-Dev] [bug #13479] [Patch] Amplio cleanup
URL: http://gna.org/bugs/?13479 Summary: [Patch] Amplio cleanup Project: Freeciv Submitted by: cazfi Submitted on: Tuesday 05/05/2009 at 03:09 Category: art Severity: 3 - Normal Priority: 1 - Later Status: None Assigned to: None Originator Email: Open/Closed: Open Discussion Lock: Any Release: Operating System: None ___ Details: This patch removes references to various now removed ocean types from amplio specfiles. ___ File Attachments: --- Date: Tuesday 05/05/2009 at 03:09 Name: AmplioCleanup.diff Size: 9kB By: cazfi http://gna.org/bugs/download.php?file_id=5744 ___ Reply to this item at: http://gna.org/bugs/?13479 ___ 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 #13433] [Patch] Improved command/access levels
Update of bug #13433 (project freeciv): Status: Ready For Test = Confirmed Open/Closed:Open = Closed ___ Reply to this item at: http://gna.org/bugs/?13433 ___ Message sent via/by Gna! http://gna.org/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev