[Freeciv-Dev] (PR#40307) svn revision in version string
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40307 The subversion revision is not included in VERSION_STRING which is used in a lot of places. Thus even if SVNREV is defined, the subversion version isn't actually shown on, for instance, the startup screen. I think VERSION_STRING should not be used outside of version.c. The client and other callers should use access functions, including a short version string. The word_version() function is generally bad for i18n as it is used in string constructors so if possible should be removed I think (though I'm not sure about it's use in the SDL client; in gtk it's a straight string constructor). my_snprintf(msgbuf, sizeof (msgbuf), _(Freeciv version %s %s), VERSION_STRING, _((beta version))); In version.c this is also a bad and unnecessary string constructor IMO. The whole thing here should be translated as one. It's possible there's good reason for some of the way things are done now but I do think some could use an overhaul. -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40308) distinguishing mandatory and optional capabilities
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40308 The current capability sets are not enough for GGZ. Specifically, GGZ does its own capability checking (or prechecking), comparing capability strings to see if a game is supported. Each GGZ room supports one game so there is a 2.1 room which should support the whole 2.1 collection (the bizarre broken capability in 2.1 notwithstanding). This string is provided in several places: data/civclient.dsc.in, data/civserver.dsc.in, and is used in ggz_gtk_init in gui_main.c. But with our optional capabilities the regular capstring cannot be used here. Doing so means GGZ sees compatible releases as incompatible if they contain different optional capabilities. When NETWORK_CAPSTRING was first added to the bootstrap (AC_SUBST and AC_DEFINE) it was to allow ggz support but I completely missed this nuance. The easiest way I think is to separate the capstring into two strings, one for mandatory and one for optional capabilities. The attached patch does this; it's pretty simple really. For 2.1 to get GGZ support working again (since an optional capability was present there) a similar change (probably more complicated since the 2.1 system is different) will be needed for that branch along with a new 2.1 release. -jason Index: version.in === --- version.in (revision 14848) +++ version.in (working copy) @@ -23,4 +23,5 @@ # - Avoid adding a new mandatory capability to the development branch for # as long as possible. We want to maintain network compatibility with # the stable branch for as long as possible. -NETWORK_CAPSTRING=+Freeciv.Devel.2008.May.08 +NETWORK_CAPSTRING_MANDATORY=+Freeciv.Devel.2008.May.08 +NETWORK_CAPSTRING_OPTIONAL= Index: configure.ac === --- configure.ac (revision 14848) +++ configure.ac (working copy) @@ -44,9 +44,14 @@ AC_SUBST([MAJOR_VERSION]) AC_SUBST([MINOR_VERSION]) -AC_DEFINE_UNQUOTED([NETWORK_CAPSTRING], [$NETWORK_CAPSTRING], +AC_DEFINE_UNQUOTED([NETWORK_CAPSTRING_MANDATORY], + [$NETWORK_CAPSTRING_MANDATORY], [Network capability string]) -AC_SUBST([NETWORK_CAPSTRING]) +AC_SUBST([NETWORK_CAPSTRING_MANDATORY]) +AC_DEFINE_UNQUOTED([NETWORK_CAPSTRING_OPTIONAL], + [$NETWORK_CAPSTRING_OPTIONAL], + [Additional optional network capabilities]) +AC_SUBST([NETWORK_CAPSTRING_OPTIONAL]) dnl Initialize automake stuff AM_INIT_AUTOMAKE($PACKAGE, $VERSION) Index: data/civserver.dsc.in === --- data/civserver.dsc.in (revision 14848) +++ data/civserver.dsc.in (working copy) @@ -12,7 +12,7 @@ [Protocol] Engine = Freeciv -Version = @NETWORK_CAPSTRING@ +Version = @NETWORK_CAPSTRING_MANDATORY@ [TableOptions] AllowLeave = 1 Index: data/civclient.dsc.in === --- data/civclient.dsc.in (revision 14848) +++ data/civclient.dsc.in (working copy) @@ -7,5 +7,5 @@ Homepage = http://www.freeciv.org/ Name = Freeciv ProtocolEngine = Freeciv -ProtocolVersion = @NETWORK_CAPSTRING@ +ProtocolVersion = @NETWORK_CAPSTRING_MANDATORY@ Version = @VERSION@ Index: common/capstr.h === --- common/capstr.h (revision 14848) +++ common/capstr.h (working copy) @@ -13,6 +13,9 @@ #ifndef FC__CAPSTR_H #define FC__CAPSTR_H +#define NETWORK_CAPSTRING (NETWORK_CAPSTRING_MANDATORY \ + NETWORK_CAPSTRING_OPTIONAL) + extern const char * const our_capability; void init_our_capability(void); Index: client/gui-gtk-2.0/gui_main.c === --- client/gui-gtk-2.0/gui_main.c (revision 14848) +++ client/gui-gtk-2.0/gui_main.c (working copy) @@ -1412,7 +1412,7 @@ * civserver.dsc.in. */ ggz_gtk_initialize(FALSE, ggz_connected, ggz_game_launched, ggz_closed, - Freeciv, NETWORK_CAPSTRING, Pubserver); + Freeciv, NETWORK_CAPSTRING_MANDATORY, Pubserver); #endif log_set_callback(log_callback_utf8); ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39582) 2.0.9: crash at end of turn
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39582 [EMAIL PROTECTED] - So 22. Jun 2008, 19:09:56]: I can't reproduce the crash here with S2_0. On loading the game and ending turn a time or two, the game ends. What client is used to get the crash and what is necessary to do other than just end turn? -jason The crash happens on Windows (GTK+ client) after ending the turn and after the server cuts the connection due to lagging player while the client is busy for some seconds. When the client detects the lost connection (in this case when trying to send data to the server in request_new_unit_activity(punit, ACTIVITY_IDLE), called from set_unit_focus()) it does some cleanup and switches to the main page. But set_unit_focus() still continues after the request_new_unit_activity() call and references a now invalid unit pointer: /* in set_unit_focus() */ ... if (punit-activity != ACTIVITY_IDLE || punit-ai.control) { punit-ai.control = FALSE; refresh_unit_city_dialogs(punit); request_new_unit_activity(punit, ACTIVITY_IDLE); / lost connection detected and client in pre-game state ***/ } } / punit_old_focus is now invalid */ /* avoid the old focus unit disappearing: */ if (punit_old_focus (!punit || !same_pos(punit_old_focus-tile, punit-tile))) { refresh_tile_mapcanvas(punit_old_focus-tile, FALSE); } Now I wonder if it's really necessary to take actions on socket write errors on the client side at all? Since the request calls to the server don't return an immediate result that the client depends on, wouldn't it be sufficient if the client would cleanup and reset to pre-game state only when reading of server input fails? The attached patch fixed the crash and didn't show any problems for me so far. Index: client/clinet.c === --- client/clinet.c (revision 14833) +++ client/clinet.c (working copy) @@ -186,8 +186,6 @@ { struct packet_server_join_req req; - close_socket_set_callback(close_socket_callback); - /* connection in progress? wait. */ if (aconnection.used) { (void) mystrlcpy(errbuf, _(Connection in progress.), errbufsize); ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] Problem compiling Freeciv SVN trunk
Hello! I'm getting a compilation error when compiling Freeciv from SVN trunk. I think this has been introduced into SVN in the last few days. gcc -DHAVE_CONFIG_H -I. -I../.. -I../../utility -I../../common -I../../server -I../../dependencies/lua-5.1/src -I../../dependencies/toluaxx/include -DLOCALEDIR=\/usr/local/share/locale\ -DDEFAULT_DATA_PATH=\.:data:~/.freeciv:/usr/local/share/freeciv\ -Wall -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -pthread -g -O2 -MT api_gen.o -MD -MP -MF .deps/api_gen.Tpo -c -o api_gen.o api_gen.c api_gen.c:11:19: error: tolua.h: Ingen slik fil eller filkatalog api_gen.c:14: error: expected =, ,, ;, asm or __attribute__ before int - Andreas ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40309) What to do with the expanded terrain (was:Meta-ticket for 2.2 release)
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40309 On Sun, 22 Jun 2008 22:14:57 +0900, Per I. Mathisen [EMAIL PROTECTED] wrote: URL: http://bugs.freeciv.org/Ticket/Display.html?id=40272 On Sun, Jun 22, 2008 at 12:14 PM, Daniel Markstedt [EMAIL PROTECTED] wrote: IMHO another must-fix for 2.2 first beta is some kind of update to the default tilesets. William's new terrain rules have outdated all 2.1 tilesets. Wooded hills provide different resources from verdant hills, for example, but use the same sprite and often exist in the same general area. If we release a beta without doing anything about this, I can promise it'll generate alot of negative buzz among veteran users. For starters, I will make ugly-but-usable tweaks to the current default tilesets, while trying to recruit the services of our artist community. I would rather suggest these terrain code changes are reverted. I see no good reason for them other than the inane we have to do it like game XYZ. Even with new graphics they will be quite confusing. - Per How about this solution: Keep the code but edit the rulesets to restore 2.1-equivalent gameplay. For example, 'desert plain' and 'desert hills' have the same values and look the same for now, while we leave the window open for ruleset creators to add complexity and artists to add visual variety. I just recalled another 'bug' that the new terrain code has introduced: less accuracy of civ1 and civ2 rulesets. Both share the same terrainset as default, which is needless to say far from the original rules for those games. I remember trying to create a 'classical' terrainset late last year but ran into various issues; the current terrain code is not flexible enough to reimplement a simpler terrainset. ~Daniel -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#40303) [Patch] Fix Global Observer crash in connectdlg
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40303 2008/6/22 Jason Dorje Short: I'd suggest using valgrind to find the exact line where the error occurs here and to make sure the fix actually fixes and doesn't just hide the error. Valgrind can show only the point where actual illegal memory access is made, which in this case caused segfault. It cannot tell when the variable gets illegal pointer assigned. Traditional debugging shows that player_ptr is NULL when entering game_renumber_players() and gets set there. Patch fixes that. Only possible 'hidden' error is that player_idx is not set to special flag value like -1. - ML ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39582) 2.0.9: crash at end of turn
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39582 Christian Prochaska wrote: The crash happens on Windows (GTK+ client) after ending the turn and after the server cuts the connection due to lagging player while the client is busy for some seconds. When the client detects the lost connection (in this case when trying to send data to the server in request_new_unit_activity(punit, ACTIVITY_IDLE), called from set_unit_focus()) it does some cleanup and switches to the main page. But set_unit_focus() still continues after the request_new_unit_activity() call and references a now invalid unit pointer: Interesting. But...I thought hack connections weren't supposed to be cut because of lag? When I run under valgrind I get: 2: ignoring ping timeout to hack-level connection sjolley from localhost (player Stephen Jolley) many many times. But the connection is uninterrupted. Now I wonder if it's really necessary to take actions on socket write errors on the client side at all? Since the request calls to the server don't return an immediate result that the client depends on, wouldn't it be sufficient if the client would cleanup and reset to pre-game state only when reading of server input fails? The attached patch fixed the crash and didn't show any problems for me so far. Possibly an okay workaround. But, I'd still want to know how exactly the punit_focus is getting set to an invalid (freed) pointer. If it can happen here, it could happen again. -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] Problem compiling Freeciv SVN trunk
2008/6/23 Andreas Røsdal [EMAIL PROTECTED]: Hello! I'm getting a compilation error when compiling Freeciv from SVN trunk. I think this has been introduced into SVN in the last few days. gcc -DHAVE_CONFIG_H -I. -I../.. -I../../utility -I../../common -I../../server -I../../dependencies/lua-5.1/src -I../../dependencies/toluaxx/include -DLOCALEDIR=\/usr/local/share/locale\ -DDEFAULT_DATA_PATH=\.:data:~/.freeciv:/usr/local/share/freeciv\ -Wall -Wpointer-arith -Wcast-align -Wmissing-prototypes -Wmissing-declarations -pthread -g -O2 -MT api_gen.o -MD -MP -MF .deps/api_gen.Tpo -c -o api_gen.o api_gen.c api_gen.c:11:19: error: tolua.h: Ingen slik fil eller filkatalog api_gen.c tries to include tolua.h? Short answer: touch server/scripting/api.pkg Long answer: api_gen.c must be regenerated by toluaxx, and after that it's no longer going to include tolua.h but toluaxx.h. Header of api_gen.[ch] tell when they were last regenerated nad by which tool. Material for FAQ? - ML ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39582) 2.0.9: crash at end of turn
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39582 Maybe I miss something, but: your backtrace in this ticket shows the crash happening on a successful read, not on a write error. It also shows SDL and GTK code being mixed together, what's up with that? -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40310) terrain code crash in trunk
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40310 I was running a game through GGZ and the client crashed. The server kept running and I reconnected to it and it crashed again; this time I got a backtrace. Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb73c2720 (LWP 20201)] terrain_name_translation (pterrain=0x0) at terrain.c:256 256 if (NULL == pterrain-name.translated) { (gdb) bt #0 terrain_name_translation (pterrain=0x0) at terrain.c:256 #1 0x080fbab7 in tile_get_info_text (ptile=0xf42a58c, linebreaks=0) at tile.c:662 #2 0x0808130e in get_unit_info_label_text2 (punits=0xb2a8410, linebreaks=0) at text.c:759 #3 0x08131a44 in update_unit_info_label (punits=0xb2a8410) at mapview.c:215 #4 0x0806114b in set_unit_focus (punit=0xf4859b0) at control.c:375 #5 0x08061658 in advance_unit_focus () at control.c:528 #6 0x08058ce2 in set_client_state (newstate=C_S_RUNNING) at civclient.c:551 #7 0x080737c3 in update_client_state (value=C_S_RUNNING) at packhand.c:409 #8 0x08076ec2 in handle_start_phase (phase=0) at packhand.c:1022 #9 0x08079d93 in client_handle_packet (type=PACKET_START_PHASE, packet=0x0) at packhand_gen.c:231 #10 0x08058e49 in client_packet_input (packet=0xf40be30, type=91) at civclient.c:449 #11 0x0805cd79 in input_from_server (fd=13) at clinet.c:391 #12 0xb7b01b2f in ?? () from /usr/lib/libgdk-x11-2.0.so.0 #13 0x000d in ?? () #14 0x000d in ?? () #15 0x0001 in ?? () #16 0x0008 in ?? () #17 0x0010 in ?? () #18 0xb79a0804 in ?? () from /usr/lib/libglib-2.0.so.0 #19 0x081243a0 in ?? () at gui_main.c:1939 #20 0xb79a0248 in ?? () from /usr/lib/libglib-2.0.so.0 #21 0x0ee19800 in ?? () #22 0xb7b01ad0 in ?? () from /usr/lib/libgdk-x11-2.0.so.0 #23 0xbfeb2058 in ?? () #24 0xb795c64d in ?? () from /usr/lib/libglib-2.0.so.0 #25 0x0b2a3f80 in ?? () #26 0x0001 in ?? () #27 0x0edfe7b8 in ?? () #28 0xb79a0248 in ?? () from /usr/lib/libglib-2.0.so.0 #29 0xbfeb209c in ?? () #30 0x0ee19800 in ?? () #31 0xbfeb20b8 in ?? () #32 0xb7928978 in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0 This time I wanted to check something different so I closed gdb to have it connect again. But the server had closed up. -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40311) disable hack test in GGZ mode
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40311 [EMAIL PROTECTED] - Mon Jun 23 19:37:35 2008]: This patch disables the hack check (want_hack) when the server's running in GGZ mode. I think this is a good idea to reduce any possible security hole in what is already known to be a public game; it's also convenient for testing. The patch in #40124 does the same thing but is more general in that it gives server operators more control over disabling the hack check (i.e. not just in ggz mode). -- 許して上げるよ。 ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39582) 2.0.9: crash at end of turn
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39582 [EMAIL PROTECTED] - Mo 23. Jun 2008, 15:43:02]: Christian Prochaska wrote: The crash happens on Windows (GTK+ client) after ending the turn and after the server cuts the connection due to lagging player while the client is busy for some seconds. When the client detects the lost connection (in this case when trying to send data to the server in request_new_unit_activity(punit, ACTIVITY_IDLE), called from set_unit_focus()) it does some cleanup and switches to the main page. But set_unit_focus() still continues after the request_new_unit_activity() call and references a now invalid unit pointer: Interesting. But...I thought hack connections weren't supposed to be cut because of lag? When I run under valgrind I get: 2: ignoring ping timeout to hack-level connection sjolley from localhost (player Stephen Jolley) many many times. But the connection is uninterrupted. that's ping timeout (server option pingtimeout), but the lag cut is associated to network timeout (server option nettimeout) which doesn't have a check for hack level access (perhaps it should have). Can you reproduce the crash when setting the nettimeout server option to a lower value before ending the turn? Now I wonder if it's really necessary to take actions on socket write errors on the client side at all? Since the request calls to the server don't return an immediate result that the client depends on, wouldn't it be sufficient if the client would cleanup and reset to pre-game state only when reading of server input fails? The attached patch fixed the crash and didn't show any problems for me so far. Possibly an okay workaround. But, I'd still want to know how exactly the punit_focus is getting set to an invalid (freed) pointer. If it can happen here, it could happen again. -jason got this from valgrind on Linux now: 2: lost connection to server ==11022== ==11022== Invalid read of size 4 ==11022==at 0x805F1D7: set_unit_focus (control.c:160) ==11022==by 0x806F246: handle_unit_packet_common (packhand.c:1043) ==11022==by 0x806F8A4: handle_unit_info (packhand.c:957) ==11022==by 0x8072275: client_handle_packet (packhand_gen.c:160) ==11022==by 0x8058588: handle_packet_input (civclient.c:389) ==11022==by 0x805CE52: input_from_server (clinet.c:350) ==11022==by 0x43C6B2E: (within /usr/lib/libgdk-x11-2.0.so.0.1200.9) ==11022==by 0x45E364C: (within /usr/lib/libglib-2.0.so.0.1600.3) ==11022==by 0x45AF977: g_main_context_dispatch (in /usr/lib/libglib-2.0.so.0.1600.3) ==11022==by 0x45B2BCD: (within /usr/lib/libglib-2.0.so.0.1600.3) ==11022==by 0x45B2F56: g_main_loop_run (in /usr/lib/libglib-2.0.so.0.1600.3) ==11022==by 0x417DD03: gtk_main (in /usr/lib/libgtk-x11-2.0.so.0.1200.9) ==11022== Address 0x524ba64 is 12 bytes inside a block of size 172 free'd ==11022==at 0x402265C: free (vg_replace_malloc.c:323) ==11022==by 0x8093059: game_remove_player (game.c:463) ==11022==by 0x809314D: game_free (game.c:312) ==11022==by 0x805848A: set_client_state (civclient.c:532) ==11022==by 0x805CC59: close_socket_nomessage (clinet.c:113) ==11022==by 0x805CC7D: close_socket_callback (clinet.c:124) ==11022==by 0x808F689: write_socket_data (connection.c:252) ==11022==by 0x808F725: flush_connection_send_buffer_all (connection.c:276) ==11022==by 0x80990A8: send_packet_data (packets.c:161) ==11022==by 0x809E81F: send_packet_unit_change_activity (packets_gen.c:16599) ==11022==by 0x809E989: dsend_packet_unit_change_activity (packets_gen.c:16667) ==11022==by 0x805E025: request_new_unit_activity (control.c:863) ==11022== So the unit pointer gets freed by game_remove_unit() (game.c:463) when the client switches to pre-game state. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39582) 2.0.9: crash at end of turn
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39582 [EMAIL PROTECTED] - Mo 23. Jun 2008, 15:54:33]: Maybe I miss something, but: your backtrace in this ticket shows the crash happening on a successful read, not on a write error. It also shows SDL and GTK code being mixed together, what's up with that? -jason As I understand it, the read was successful, but while the received data is being handled, the connection gets lost, which gets detected when trying to send data to the server in request_new_unit_activity(). The write error then causes the client to switch to pre-game state, which causes the unit pointer to be freed. SDL is used for sound output and on Windows the main() function is wrapped by SDL_main() which does some Windows-specific initialization. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40309) What to do with the expanded terrain (was:Meta-ticket for 2.2 release)
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40309 [dmarks - Mon Jun 23 11:07:33 2008]: On Sun, 22 Jun 2008 22:14:57 +0900, Per I. Mathisen [EMAIL PROTECTED] wrote: URL: http://bugs.freeciv.org/Ticket/Display.html?id=40272 On Sun, Jun 22, 2008 at 12:14 PM, Daniel Markstedt [EMAIL PROTECTED] wrote: IMHO another must-fix for 2.2 first beta is some kind of update to the default tilesets. William's new terrain rules have outdated all 2.1 tilesets. Wooded hills provide different resources from verdant hills, for example, but use the same sprite and often exist in the same general area. If we release a beta without doing anything about this, I can promise it'll generate alot of negative buzz among veteran users. For starters, I will make ugly-but-usable tweaks to the current default tilesets, while trying to recruit the services of our artist community. I would rather suggest these terrain code changes are reverted. I see no good reason for them other than the inane we have to do it like game XYZ. Even with new graphics they will be quite confusing. How about this solution: Keep the code but edit the rulesets to restore 2.1-equivalent gameplay. For example, 'desert plain' and 'desert hills' have the same values and look the same for now, while we leave the window open for ruleset creators to add complexity and artists to add visual variety. I think the new terrains should be in their own ruleset (civ3?), leaving the default, civ1 and civ2 rulesets more closely as they were in previous versions (before 2.2). Incidentally I checked the civ3 manual's appendix where the terrain types are listed and they don't match these new terrains in 2.2 and trunk. So are the new terrains supposed to be for civ4 emulation or some other game? :? I just recalled another 'bug' that the new terrain code has introduced: less accuracy of civ1 and civ2 rulesets. Both share the same terrainset as default, which is needless to say far from the original rules for those games. I remember trying to create a 'classical' terrainset late last year but ran into various issues; the current terrain code is not flexible enough to reimplement a simpler terrainset. I don't like that at all. Isn't one of the stated goals of freeciv the ability to emulate civ1 and civ2 rules? :( So my opinion would be to revert the terrain changes, unless someone is willing to do the work to restore civ1,2 terrain rule compatibilty and move the new terrain types to their own ruleset (and later to actually include the great quantity of necessary new graphics). -- 委員会は何日もそのことについて話し会いました。 ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39582) 2.0.9: crash at end of turn
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39582 [cproc - Mo 23. Jun 2008, 20:09:02]: SDL is used for sound output and on Windows the main() function is wrapped by SDL_main() which does some Windows-specific initialization. Actually, the client's main() function gets renamed to SDL_main() during compilation (-Dmain=SDL_main) and is then called by the WinMain() function in libSDLmain. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] Survey request
Dear member, in cooperation with the software engineering research group at Free University of Berlin (Freie Universität Berlin), we are currently conducting an empirical survey on time consumption of participants in Open Source/Free Software projects. In this survey we want to find out how much time is consumed in the different activities and aspects of Open Source/Free Software projects, such as software development, maintaining or user support. We would greatly appreciate you participating in our survey! This survey will take you no more than 15 minutes of your precious time. It is now open and will be closed on Tuesday the 1st of July. Note on data security: This survey is anonymous, so no personal information will be asked. As a gift in return we will share our insights with you (an URL is shown at completion of the survey). The Link to the survey: http://page.mi.fu-berlin.de/pepper/survey/ Thank You!!! Contact: [EMAIL PROTECTED] This message was sent using IMP, the Internet Messaging Program. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#40309) What to do with the expanded terrain (was:Meta-ticket for 2.2 release)
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40309 Madeline Book wrote: So my opinion would be to revert the terrain changes, unless someone is willing to do the work to restore civ1,2 terrain rule compatibilty and move the new terrain types to their own ruleset (and later to actually include the great quantity of necessary new graphics). No need to revert code changes but the ruleset terrain info should be reverted. Among other things all the terrain-drawing bugs need to be fixed (most deal with lack of graphics probably?). And afaik civ1 and civ2 do have their own terrain.ruleset... -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40309) What to do with the expanded terrain (was:Meta-ticket for 2.2 release)
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40309 [EMAIL PROTECTED] - Mon Jun 23 20:53:07 2008]: Madeline Book wrote: So my opinion would be to revert the terrain changes, unless someone is willing to do the work to restore civ1,2 terrain rule compatibilty and move the new terrain types to their own ruleset (and later to actually include the great quantity of necessary new graphics). No need to revert code changes but the ruleset terrain info should be reverted. Among other things all the terrain-drawing bugs need to be fixed (most deal with lack of graphics probably?). And afaik civ1 and civ2 do have their own terrain.ruleset... Actually if you now try the new editor in S2_2 and trunk with the civ1 or civ2 rulesets you will find some very weird stuff in the terrain list. For example volcanoes and oceanic ridges that were never in civ1,2, and multiple duplicate terrain types. It's a big mess and the ruleset files should probably be reverted (but will the old versions still work with the new code?). -- さあ、行って見て。 ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] saveturns on public games
This is just a request for ideas at this point. The saveturns variable is set to 10 by default and without hack access cannot be changed. This means in any public game (ggz, pubserver) it is stuck at 10 unless some server script is used to change it. Now, 10 is not a good value. For GGZ which tracks savegames and allows reloading it'd be best to have turn-by-turn saving or even to allow the /save command to be used with no parameters. It'd also be desirable for each savegame to overwrite the previous one I'd think, so the savegame was just called civgame.sav.gz rather than civgame-3500.sav.gz. I suppose a GGZ default rc file could be created and installed but there's no way to have the save name skip the year postfix. I'm fairly sure pubserver set the saveturns value to 1. It might have been changeable with ctrl access at that time however. In single-player games I really think 1 is a better value on modern computers. -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] saveturns on public games
I'm fairly sure pubserver set the saveturns value to 1. It might have been changeable with ctrl access at that time however. saveturns was set to 1. I seriously doubt that ctrl access could have changed that value since we needed all games for replays etc. M ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40139) Global observer does not work
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40139 Updated my patch that fixes the currently broken global observer in S2_2 and trunk. -- 待たせてごめん。 diff --git a/client/packhand.c b/client/packhand.c index e5bee13..e88381c 100644 --- a/client/packhand.c +++ b/client/packhand.c @@ -1896,8 +1896,6 @@ void handle_conn_info(struct packet_conn_info *pinfo) client_remove_cli_conn(pconn); pconn = NULL; } else { -/* Add or update the connection. Note the connection may refer to - * a player we don't know about yet; assume we will observe it. */ struct player *pplayer = valid_player_by_number(pinfo-player_num); if (!pconn) { @@ -1932,14 +1930,6 @@ void handle_conn_info(struct packet_conn_info *pinfo) pconn-access_level = pinfo-access_level; pconn-playing = pplayer; -if (NULL == pconn-playing !pconn-observer) { - pconn-observer = TRUE; /* illegal 4th case, assume global observer */ - - freelog(LOG_ERROR, handle_conn_info() - not playing, but not observer: %d %s, - pinfo-id, pinfo-username); -} - if (pinfo-id == client.conn.id) { client.conn.established = pconn-established; client.conn.observer = pconn-observer; diff --git a/server/connecthand.c b/server/connecthand.c index 7bd7090..2be6e7a 100644 --- a/server/connecthand.c +++ b/server/connecthand.c @@ -385,15 +385,6 @@ static void package_conn_info(struct connection *pconn, sz_strlcpy(packet-username, pconn-username); sz_strlcpy(packet-addr, pconn-addr); sz_strlcpy(packet-capability, pconn-capability); - -#if 0 - if (NULL == pconn-playing !pconn-observer) { -freelog(LOG_FATAL, package_conn_info() - not playing, but not observer: %d %s, -pconn-id, pconn-username); -assert((int)((char *)NULL)[0]); - } -#endif } /** @@ -454,7 +445,8 @@ struct player *find_uncontrolled_player(void) /** Setup pconn as a client connected to pplayer: - Updates pconn, pplayer-connections, pplayer-is_connected. + Updates pconn-playing, pplayer-connections, pplayer-is_connected + and pconn-observer. If pplayer is NULL, take the next available player that is not connected. Note observer connections do not count for is_connected. @@ -512,13 +504,19 @@ bool attach_connection_to_player(struct connection *pconn, /** Remove pconn as a client connected to pplayer: - Update pplayer-connections, pplayer-is_connected. + Updates pconn-playing, pconn-playing-connections, + pconn-playing-is_connected and pconn-observer. pconn remains a member of game.est_connections. + + The 'observing' parameter should be TRUE if 'pconn' is to become + a global observer, FALSE otherwise. **/ bool detach_connection_to_player(struct connection *pconn, bool observing) { + pconn-observer = observing; + if (NULL == pconn-playing) { return FALSE; /* no player is attached to this conn */ } @@ -526,7 +524,6 @@ bool detach_connection_to_player(struct connection *pconn, conn_list_unlink(pconn-playing-connections, pconn); pconn-playing-is_connected = FALSE; - pconn-observer = observing; /* If any other (non-observing) conn is attached to * this player, the player is still connected. */ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40312) are borders totally broken?
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40312 Seems when I found a city in trunk, the borders alternate between 0 and 1 tile in radius, just growing and then shrinking on successive turns. Extremely bizarre. -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#39582) 2.0.9: crash at end of turn
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39582 Christian Prochaska wrote: As I understand it, the read was successful, but while the received data is being handled, the connection gets lost, which gets detected when trying to send data to the server in request_new_unit_activity(). The write error then causes the client to switch to pre-game state, which causes the unit pointer to be freed. Switching to pre-game state in the middle of packet handling seems to be a very, very bad idea. I would think rather that the disconnect should be queued up to be handled once current handlers have left. Failing that, your patch to just ignore write errors might be the safest choice. -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40124) Server option to disable hack challenge
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40124 Seems reasonable. However the hack request packet needs to be discarded too. I also think the GGZ case should be explicit, rather than requiring GGZ to call --no-hack. -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#40309) What to do with the expanded terrain (was:Meta-ticket for 2.2 release)
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40309 2008/6/24 Madeline Book: Actually if you now try the new editor in S2_2 and trunk with the civ1 or civ2 rulesets you will find some very weird stuff in the terrain list. For example volcanoes and oceanic ridges that were never in civ1,2, and multiple duplicate terrain types. It's a big mess and the ruleset files should probably be reverted (but will the old versions still work with the new code?). All rulesets require all terrain types when used with this new code (William himself told so, I don't know all the details) At least all the numerous ocean types are required because code uses hardcoded terrain identifiers and game probably crashes if ruleset does not provide ocean type for certain identifier (and there can be only one identifier for each terrain). My plan is to restore code flexibility so that ruleset can decide how many, and which kind of terrains, it provides. This is not necessarily done by reverting earlier code changes (and I'm afraid it's not easy to revert such big patches after all the code alterations since original patches went in). - ML ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#12472) abusable bug: team research
URL: http://bugs.freeciv.org/Ticket/Display.html?id=12472 Good patch. This variant turns it into a function and sync's the whole research structure. I'll commit shortly. -jason Index: server/plrhand.c === --- server/plrhand.c (revision 14848) +++ server/plrhand.c (working copy) @@ -68,6 +68,19 @@ struct player *receiver); /** + Make sure all research of players on the team is in sync with this + player's. +**/ +static void sync_team_research(struct player *plr) +{ + players_iterate(pplayer) { +if (players_on_same_team(pplayer, plr) pplayer-is_alive) { + pplayer-research = plr-research; +} + } players_iterate_end; +} + +/** ... **/ void do_dipl_cost(struct player *pplayer, Tech_Type_id new_tech) @@ -543,6 +556,8 @@ plr-research.bulbs_researched = MAX(plr-research.bulbs_researched - total_bulbs_required(plr), 0); + sync_team_research(plr); + /* do all the updates needed after finding new tech */ found_new_tech(plr, plr-research.researching, TRUE, TRUE, A_NONE); } @@ -556,17 +571,10 @@ /* count our research contribution this turn */ plr-research.bulbs_last_turn += bulbs; + plr-research.bulbs_researched += bulbs; - players_iterate(pplayer) { -if (pplayer == plr) { - pplayer-research.bulbs_researched += bulbs; -} else if (pplayer-diplstates[plr-player_no].type == DS_TEAM -pplayer-is_alive) { - /* Share with union partner(s). We'll get in return later. */ - pplayer-research.bulbs_researched += bulbs; -} - } players_iterate_end; - + sync_team_research(plr); + excessive_bulbs = (plr-research.bulbs_researched - total_bulbs_required(plr)); @@ -576,6 +584,9 @@ update_tech(plr, 0); } } + + /* Sanity check */ + sync_team_research(plr); } /** @@ -697,6 +708,10 @@ plr-research.changed_from = -1; } plr-research.researching=tech; + + /* Update team research */ + sync_team_research(plr); + if (plr-research.bulbs_researched total_bulbs_required(plr)) { tech_researched(plr); } ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#38354) Autoconnect can't handle password
URL: http://bugs.freeciv.org/Ticket/Display.html?id=38354 Any idea if this is present on 2.1/2.2/trunk? How do I set up a server with authentication anyway? -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39131) Connection troubles
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39131 I frankly have no idea if this change is correct. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#40310) terrain code crash in trunk
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40310 2008/6/23 Jason Dorje Short: I was running a game through GGZ and the client crashed. The server kept running and I reconnected to it and it crashed again; this time I got a backtrace. Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 0xb73c2720 (LWP 20201)] terrain_name_translation (pterrain=0x0) at terrain.c:256 256 if (NULL == pterrain-name.translated) { I recently fixed one bug with same charasteristics. I don't see how this could be same problem, but next time you may want to check status of the tile send freeze functionality (I don't remember the variable name, but see latest changes in savegame.c to find out what I had to touch). - ML ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#40309) What to do with the expanded terrain
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40309 Marko Lindqvist wrote: URL: http://bugs.freeciv.org/Ticket/Display.html?id=40309 2008/6/24 Madeline Book: Actually if you now try the new editor in S2_2 and trunk with the civ1 or civ2 rulesets you will find some very weird stuff in the terrain list. For example volcanoes and oceanic ridges that were never in civ1,2, and multiple duplicate terrain types. It's a big mess and the ruleset files should probably be reverted (but will the old versions still work with the new code?). All rulesets require all terrain types when used with this new code (William himself told so, I don't know all the details) At least all the numerous ocean types are required because code uses hardcoded terrain identifiers and game probably crashes if ruleset does not provide ocean type for certain identifier (and there can be only one identifier for each terrain). Seems a bad idea after all the work done to remove such hard-coding. My plan is to restore code flexibility so that ruleset can decide how many, and which kind of terrains, it provides. This is not necessarily done by reverting earlier code changes (and I'm afraid it's not easy to revert such big patches after all the code alterations since original patches went in). Yay. -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39982) Wonder Report does not mark obsolete Wonders
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39982 [EMAIL PROTECTED] - Sat Mar 01 12:08:48 2008]: Looking at get_impr_name_ex(), it's fairly obvious why we never see (O) for wonders! Yes, it is because for wonders 'state' is always set to either the built string or the wonder string, even though it was set to obsolete in the block above. The attached trivial patch (against 2.1.3) reinstates (O) for wonders (and potentially (*) as well, although I don't know if that can happen in practice). Maybe for small wonders in some strange rulesets. Not as far as I can see anyway. Looking through svn (trying to see if it's the way it is for a good reason), I think the semantics of this part of the function last significantly changed in r9379, PR#11477, 2004-12-19. I think it was dodgy before that, too, but in a different way. You are right that r9369 changed the if-else block to two if blocks (with the second clobbering the results of the first for wonders). This function still seems a bit fishy to me. It looks as if for non-wonders, my_snprintf() could end up getting called with state==NULL (with or without my patch), which seems wrong. I don't know if this is a problem in practice; I haven't investigated further. Actually no, there is a test for state != NULL (with the != NULL implicit) in which case my_snprintf does not get called and the function just returns the result of improvement_name_translation. (Also, in the specific case of wonders, the function could in principle say that a wonder was obsolete even if pcity==NULL, because wonder obsoletion is global and known to all; but the current implementation only attempts to do this in the context of a city/player. Again, dunno if this is a real problem; I didn't find anywhere obvious where this function was called with pcity==NULL.) I did not find any obvious places where this would be called with a NULL pcity either. Probably because it would be hard to have a building without a city. ;) Anyway, I fixed up your patch according to http://freeciv.wikia.com/wiki/How_to_Contribute and also ported the changes to a version for S2_2 and trunk. If nobody cries, I'll commit this in a few days. -- 長い間でしたね。 diff --git a/common/city.c b/common/city.c index 3ad55ea..435bd78 100644 --- a/common/city.c +++ b/common/city.c @@ -345,6 +345,13 @@ const char *get_impr_name_ex(const struct city *pcity, Impr_type_id id) static char buffer[256]; const char *state = NULL; + if (is_great_wonder(id)) { +if (great_wonder_was_built(id)) { + state = Q_(?built:B); +} else { + state = Q_(?wonder:w); +} + } if (pcity) { struct player *pplayer = city_owner(pcity); @@ -355,13 +362,6 @@ const char *get_impr_name_ex(const struct city *pcity, Impr_type_id id) state = Q_(?redundant:*); } } - if (is_great_wonder(id)) { -if (great_wonder_was_built(id)) { - state = Q_(?built:B); -} else { - state = Q_(?wonder:w); -} - } if (state) { my_snprintf(buffer, sizeof(buffer), %s(%s), diff --git a/common/city.c b/common/city.c index a1e78bb..f9c1efe 100644 --- a/common/city.c +++ b/common/city.c @@ -288,6 +288,13 @@ const char *city_improvement_name_translation(const struct city *pcity, static char buffer[256]; const char *state = NULL; + if (is_great_wonder(pimprove)) { +if (great_wonder_was_built(pimprove)) { + state = Q_(?built:B); +} else { + state = Q_(?wonder:w); +} + } if (pcity) { struct player *pplayer = city_owner(pcity); @@ -298,13 +305,6 @@ const char *city_improvement_name_translation(const struct city *pcity, state = Q_(?redundant:*); } } - if (is_great_wonder(pimprove)) { -if (great_wonder_was_built(pimprove)) { - state = Q_(?built:B); -} else { - state = Q_(?wonder:w); -} - } if (state) { my_snprintf(buffer, sizeof(buffer), %s(%s), ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39503) /cut and 'Unassigned' user name
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39503 Patch for S2_0 Index: server/stdinhand.c === --- server/stdinhand.c (révision 14852) +++ server/stdinhand.c (copie de travail) @@ -3719,6 +3719,7 @@ enum m_pre_result match_result; struct connection *ptarget; struct player *pplayer; + bool was_connected; ptarget = find_conn_by_user_prefix(name, match_result); @@ -3730,6 +3731,7 @@ } pplayer = ptarget-player; + was_connected = pplayer ? pplayer-is_connected : FALSE; cmd_reply(CMD_CUT, caller, C_DISCONNECTED, _(Cutting connection %s.), ptarget-username); @@ -3737,7 +3739,7 @@ close_connection(ptarget); /* if we cut the connection, unassign the login name */ - if (pplayer) { + if (pplayer was_connected !pplayer-is_connected) { sz_strlcpy(pplayer-username, ANON_USER_NAME); } return TRUE; ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40313) Support for 7z savegames
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40313 Idea: How about adding support for the 7z format[1] for archiving saved games? 7z is very effective (in my experience) when archiving similar files together, so it would be a great fit with Freeciv saves. The idea of course is to continuously append the last save to a single .7z for one full game. Pros: * Save disk space * Relieve filesystem clutter Questionmarks: * Processor overhead when appending new savs? * Integration with UI? * Lib availability in distros? [1] http://www.7-zip.org/7z.html -- Using Opera's revolutionary e-mail client: http://www.opera.com/mail/ ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39745) [Bug] 2.0 removing player should reset his team
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39745 Patch attached. The team is reset in the following cases: - A player get disconnected in pregame. - A player is removed via the /remove command. Index: common/game.c === --- common/game.c (révision 14852) +++ common/game.c (copie de travail) @@ -501,6 +501,7 @@ game.players[game.nplayers].is_connected = FALSE; game.players[game.nplayers].was_created = FALSE; game.players[game.nplayers].ai.control = FALSE; + game.players[game.nplayers].team = TEAM_NONE; sz_strlcpy(game.players[game.nplayers].name, ANON_PLAYER_NAME); sz_strlcpy(game.players[game.nplayers].username, ANON_USER_NAME); } ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39745) [Bug] 2.0 removing player should reset his team
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39745 Kinda strange, if you remove then create a player the team gets reset but if you disconnect then a new player connects, it does not get reset. But I wonder if this bug could hit other fields in the player structure too. What about re-initting the whole player? If so this could possibly apply to other branches too (team issue should only affect 2.0 I believe). -jason Index: common/game.c === --- common/game.c (revision 14856) +++ common/game.c (working copy) @@ -498,11 +498,7 @@ /* a bit of cleanup to keep connections sane */ conn_list_init(game.players[game.nplayers].connections); - game.players[game.nplayers].is_connected = FALSE; - game.players[game.nplayers].was_created = FALSE; - game.players[game.nplayers].ai.control = FALSE; - sz_strlcpy(game.players[game.nplayers].name, ANON_PLAYER_NAME); - sz_strlcpy(game.players[game.nplayers].username, ANON_USER_NAME); + player_init(game.players[game.nplayers]); } /** ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40291) [Patch] Show total buy cost in city list.
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40291 Committed to S2_1 (r14855), S2_2 (r14857) and trunk (r14859). -- 見えなくなかった ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40246) [patch] Fix visual corruption in flag images
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40246 Committed to S2_1 (r14856), S2_2 (r14858) and trunk (r14860). -- ご馳走様でした ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39745) [Bug] 2.0 removing player should reset his team
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39745 Seems this exact fix was already done for 2.1 and 2.2. Should work fine for 2.0 also. ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40314) lua error in error handling
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40314 lua error: error in error handling This appears on my client console when playing a game (through ggz). -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#40317) ggz savegame support
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40317 GGZ savegame support is incomplete but this patch adds it. Basically there's two things to do: report games that we save to ggz, and handle ggz savedgame events that tell us to load games. Along the way I gave each game a unique directory within the ggz freeciv directory. This follows the serverid system as I remember if from pubserver. The serverid is also saved in the savegame. The portability of mkdtemp is a concern (a replacement would be easily written). It also lacks some documentation (general explanations). -jason Index: configure.ac === --- configure.ac (revision 14862) +++ configure.ac (working copy) @@ -532,6 +532,9 @@ else AC_GGZ_CHECK fi +if test $ggz_server = yes ; then + AC_CHECK_FUNCS([chdir mkdtemp]) +fi AC_SUBST(gui_sources) AC_SUBST(CLIENT_CFLAGS) Index: server/srv_main.c === --- server/srv_main.c (revision 14862) +++ server/srv_main.c (working copy) @@ -973,6 +973,8 @@ freelog(LOG_VERBOSE, Save time: %g seconds (%g apparent), read_timer_seconds_free(timer_cpu), read_timer_seconds_free(timer_user)); + + ggz_game_saved(filename); } /** Index: server/ggzserver.c === --- server/ggzserver.c (revision 14862) +++ server/ggzserver.c (working copy) @@ -17,6 +17,8 @@ #ifdef GGZ_SERVER +#include unistd.h + #include ggzdmod.h #include fciconv.h @@ -31,6 +33,8 @@ #include ggzserver.h #include score.h #include sernet.h +#include srv_main.h +#include stdinhand.h bool with_ggz = FALSE; @@ -173,6 +177,24 @@ } / + When a saved game is to be loaded, this event is activateed. +/ +static void handle_ggz_savedgame(GGZdMod *ggz, GGZdModEvent event, + const void *data) +{ + if (!load_command(NULL, data, FALSE)) { +/* no error handling? */ +server_quit(); + } + + if (chdir(srvarg.serverid) 0) { +fc_fprintf(stderr, _(Unable to change into temporary server + directory %s.\n), srvarg.serverid); +server_quit(); + } +} + +/ Connect to the GGZ server, if GGZ is being used. / void ggz_initialize(void) @@ -199,6 +221,12 @@ handle_ggz_seat_event); ggzdmod_set_handler(ggzdmod, GGZDMOD_EVENT_SPECTATOR_JOIN, handle_ggz_spectator_seat_event); +ggzdmod_set_handler(ggzdmod, GGZDMOD_EVENT_SPECTATOR_LEAVE, + handle_ggz_spectator_seat_event); +ggzdmod_set_handler(ggzdmod, GGZDMOD_EVENT_SPECTATOR_SEAT, + handle_ggz_spectator_seat_event); +ggzdmod_set_handler(ggzdmod, GGZDMOD_EVENT_SAVEDGAME, + handle_ggz_savedgame); if (ggzdmod_connect(ggzdmod) 0) { exit(EXIT_FAILURE); } @@ -208,6 +236,19 @@ in ggz mode!\n)); exit(EXIT_FAILURE); } + +strcpy(srvarg.serverid, ggz-civ-XX); +if (!mkdtemp(srvarg.serverid)) { + fc_fprintf(stderr, + _(Unable to make temporary directory for GGZ game.\n)); + exit(EXIT_FAILURE); +} + +if (chdir(srvarg.serverid) 0) { + fc_fprintf(stderr, _(Unable to change into temporary server + directory %s.\n), srvarg.serverid); + exit(EXIT_FAILURE); +} } } @@ -332,4 +373,13 @@ num_victors = 0; /* In case there's another game. */ } +/ + Reports a savegame file to the GGZ server. In theory GGZ will allow + reloading from a file later. +/ +void ggz_game_saved(const char *filename) +{ + ggzdmod_report_savegame(ggzdmod, filename); +} + #endif Index: server/ggzserver.h === --- server/ggzserver.h (revision 14862) +++ server/ggzserver.h (working copy) @@ -28,12 +28,15 @@ void ggz_report_victor(const struct player *winner); void ggz_report_victory(void); +void ggz_game_saved(const char *filename); + #else # define with_ggz FALSE # define ggz_initialize() (void)0 # define ggz_report_victor(pplayer) (void)0 # define ggz_report_victory() (void)0 +# define ggz_game_saved() (void)0 #endif Index: server/stdinhand.c === --- server/stdinhand.c (revision 14863) +++ server/stdinhand.c (working copy) @@ -3301,7 +3301,7 @@ legitimate but has inconsistencies) and would lead to a broken server afterwards. **/ -bool
[Freeciv-Dev] (PR#40315) gtk client: unplayabe resizing of panel
URL: http://bugs.freeciv.org/Ticket/Display.html?id=40315 Every time the text on the left panel (generally the terrain text) changes the panel resizes itself. This leads to a redraw of the main screen. The end effect is to basically make the game unplayable. The left panel should never automatically shrink itself. It can automatically enlarge itself if necessary. There should be a GTK option for this. -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
[Freeciv-Dev] (PR#39358) vote in pregame
URL: http://bugs.freeciv.org/Ticket/Display.html?id=39358 A 5-minute fix for this is to stick the votes into the player structure. This is easy enough but as the vote records are still in an array inside the vote structures themselves player reordering will change everyone's vote around. Which basically means voting is useless since anyone leaving the game will change all votes around at complete random. This is actually a rather serious bug. The only solutions are to disable the vote code or to reset all votes when a player leaves. -jason ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev
Re: [Freeciv-Dev] (PR#38354) Autoconnect can't handle password
URL: http://bugs.freeciv.org/Ticket/Display.html?id=38354 On Mon, Jun 23, 2008 at 03:26:49PM -0700, Jason Short wrote: URL: http://bugs.freeciv.org/Ticket/Display.html?id=38354 Any idea if this is present on 2.1/2.2/trunk? How do I set up a server with authentication anyway? (...mostly from memory...) used to be just ./autogen.sh --enable-auth=yes or something like that and then pass -a or --auth to server (there's some new code I don't recognize in auth.c regarding server authentication with configuration from file) unfortunately you currently have to have a mysql server running with the correct set of tables to make it work. attached is my original text database. this was back before user_db.c became auth.c. A little tweaking to the auth.c functions and you can dispense with the mysql dependency. M toy_external_db.tar.gz Description: GNU Zip compressed data ___ Freeciv-dev mailing list Freeciv-dev@gna.org https://mail.gna.org/listinfo/freeciv-dev