[Freeciv-Dev] (PR#15854) goto.c:860: Assertion `unit_is_in_focus(punit)' failed
http://bugs.freeciv.org/Ticket/Display.html?id=15854 > > [wsimpson - Jeu. Aoû. 23 14:54:13 2007]: > > The described test works in current code, presumably due to recent > PR#18010 revisions. > > > It doesn't work. I got it yesterday. But now, I know exactly how reproduce the crash. It occurs when the server wake up an unit (which was sentried) whereas you are selecting a destination for an other unit. This makes Freeciv totally unplayable for multi-player games. The client crashes every time a enemy unit moves. I didn't have time to try to find a patch for it yet. I think that goto should canceled when you set a new unit in focus. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39501) [Patch] SIGABRT handler
http://bugs.freeciv.org/Ticket/Display.html?id=39501 > On 07/08/07, Marko Lindqvist <[EMAIL PROTECTED]> wrote: > > This adds SIGABRT handler to server. ... > displays BUG_URL after assert. This version avoids infinite loop if freelog() is asserting. - ML diff -Nurd -X.diff_ignore freeciv/server/civserver.c freeciv/server/civserver.c --- freeciv/server/civserver.c 2007-08-04 18:36:24.0 +0300 +++ freeciv/server/civserver.c 2007-09-05 05:45:19.0 +0300 @@ -85,7 +85,27 @@ } timer = renew_timer_start(timer, TIMER_USER, TIMER_ACTIVE); } -#endif + +/** + This function is called when a SIGABRT is received. +**/ +static void sigabrt_handler(int sig) +{ + static bool aborted_already = FALSE; + + if (!aborted_already) { +/* This is the original abort. Make sure that this code is not + * executed again if it itself aborts. */ +aborted_already = TRUE; + +freelog(LOG_ERROR, _("Freeciv server aborts! " + "Please report this at %s. Thank you."), BUG_URL); + } + + exit(2); +} + +#endif /* USE_INTERRUPT_HANDLERS */ /** Entry point for Freeciv server. Basically, does two things: @@ -112,6 +132,7 @@ #ifdef USE_INTERRUPT_HANDLERS signal(SIGINT, sigint_handler); + signal(SIGABRT, sigabrt_handler); #endif /* initialize server */ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] freeciv maps repository
On 9/2/07, Mathieu Roy <[EMAIL PROTECTED]> wrote: > Hello, > > Some time ago, I wrote a map of France for freeciv and made a modified map of > Europe. > I posted a bug/request on your tracker but got no news since them. > > I don't know if these are worthy to be included into Freeciv. However, I think > they could be improved and I definitely do not want them to go to limbo due > to a hard disk change at home or whatever. > > So I created a repository for freeciv maps at Gna! where anybody that made a > map is welcome to add it, by joining the project. > > I would be glad if someone involved in the Freeciv project would join this > project as admin, so it does not fully rely on me. > > The project is at http://gna.org/p/freeciv-maps > > There are currently two maps in the SVN. > > -- > Mathieu Roy > > I am sorry your map was overlooked. Did an RT search and found it at PR#21244 . ~Daniel ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#36872) GLBTQ nation proposal
http://bugs.freeciv.org/Ticket/Display.html?id=36872 > > [EMAIL PROTECTED] - Fri Aug 31 12:54:02 2007]: > > Hello! > > What do you think of these names as city names? > http://en.wikipedia.org/wiki/List_of_gay_villages > > Thanks, Daniil. > Hm, are these really noteworthy (I don't know.) Also, what order should they be in? What does 'gay village' mean anyway? ;) ~Daniel ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39642) en_US.po
http://bugs.freeciv.org/Ticket/Display.html?id=39642 > On 9/5/07, Egor Vyscrebentsov <[EMAIL PROTECTED]> wrote: > > http://bugs.freeciv.org/Ticket/Display.html?id=39642 > > > On Mon, 3 Sep 2007 06:30:59 -0700 Egor Vyscrebentsov wrote: > > > One moment/problem: original string is shown if untranslated for _any_ > > translation... > > > > [JT] > > Rather than moratoring changing, it is better (IMHO) to > > create good mechanism to tell a translator what was changed (in i18n/l10n) > > between two versions (or, even better, since last .po modify date.) > > [/JT] > > Still think so. > > > I'm not against en_US.po, but I don't see much perspective... > > OK, I take back last sentence. Right now I see that en_US may help in > translations like for the req_source_type_names (where text in code and > text, displayed to user, may [not necessary should] differ.) > > -- > Thanks, evyscr > Any misinformation or fatal mistakes that could affect the accuracy of the localizations should naturally be corrected in source on stable branches too. en_US would only cover typos that don't affect the meaning of a string. Or at least that's how I interpret it. ~Daniel ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39642) en_US.po
http://bugs.freeciv.org/Ticket/Display.html?id=39642 > On Mon, 3 Sep 2007 06:30:59 -0700 Egor Vyscrebentsov wrote: > One moment/problem: original string is shown if untranslated for _any_ > translation... > > [JT] > Rather than moratoring changing, it is better (IMHO) to > create good mechanism to tell a translator what was changed (in i18n/l10n) > between two versions (or, even better, since last .po modify date.) > [/JT] Still think so. > I'm not against en_US.po, but I don't see much perspective... OK, I take back last sentence. Right now I see that en_US may help in translations like for the req_source_type_names (where text in code and text, displayed to user, may [not necessary should] differ.) -- Thanks, evyscr ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39667) SDL Client Usability Issues
http://bugs.freeciv.org/Ticket/Display.html?id=39667 > > [EMAIL PROTECTED] - Di 04. Sep 2007, 13:09:46]: > > Freeciv dialogs have a red X with the tooltip "Cancel" to close them. > Not only is 'cancel' a horrible word - implies losing any changes but > it simply leaves the dialog - it is also innaccurate. "Close Dialog" > is better. A better icon may be the circular arrow commonly used to > represent returning to a previous screen. > The attached patch changes the tooltip to "Close Dialog (Esc)" and also adds it to dialogs that didn't have it before. And it moves the close button from the bottom right corner into the title bar in the city dialog and the cities report dialog. Index: client/gui-sdl/citydlg.c === --- client/gui-sdl/citydlg.c (revision 13502) +++ client/gui-sdl/citydlg.c (working copy) @@ -3682,31 +3682,18 @@ /* = */ -#if 0 - /* in title bar */ - pBuf = create_themeicon(pTheme->CANCEL_Icon, pWindow->dst->surface, + /* close dialog button */ + pBuf = create_themeicon(pTheme->Small_CANCEL_Icon, pWindow->dst, (WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND)); - pBuf->string16 = create_str16_from_char(_("Cancel"), adj_font(12)); + pBuf->string16 = create_str16_from_char(_("Close Dialog (Esc)"), adj_font(12)); pBuf->action = exit_city_dlg_callback; pBuf->size.x = area.x + area.w - pBuf->size.w; pBuf->size.y = pWindow->size.y + 1; pBuf->key = SDLK_ESCAPE; set_wstate(pBuf, FC_WS_NORMAL); add_to_gui_list(ID_CITY_DLG_EXIT_BUTTON, pBuf); -#endif - /* Buttons */ - pBuf = create_themeicon(pTheme->CANCEL_Icon, pWindow->dst, - (WF_WIDGET_HAS_INFO_LABEL | - WF_RESTORE_BACKGROUND)); - pBuf->string16 = create_str16_from_char(_("Cancel"), adj_font(12)); - pBuf->action = exit_city_dlg_callback; - pBuf->key = SDLK_ESCAPE; - pBuf->size.x = area.x + area.w - pBuf->size.w - adj_size(7); - pBuf->size.y = area.y + area.h - pBuf->size.h - adj_size(5); - set_wstate(pBuf, FC_WS_NORMAL); - add_to_gui_list(ID_CITY_DLG_EXIT_BUTTON, pBuf); /* */ pBuf = create_themeicon(pTheme->Support_Icon, pWindow->dst, Index: client/gui-sdl/cityrep.c === --- client/gui-sdl/cityrep.c (revision 13502) +++ client/gui-sdl/cityrep.c (working copy) @@ -175,6 +175,7 @@ copy_chars_to_string16(pStr, cBuf); pStr->fgcol = *get_game_colorRGB(COLOR_THEME_CITYREP_TEXT); pText4 = create_text_surf_from_str16(pStr); + prod_w = pText4->w; FREESTRING16(pStr); pUnits_Icon = create_icon_from_theme(pTheme->UNITS_Icon, 0); @@ -195,16 +196,17 @@ /* - */ /* exit button */ - pBuf = create_themeicon(pTheme->CANCEL_Icon, pWindow->dst, - (WF_WIDGET_HAS_INFO_LABEL | - WF_RESTORE_BACKGROUND)); - - pBuf->string16 = create_str16_from_char(_("Exit Report"), adj_font(12)); + pBuf = create_themeicon(pTheme->Small_CANCEL_Icon, pWindow->dst, + (WF_WIDGET_HAS_INFO_LABEL | WF_RESTORE_BACKGROUND)); + pBuf->string16 = create_str16_from_char(_("Close Dialog"), adj_font(12)); pBuf->action = exit_city_report_callback; set_wstate(pBuf, FC_WS_NORMAL); pBuf->key = SDLK_ESCAPE; add_to_gui_list(ID_BUTTON, pBuf); + +/* FIXME: not implemented yet */ +#if 0 /* - */ pBuf = create_themeicon(pTheme->INFO_Icon, pWindow->dst, (WF_WIDGET_HAS_INFO_LABEL | @@ -250,7 +252,8 @@ */ add_to_gui_list(ID_BUTTON, pBuf); /* */ - +#endif + pLast = pBuf; count = 0; city_list_iterate(game.player_ptr->cities, pCity) { @@ -607,13 +610,15 @@ /* exit button */ pBuf = pWindow->prev; - pBuf->size.x = area.x + area.w - pBuf->size.w - adj_size(25); - pBuf->size.y = area.y + area.h - pBuf->size.h - adj_size(5); + pBuf->size.x = area.x + area.w - pBuf->size.w - 1; + pBuf->size.y = pWindow->size.y + 1; +/* FIXME: not implemented yet */ +#if 0 /* info button */ pBuf = pBuf->prev; - pBuf->size.x = pBuf->next->size.x - adj_size(5) - pBuf->size.w; - pBuf->size.y = pBuf->next->size.y; + pBuf->size.x = area.x + area.w - pBuf->size.w - adj_size(5); + pBuf->size.y = area.y + area.h - pBuf->size.h - adj_size(5); /* happy button */ pBuf = pBuf->prev; @@ -629,6 +634,7 @@ pBuf = pBuf->prev; pBuf->size.x = pBuf->next->size.x - adj_size(5) - pBuf->size.w; pBuf->size.y = pBuf->next->size.y; +#endif /* cities background and labels */ dst.x = area.x + adj_size(2); Index: client/gui-sdl/cma_fe.c === --- client/gui-sdl/cma_fe.c (revision 13502) +++ client/gui-sdl/cma_fe.c (working copy) @@ -463,7 +463,8 @@ /* -- */ /* create exit button */ pBuf = create_themeicon(pTheme->Small_CANCEL_Icon, pWindow->dst, - WF_RESTORE_BACKGROUND); + WF_WIDG
Re: [Freeciv-Dev] (PR#39661) [Patch] Suppress lua compiler warning
http://bugs.freeciv.org/Ticket/Display.html?id=39661 > On 03/09/07, Marko Lindqvist wrote: > > Attached patch adds compiler option to ignore those warnings when > compiling lua library (and only then) So now we have this patch suppressing warning, and Egor's patch fixing the problem, but with some theoretical problems. This patch has lot of usable material fixing configure.ac problems, and those should be committed in any case. But what do we do with that warning? - ML ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39669) [Patch] Some events cleanup
http://bugs.freeciv.org/Ticket/Display.html?id=39669 > - Updated comments - Updated list of event sound tags in stdsound.soundspec - Corrected some variable types from int to enum event_type - Trunk only: Marked format used in description building for translation - Trunk only: Function used in outputting soundspec entries added, but commented out - ML diff -Nurd -X.diff_ignore freeciv/common/events.c freeciv/common/events.c --- freeciv/common/events.c 2007-08-04 18:38:32.0 +0300 +++ freeciv/common/events.c 2007-09-04 21:52:32.0 +0300 @@ -153,8 +153,22 @@ */ static int event_to_index[E_LAST]; -int sorted_events[E_LAST]; +enum event_type sorted_events[E_LAST]; + +/** + This inserts empty soundspec entries to buffer. +**/ +#if 0 +static void output_soundspec_events(char *buf, size_t bufsz) +{ + enum event_type et; + for (et = 0; et < E_LAST; et++) { +cat_snprintf(buf, bufsz, ";%s = \"\"\n", + events[event_to_index[sorted_events[et]]].tag_name); + } +} +#endif /** Returns the translated description of the given event. @@ -166,8 +180,10 @@ if (events[event_to_index[event]].event == event) { return events[event_to_index[event]].full_descr; } + freelog(LOG_ERROR, "unknown event %d", event); - return "UNKNOWN EVENT"; + return "UNKNOWN EVENT"; /* FIXME: Should be marked for translation? + * we get non-translated in log message. */ } /** @@ -176,8 +192,8 @@ **/ static int compar_event_message_texts(const void *i1, const void *i2) { - const int *j1 = i1; - const int *j2 = i2; + const enum event_type *j1 = i1; + const enum event_type *j2 = i2; return mystrcasecmp(get_event_message_text(*j1), get_event_message_text(*j2)); @@ -254,10 +270,14 @@ int j; if (events[i].section_orig) { + /* TRANS: Most event descriptions come in two parts "Civ: Transfer" + *This format is their glue. */ + const char *event_format = Q_("?eventdescr:%s: %s"); + events[i].full_descr = fc_malloc(strlen(_(events[i].descr_orig)) + strlen(_(events[i].section_orig)) - + strlen(": ") + 1); - sprintf(events[i].full_descr, "%s: %s", + + strlen(event_format) + 1); + sprintf(events[i].full_descr, event_format, _(events[i].section_orig), _(events[i].descr_orig)); } else { diff -Nurd -X.diff_ignore freeciv/common/events.h freeciv/common/events.h --- freeciv/common/events.h 2007-08-05 16:40:58.0 +0300 +++ freeciv/common/events.h 2007-09-04 21:33:26.0 +0300 @@ -17,7 +17,10 @@ /* Add new event types to the end. Client saves message settings by * type number and installing new event type in between would cause - * erronous loading of existing .civclientrc */ + * erronous loading of existing .civclientrc + * When adding events to stable branch, there is risk that TRUNK + * already has allocated next slot for something else (and has + * new event in upper slot) */ enum event_type { E_CITY_CANTBUILD, E_CITY_LOST, @@ -124,13 +127,13 @@ /* * Note: If you add a new event, make sure you make a similar change * to the events array in common/events.c using GEN_EV and to - * data/stdsounds.spec. + * data/stdsounds.soundspec. */ E_LAST }; -extern int sorted_events[]; /* [E_LAST], sorted by the - translated message text */ +extern enum event_type sorted_events[]; /* [E_LAST], sorted by the + * translated message text */ const char *get_event_message_text(enum event_type event); const char *get_event_sound_tag(enum event_type event); @@ -158,4 +161,3 @@ } #endif /* FC__EVENTS_H */ - diff -Nurd -X.diff_ignore freeciv/data/stdsounds.soundspec freeciv/data/stdsounds.soundspec --- freeciv/data/stdsounds.soundspec 2007-08-04 18:37:57.0 +0300 +++ freeciv/data/stdsounds.soundspec 2007-09-04 21:49:47.0 +0300 @@ -191,73 +191,114 @@ ;w_united_nations = "" ;w_womens_suffrage = "" -;e_anarchy = "" + +; This list contains all events up to E_TECH_GOAL +; (as numbered in common/events.h), in the sorted order. +; Alphabetical sorting is based on event descriptions, +; not to these tag names. These have been sorted using +; Freeciv internal language (en_US) + +;e_ai_debug = "" ;e_broadcast_report = "" -;e_cancel_pact = "" -;e_city_aq_building = "" -;e_city_aqueduct = "" -;e_city_build = "" +;e_caravan_action = "" +;e_chat_error = "" +;e_chat_msg = "" ;e_city_cantbuild = "" -;e_city_cma_release = ""
Re: [Freeciv-Dev] RT problems?
Christian Prochaska wrote: > On 9/4/07, John Keller <[EMAIL PROTECTED]> wrote: >> The weird thing is that I added a comment yesterday to PR#39662 ("Build >> cost always shown as '1' for current production"). >> >> It still hasn't shown up on the list, but I've been seeing other >> people's comments just fine... Or is this some RT behavior? >> >> - John >> > > "Comments" in RT generally don't show up at the list. You need to > select "Response to requestors" for "Update type". Thanks for the explanation. Hmm, I only have "Comments (Not sent to requestors)" in the update type pulldown (my account email address is the same as the one I'm sending this email from). Maybe I have limited access? That would explain why I couldn't add a "refers to" entry... - John ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39667) SDL Client Usability Issues
http://bugs.freeciv.org/Ticket/Display.html?id=39667 > > [EMAIL PROTECTED] - Di 04. Sep 2007, 13:09:46]: > > If you run it in windowed mode, you can't resize the game by resizing > the window. The game display logic should be independent of the > resolution, an absraction that many games fail to make. > I believe the SDL client was targeted at fullscreen mode in the first place (inspired by Civ3) with windowed mode only as an optional feature. Changing the code to support on-the-fly resizing seems almost impossible to me now. If I had the time I would port the SDL GUI to GTK+ and make use of its automatic layout management, but for now I can only mark the window as unresizable to at least avoid the black areas when attemting to resize the window frame. Patch attached. Index: client/gui-sdl/gui_main.c === --- client/gui-sdl/gui_main.c (revision 13502) +++ client/gui-sdl/gui_main.c (working copy) @@ -800,7 +800,7 @@ #endif if(pBgd && SDL_GetVideoInfo()->wm_available) { -set_video_mode(pBgd->w, pBgd->h, SDL_SWSURFACE | SDL_ANYFORMAT | SDL_RESIZABLE); +set_video_mode(pBgd->w, pBgd->h, SDL_SWSURFACE | SDL_ANYFORMAT); #if 0 /* * call this for other that X enviroments - currently not supported. @@ -954,7 +954,7 @@ #else /* small screen on desktop -> don't set 320x240 fullscreen mode */ set_video_mode(gui_sdl_screen_width, gui_sdl_screen_height, - SDL_SWSURFACE | SDL_ANYFORMAT | SDL_RESIZABLE); + SDL_SWSURFACE | SDL_ANYFORMAT); #endif #else set_video_mode(gui_sdl_screen_width, gui_sdl_screen_height, @@ -969,11 +969,11 @@ SDL_SWSURFACE | SDL_ANYFORMAT); #else set_video_mode(gui_sdl_screen_width, gui_sdl_screen_height, - SDL_SWSURFACE | SDL_ANYFORMAT | SDL_RESIZABLE); + SDL_SWSURFACE | SDL_ANYFORMAT); #endif #else set_video_mode(gui_sdl_screen_width, gui_sdl_screen_height, - SDL_SWSURFACE | SDL_ANYFORMAT | SDL_RESIZABLE); + SDL_SWSURFACE | SDL_ANYFORMAT); #endif #if 0 Index: client/gui-sdl/optiondlg.c === --- client/gui-sdl/optiondlg.c (revision 13502) +++ client/gui-sdl/optiondlg.c (working copy) @@ -427,7 +427,6 @@ if (gui_sdl_fullscreen != BOOL_VAL(Main.screen->flags & SDL_FULLSCREEN)) { tmp_flags ^= SDL_FULLSCREEN; - tmp_flags ^= SDL_RESIZABLE; } mode = MAX_ID - pWidget->ID; ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] RT problems?
On 9/4/07, John Keller <[EMAIL PROTECTED]> wrote: > > The weird thing is that I added a comment yesterday to PR#39662 ("Build > cost always shown as '1' for current production"). > > It still hasn't shown up on the list, but I've been seeing other > people's comments just fine... Or is this some RT behavior? > > - John > "Comments" in RT generally don't show up at the list. You need to select "Response to requestors" for "Update type". ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39668) [Patch] Fix some potential crashes after script_signal_emit()
http://bugs.freeciv.org/Ticket/Display.html?id=39668 > Calling script_signal_emit() means that almost anything can happen. Most definitely cities or units can disappear. I just glanced where it has been called, and fixed most obvious cases where some now potentially invalid pointer was used immediately after script_signal_emit(). I left one case out of this patch. One in treaty handling needs more inspection. - ML diff -Nurd -X.diff_ignore freeciv/common/city.c freeciv/common/city.c --- freeciv/common/city.c 2007-09-02 07:14:07.0 +0300 +++ freeciv/common/city.c 2007-09-04 17:48:27.0 +0300 @@ -2504,3 +2504,16 @@ unit_list_free(pcity->units_supported); free(pcity); } + +/** + Check if unit with given id is still alive. Use this before using + old unit pointers when unit might have dead. +**/ +bool city_exist(int id) +{ + if (find_city_by_id(id)) { +return TRUE; + } + + return FALSE; +} diff -Nurd -X.diff_ignore freeciv/common/city.h freeciv/common/city.h --- freeciv/common/city.h 2007-09-02 07:14:07.0 +0300 +++ freeciv/common/city.h 2007-09-04 17:48:46.0 +0300 @@ -518,6 +518,8 @@ int *pollu_prod, int *pollu_pop, int *pollu_mod); int city_pollution(const struct city *pcity, int shield_total); +bool city_exist(int id); + /* * Iterates over all improvements which are built in the given city. */ diff -Nurd -X.diff_ignore freeciv/common/unit.c freeciv/common/unit.c --- freeciv/common/unit.c 2007-08-08 05:52:11.0 +0300 +++ freeciv/common/unit.c 2007-09-04 17:37:21.0 +0300 @@ -1604,3 +1604,16 @@ return result; } + +/** + Check if unit with given id is still alive. Use this before using + old unit pointers when unit might have dead. +**/ +bool unit_alive(int id) +{ + if (find_unit_by_id(id)) { +return TRUE; + } + + return FALSE; +} diff -Nurd -X.diff_ignore freeciv/common/unit.h freeciv/common/unit.h --- freeciv/common/unit.h 2007-08-08 05:52:11.0 +0300 +++ freeciv/common/unit.h 2007-09-04 17:35:17.0 +0300 @@ -318,4 +318,6 @@ enum unit_upgrade_result get_unit_upgrade_info(char *buf, size_t bufsz, const struct unit *punit); +bool unit_alive(int id); + #endif /* FC__UNIT_H */ diff -Nurd -X.diff_ignore freeciv/server/cityturn.c freeciv/server/cityturn.c --- freeciv/server/cityturn.c 2007-08-13 22:23:44.0 +0300 +++ freeciv/server/cityturn.c 2007-09-04 18:07:44.0 +0300 @@ -465,6 +465,7 @@ bool have_square; int savings_pct = granary_savings(pcity), new_food; bool rapture_grow = city_rapture_grow(pcity); /* check before size increase! */ + int saved_id = pcity->id; if (!city_can_grow_to(pcity, pcity->size + 1)) { /* need improvement */ if (get_current_construction_bonus(pcity, EFT_SIZE_ADJ, RPT_CERTAIN) > 0 @@ -522,8 +523,10 @@ _("%s grows to size %d."), pcity->name, pcity->size); script_signal_emit("city_growth", 2, API_TYPE_CITY, pcity, API_TYPE_INT, pcity->size); - - sanity_check_city(pcity); + if (city_exist(saved_id)) { +/* Script didn't destroy this city */ +sanity_check_city(pcity); + } sync_cities(); } @@ -615,6 +618,7 @@ { bool success = FALSE; int i; + int saved_id = pcity->id; if (worklist_is_empty(&pcity->worklist)) /* Nothing in the worklist; bail now. */ @@ -624,6 +628,12 @@ while (TRUE) { struct city_production target; +if (!city_exist(saved_id)) { + /* Some script has removed useless city that cannot build + * what it is told to! */ + return FALSE; +} + /* What's the next item in the worklist? */ if (!worklist_peek_ith(&pcity->worklist, &target, i)) /* Nothing more in the worklist. Ah, well. */ @@ -661,15 +671,16 @@ in the worklist, not its obsolete-closure new_target. */ utype_name_translation(ptarget)); - script_signal_emit("unit_cant_be_built", 3, - API_TYPE_UNIT_TYPE, ptarget, - API_TYPE_CITY, pcity, - API_TYPE_STRING, "never"); + /* Purge this worklist item. */ worklist_remove(&pcity->worklist, i-1); /* Reset i to index to the now-next element. */ i--; - + + script_signal_emit("unit_cant_be_built", 3, + API_TYPE_UNIT_TYPE, ptarget, + API_TYPE_CITY, pcity, + API_TYPE_STRING, "never"); continue; } else { /* Yep, we can go after new_target instead. Joy! */ @@ -694,16 +705,16 @@ "Purging..."), pcity->name, get_impr_name_ex(pcity, ptarget->index)); - script_signal_emit("building_cant_be_built", 3, - API_TYPE_BUILDING_TYPE, ptarget, - API_TYPE_CITY, pcity, - API_TYPE_STRING, "never"); /* Purge this worklist item. */ worklist_remove(
Re: [Freeciv-Dev] RT problems?
Marko Lindqvist wrote: > On 04/09/07, Per I. Mathisen wrote: >> On Mon, 3 Sep 2007, Marko Lindqvist wrote: It seems to me that we have problems with this list. Could RT be the reason of delaying messages? Can anyone look? >>> My experience is that mails about new tickets are not coming through, >>> but comments to old ones do. Tickets are created (I get confirmation >>> email, and web interface shows them) >> As far as I understand, the RT installation is living on borrowed time. We >> really need to start looking for other options with third-party hosting. I >> am taking backups of the database occasionally in case it goes down >> permanently. > > True. > > But I suspect that problems were related to mailing list (gna). Had > it been RT problem, it would have been exactly same for all the people > in this list. However, it seems that people have been replying to > mails I got only hours later. The weird thing is that I added a comment yesterday to PR#39662 ("Build cost always shown as '1' for current production"). It still hasn't shown up on the list, but I've been seeing other people's comments just fine... Or is this some RT behavior? - John ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] HOME is not set
On 04/09/07, François Marlier wrote: > > in config.h I defined this : > > #define FREECIV_PATH "~/Documents/Freeciv/saves", "/Applications/Freeciv", > "~/Documents/Freeciv/data", "~/Documents/Freeciv/share" This FREECIV_PATH is preprocessor macro. > path = getenv("FREECIV_PATH"); This FREECIV_PATH is environment variable. You should set env variable FREECIV_PATH, mutiple paths separated by ':'. - ML ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] HOME is not set
Ok, forget my stupid question about how Freeciv gets the HOME env. variable... ehehe... still I don't understand why HOME is not set... Le 4 sept. 07 à 16:47, François Marlier a écrit : Hello, I compiled SDL with iconv support and all is compiling fine. Now I'm facing the save path trouble again. in config.h I defined this : #define FREECIV_PATH "~/Documents/Freeciv/saves", "/Applications/ Freeciv", "~/Documents/Freeciv/data", "~/Documents/Freeciv/share" when doing this got no errors but can't load or save games. So I hacked shared.c as I did in previous beta4 (that was why, I guess, load games didn't work, because I hacked shared.c in client but not in server, now I'm working with same files so it's unlikely same mistake will occur). at line 856 : path = "~/Documents/Freeciv/saves"; /* getenv("FREECIV_PATH"); */ but while this is working with beta4, in beta6 an error pops : 1: Could not find home directory (HOME is not set) So here are my questions : -How does Freeciv get the $HOME environment variable (through which lib or header?) -Why is getenv not taking my multiple FREECIV_PATH ? or why is path not defined by getenv("FREECIV_PATH")? tia François Marlier ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] HOME is not set
Hello, I compiled SDL with iconv support and all is compiling fine. Now I'm facing the save path trouble again. in config.h I defined this : #define FREECIV_PATH "~/Documents/Freeciv/saves", "/Applications/ Freeciv", "~/Documents/Freeciv/data", "~/Documents/Freeciv/share" when doing this got no errors but can't load or save games. So I hacked shared.c as I did in previous beta4 (that was why, I guess, load games didn't work, because I hacked shared.c in client but not in server, now I'm working with same files so it's unlikely same mistake will occur). at line 856 : path = "~/Documents/Freeciv/saves"; /* getenv("FREECIV_PATH"); */ but while this is working with beta4, in beta6 an error pops : 1: Could not find home directory (HOME is not set) So here are my questions : -How does Freeciv get the $HOME environment variable (through which lib or header?) -Why is getenv not taking my multiple FREECIV_PATH ? or why is path not defined by getenv("FREECIV_PATH")? tia François Marlier___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] RT problems?
On 04/09/07, Per I. Mathisen wrote: > On Mon, 3 Sep 2007, Marko Lindqvist wrote: > >> It seems to me that we have problems with this list. Could RT be > >> the reason of delaying messages? Can anyone look? > > > > My experience is that mails about new tickets are not coming through, > > but comments to old ones do. Tickets are created (I get confirmation > > email, and web interface shows them) > > As far as I understand, the RT installation is living on borrowed time. We > really need to start looking for other options with third-party hosting. I > am taking backups of the database occasionally in case it goes down > permanently. True. But I suspect that problems were related to mailing list (gna). Had it been RT problem, it would have been exactly same for all the people in this list. However, it seems that people have been replying to mails I got only hours later. - ML ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39667) Usability Issues
http://bugs.freeciv.org/Ticket/Display.html?id=39667 > SDL interface has some very annoying usability issues to address. If you run it in windowed mode, you can't resize the game by resizing the window. The game display logic should be independent of the resolution, an absraction that many games fail to make. Auto-scrolling is annoying. It is especially annoying when playing in windowed mode when you are often moving the mouse cursor in and out of the game window. It would be better to scroll when pressing the right-mouse-button since the RMB is already used for manual movement. There is no UI to save/load games in the SDL client. A work around is to open a chat dialog and use the /save and /load commands. Freeciv dialogs have a red X with the tooltip "Cancel" to close them. Not only is 'cancel' a horrible word - implies losing any changes but it simply leaves the dialog - it is also innaccurate. "Close Dialog" is better. A better icon may be the circular arrow commonly used to represent returning to a previous screen. There's no option to undo changes in a city dialog. Combine this with the "Cancel" situation and you have a very confusing UI. If you click on a group of units, a unit selection dialog pops up. If you the do an action with already-selected unit and the dialog does not close itself. I could see no obvious way to end the turn with the mouse - annoying for a mouse-driven game. After being told there is, I looked a bit harder. It's an icon on the minimap panel, alongside various information icons. Hardly obvious - in a heavily iconified UI like Freeciv SDL is aspiring to be, placing is important. They need to think a bit harder about this one. I would have placed it somewhere at the top near where the year is displayed since the turn and the game year are strongly associated and importantly you won't be clicking on it by accident if it is up there (something easy to do currently as a small icon placed amongst a bunch of other small icons). Source: http://freegamer.blogspot.com/2007/08/freeciv-21beta6-grips.html ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39659) [Patch] Hash attribute chunks separately
http://bugs.freeciv.org/Ticket/Display.html?id=39659 > On 02/09/07, Marko Lindqvist wrote: > > If attribute block consist of several attribute chunks, hash each > chunk separately. This avoids sending all the chunks as changed. > In theory, at least. Compilation problems have so far prevented me > from actually testing this. In practice, chunk of 1400 bytes never stays identical between two sends. So it also needed more fine grained checking for identical parts of chunk. With this patch network traffic caused by attribute blocks went from 15000 to 2000 bytes in my regression test. This requires capability change; old versions do not store information and new versions are not resending it. - ML diff -Nurd -X.diff_ignore freeciv/common/packets.def freeciv/common/packets.def --- freeciv/common/packets.def 2007-09-02 05:15:08.0 +0300 +++ freeciv/common/packets.def 2007-09-04 16:33:40.0 +0300 @@ -716,9 +716,10 @@ end PACKET_PLAYER_ATTRIBUTE_CHUNK=47; pre-send, sc,cs,handle-via-packet - UINT32 offset, total_length, chunk_length; + UINT32 offset; key + UINT32 total_length, chunk_length; /* to keep memory management simple don't allocate dynamic memory */ - MEMORY data[ATTRIBUTE_CHUNK_SIZE:chunk_length]; + MEMORY data[ATTRIBUTE_CHUNK_SIZE:chunk_length]; diff end /** Unit packets **/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] RT problems?
On Mon, 3 Sep 2007, Marko Lindqvist wrote: >> It seems to me that we have problems with this list. Could RT be >> the reason of delaying messages? Can anyone look? > > My experience is that mails about new tickets are not coming through, > but comments to old ones do. Tickets are created (I get confirmation > email, and web interface shows them) As far as I understand, the RT installation is living on borrowed time. We really need to start looking for other options with third-party hosting. I am taking backups of the database occasionally in case it goes down permanently. - Per ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#34276) Re: (PR#39663) Linux(Opensuse) GTK2 Client does not correctly assign port number
http://bugs.freeciv.org/Ticket/Display.html?id=34276 > On 04/09/07, Jordi Negrevernis i Font wrote: > > Marko Lindqvist wrote: > > > > What Freeciv version and which client are you using? > > > Freeciv 2.1.0 Beta6 compiled from source Can you try what 'grep DEFAULT_SOCK_PORT client/clinet.h' says about default port? I grepped all our sources for '' and found no instance where it could still get it as default. - ML ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#34276) Re: (PR#39663) Linux(Opensuse) GTK2 Client does not correctly assign port number
http://bugs.freeciv.org/Ticket/Display.html?id=34276 > Marko Lindqvist wrote: > http://bugs.freeciv.org/Ticket/Display.html?id=34276 > > > On 04/09/07, Jordi Negrevernis i Font wrote: > >> Marko Lindqvist wrote: >> >>> On 03/09/07, Jordi Negrevernis i Font wrote: >>> >>> >> Yes, but the problem appeared in a clean install with a freshly >> installed Open Suse!!! >> >> There can't be client settings saved. >> > > What Freeciv version and which client are you using? > > > Freeciv 2.1.0 Beta6 compiled from source ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39660) [Patch] Read auth configuration from file
http://bugs.freeciv.org/Ticket/Display.html?id=39660 > On 03/09/07, Marko Lindqvist wrote: > > Instead of using hardcoded information in accessing auth server, > configuration is read from file. Give "-" as filename to use internal > defaults. Fixed compiler warning when compiling auth disabled. - ML diff -Nurd -X.diff_ignore freeciv/server/auth.c freeciv/server/auth.c --- freeciv/server/auth.c 2007-09-03 00:47:50.0 +0300 +++ freeciv/server/auth.c 2007-09-04 13:40:41.0 +0300 @@ -40,12 +40,12 @@ #include "srv_main.h" /* where our mysql database is located and how to get to it */ -#define HOST"localhost" -#define USER"anonymous" -#define PASSWORD"" +#define DEFAULT_AUTH_HOST "localhost" +#define DEFAULT_AUTH_USER "anonymous" +#define DEFAULT_AUTH_PASSWORD "" /* the database where our table is located */ -#define DATABASE"test" +#define DEFAULT_AUTH_DATABASE "test" /* the tables where we will do our lookups and inserts. * the tables can be created with the following: @@ -76,8 +76,8 @@ * N.B. if the tables are not of this format, then the select,insert, * and update syntax in the auth_db_* functions below must be changed. */ -#define AUTH_TABLE "auth" -#define LOGIN_TABLE "loginlog" +#define DEFAULT_AUTH_TABLE "auth" +#define DEFAULT_AUTH_LOGIN_TABLE "loginlog" #define GUEST_NAME "guest" @@ -114,6 +114,243 @@ AUTH_DB_NOT_FOUND }; +#ifdef HAVE_AUTH + +enum auth_option_source { + AOS_DEFAULT, /* Internal default */ + AOS_FILE, /* Read from config file*/ + AOS_SET /* Set, currently not used */ +}; + +struct auth_option { + const char *name; + char*value; + enum auth_option_source source; +}; + +static struct authentication_conf { + struct auth_option host; + struct auth_option user; + struct auth_option password; + struct auth_option database; + struct auth_option table; + struct auth_option login_table; +} auth_config; + +/* How much information dump functions show */ +enum show_source_type { + SST_NONE, + SST_DEFAULT, + SST_ALL +}; + +/** + Output information about one auth option. +**/ +static void print_auth_option(int loglevel, enum show_source_type show_source, + bool show_value, const struct auth_option *target) +{ + char buffer[512]; + bool real_show_source; + + buffer[0] = '\0'; + + real_show_source = (show_source == SST_ALL + || (show_source == SST_DEFAULT && target->source == AOS_DEFAULT)); + + if (show_value || real_show_source) { +/* We will print this line. Begin it. */ +/* TRANS: Further information about option will follow. */ +my_snprintf(buffer, sizeof(buffer), _("Auth option \"%s\":"), target->name); + } + + if (show_value) { +cat_snprintf(buffer, sizeof(buffer), " \"%s\"", target->value); + } + if (real_show_source) { +switch(target->source) { + case AOS_DEFAULT: + if (show_source == SST_DEFAULT) { + /* TRANS: After 'Auth option "user":'. Option value may have been inserted + * between these. */ + cat_snprintf(buffer, sizeof(buffer), + _(" missing from config file (using default)")); + } else { + /* TRANS: auth option originates from internal default */ + cat_snprintf(buffer, sizeof(buffer), _(" (default)")); + } + break; + case AOS_FILE: + /* TRANS: auth option originates from config file */ + cat_snprintf(buffer, sizeof(buffer), _(" (config)")); + break; + case AOS_SET: + /* TRANS: auth option has been set from prompt */ + cat_snprintf(buffer, sizeof(buffer), _(" (set)")); + break; +} + } + + if (buffer[0] != '\0') { +/* There is line to print */ +freelog(loglevel, buffer); + } +} + +/** + Output auth config information. +**/ +static void print_auth_config(int loglevel, enum show_source_type show_source, + bool show_value) +{ + print_auth_option(loglevel, show_source, show_value, &auth_config.host); + print_auth_option(loglevel, show_source, show_value, &auth_config.user); + print_auth_option(loglevel, show_source, FALSE, &auth_config.password); + print_auth_option(loglevel, show_source, show_value, &auth_config.database); + print_auth_option(loglevel, show_source, show_value, &auth_config.table); + print_auth_option(loglevel, show_source, show_value, &auth_config.login_table); +} + +/** + Set one auth option. +
Re: [Freeciv-Dev] (PR#34276) Re: (PR#39663) Linux(Opensuse) GTK2 Client does not correctly assign port number
http://bugs.freeciv.org/Ticket/Display.html?id=34276 > On 04/09/07, Marko Lindqvist wrote: > > What Freeciv version and which client are you using? Ok, you set current subject for this thread, so it's gtk2 -client. So: version and where you get it? (Installed OpenSuse packet/compiled from OpenSuse sources/compiled from our (upstream) sources/...) You can get version information by running 'civclient -v' and 'civserver -v' - ML ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#34276) clients default to the wrong port
http://bugs.freeciv.org/Ticket/Display.html?id=34276 > > [EMAIL PROTECTED] - Mar. Sep. 04 10:09:58 2007]: > > Marko Lindqvist wrote: > > http://bugs.freeciv.org/Ticket/Display.html?id=39663 > > > > > On 03/09/07, Jordi Negrevernis i Font wrote: > > > >> When you try to attach to a server throu 'Connect to a network game' > >> the propossed port number is !! So the client does not connect!! It > >> should be 5556, right? > >> > > > > Port number is saved with other client settings. If you have played > > some older version of Freeciv, you have probably saved port number > > to your settings. > > > > It is a problem that even if user has always been using default port, > > client does not automatically switch to new default port (default in > > now created client settings is of course 5556) > > > > > Yes, but the problem appeared in a clean install with a freshly > installed Open Suse!!! > > There can't be client settings saved. > > > It is saved settings. I checked this code. It cannot set to by default, except if you run with -p or if you have file named .civclientrc with the line "default_server_port=" in your home directory (It is a hidden file). ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#34276) Re: (PR#39663) Linux(Opensuse) GTK2 Client does not correctly assign port number
http://bugs.freeciv.org/Ticket/Display.html?id=34276 > On 04/09/07, Jordi Negrevernis i Font wrote: > > Marko Lindqvist wrote: > > > > On 03/09/07, Jordi Negrevernis i Font wrote: > > > >> When you try to attach to a server throu 'Connect to a network game' > >> the propossed port number is !! So the client does not connect!! It > >> should be 5556, right? ... > Yes, but the problem appeared in a clean install with a freshly > installed Open Suse!!! > > There can't be client settings saved. What Freeciv version and which client are you using? - ML ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#34276) Re: (PR#39663) Linux(Opensuse) GTK2 Client does not correctly assign port number
http://bugs.freeciv.org/Ticket/Display.html?id=34276 > Marko Lindqvist wrote: > http://bugs.freeciv.org/Ticket/Display.html?id=39663 > > > On 03/09/07, Jordi Negrevernis i Font wrote: > >> When you try to attach to a server throu 'Connect to a network game' >> the propossed port number is !! So the client does not connect!! It >> should be 5556, right? >> > > Port number is saved with other client settings. If you have played > some older version of Freeciv, you have probably saved port number > to your settings. > > It is a problem that even if user has always been using default port, > client does not automatically switch to new default port (default in > now created client settings is of course 5556) > > Yes, but the problem appeared in a clean install with a freshly installed Open Suse!!! There can't be client settings saved. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39666) [Patch] Run generate_packets.py from any directory
http://bugs.freeciv.org/Ticket/Display.html?id=39666 > This patch changes generate_packets.py to work even if workdir is not srcdir/common. Small step forward for generating files to builddir. - ML diff -Nurd -X.diff_ignore freeciv/common/generate_packets.py freeciv/common/generate_packets.py --- freeciv/common/generate_packets.py 2007-08-04 18:38:32.0 +0300 +++ freeciv/common/generate_packets.py 2007-09-04 12:55:21.0 +0300 @@ -1358,7 +1358,16 @@ # various files. def main(): ### parsing input -input_name="packets.def" +src_dir=os.path.dirname(sys.argv[0]) +src_root=src_dir+"/.." +input_name=src_dir+"/packets.def" +### We call this variable target_root instead of build_root +### to avoid confusion as we are not building to builddir in +### automake sense. +### We build to src dir. Building to builddir causes a lot +### of problems we have been unable to solve. +target_root=src_root + content=open(input_name).read() content=strip_c_comment(content) lines=string.split(content,"\n") @@ -1383,7 +1392,7 @@ ### parsing finished ### writing packets_gen.h -output_h_name="packets_gen.h" +output_h_name=target_root+"/common/packets_gen.h" if lazy_overwrite: output_h=my_open(output_h_name+".tmp") @@ -1407,7 +1416,7 @@ output_h.close() ### writing packets_gen.c -output_c_name="packets_gen.c" +output_c_name=target_root+"/common/packets_gen.c" if lazy_overwrite: output_c=my_open(output_c_name+".tmp") else: @@ -1483,7 +1492,7 @@ open(i,"w").write(new) os.remove(i+".tmp") -f=my_open("../server/hand_gen.h") +f=my_open(target_root+"/server/hand_gen.h") f.write(''' #ifndef FC__HAND_GEN_H #define FC__HAND_GEN_H @@ -1525,7 +1534,7 @@ ''') f.close() -f=my_open("../client/packhand_gen.h") +f=my_open(target_root+"/client/packhand_gen.h") f.write(''' #ifndef FC__PACKHAND_GEN_H #define FC__PACKHAND_GEN_H @@ -1556,7 +1565,7 @@ ''') f.close() -f=my_open("../server/hand_gen.c") +f=my_open(target_root+"/server/hand_gen.c") f.write(''' #ifdef HAVE_CONFIG_H @@ -1611,7 +1620,7 @@ ''') f.close() -f=my_open("../client/packhand_gen.c") +f=my_open(target_root+"/client/packhand_gen.c") f.write(''' #ifdef HAVE_CONFIG_H ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev