Complete.Org: Mailing Lists: Archives: freeciv-dev: March 2006:
[Freeciv-Dev] (PR#15937) Editor: is_edit_mode client/server mismatch cau
Home

[Freeciv-Dev] (PR#15937) Editor: is_edit_mode client/server mismatch cau

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
Subject: [Freeciv-Dev] (PR#15937) Editor: is_edit_mode client/server mismatch causes infinite loop
From: "Mike Kaufman" <kaufman@xxxxxxxxxxxxxxxxxxxxxx>
Date: Thu, 16 Mar 2006 15:25:56 -0800
Reply-to: bugs@xxxxxxxxxxx

<URL: http://bugs.freeciv.org/Ticket/Display.html?id=15937 >

if you start a standalone server, connect a client to it, switch to editing
mode, then disconnect and reconnect to the server without turning off edit
mode first, the client will go into an infinite loop (and probably cause
the server to become unusable as well.

The reason this happens is that the game info packet to the client calls
update_menus(). update_menus() calls
menus_set_active("<main>/_Editor/Editing Mode", game.info.is_edit_mode);

which if the checkitem changes, sends a toggle callback to
key_editor_toggle(), which sends a packet to the server, which starts the
whole thing again.

The semi-obvious solution is to block the callback to the menucheckitem.
My gtk-fu is not so good though and this try:

    g_signal_handlers_block_by_func(gtk_item_factory_get_item(item_factory,
"<main>/_Editor/Editing Mode"), G_CALLBACK(editor_menu_callback), NULL);
    menus_set_active("<main>/_Editor/Editing Mode",
game.info.is_edit_mode);
    g_signal_handlers_unblock_by_func(gtk_item_factory_get_item(item_factory,
"<main>/_Editor/Editing Mode"), G_CALLBACK(editor_menu_callback), NULL);

didn't work at all. Need. Help. Vasc.

-mike





[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#15937) Editor: is_edit_mode client/server mismatch causes infinite loop, Mike Kaufman <=