[Freeciv-Dev] (PR#15260) GTK2: interface quirks being observer

2007-10-21 Thread Daniel Markstedt

URL: http://bugs.freeciv.org/Ticket/Display.html?id=15260 

 [EMAIL PROTECTED] - Mon Sep 24 17:47:19 2007]:
 
 On 10/09/2007, Marko Lindqvist  wrote:
  On 19/07/07, Ulrik Sverdrup  wrote:
  
   Bug [for global observers, not attached to player] :
   - 'Wonders of the World' and 'Top Five Cities' should be
   available but doesn't currently have any effect when selected.
  
   QUESTION: This patch allows even detached connections to send report
   packets and get the reports back. Is this a fundamental problem? If
   observers are not allowed at all in a game, they could still get this
   information.
 
   Modified your patches to fix that problem.
 
  Since Ulrik is not around, and this is S2_1 bug, I'm going to commit
this.
 
 
  - ML
 
 
 

Did you commit this Marko? If yes, why is the ticket still open?

 ~Daniel


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


Re: [Freeciv-Dev] (PR#15260) GTK2: interface quirks being observer

2007-09-24 Thread Marko Lindqvist

URL: http://bugs.freeciv.org/Ticket/Display.html?id=15260 

On 10/09/2007, Marko Lindqvist  wrote:
 On 19/07/07, Ulrik Sverdrup  wrote:
 
  Bug [for global observers, not attached to player] :
  - 'Wonders of the World' and 'Top Five Cities' should be
  available but doesn't currently have any effect when selected.
 
  QUESTION: This patch allows even detached connections to send report
  packets and get the reports back. Is this a fundamental problem? If
  observers are not allowed at all in a game, they could still get this
  information.

  Modified your patches to fix that problem.

 Since Ulrik is not around, and this is S2_1 bug, I'm going to commit this.


 - ML



___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#15260) GTK2: interface quirks being observer

2007-07-12 Thread Ulrik Sverdrup

URL: http://bugs.freeciv.org/Ticket/Display.html?id=15260 

Committed to trunk as r13100 and S2_1 as r13101.

gtk2 client: Deactivate irrelevant reports for observers. Make sure that
some shortcut keys (F1..F11 and shift+arrows) work for observers. Some
reindentation in the touched function. Based on patches by
[EMAIL PROTECTED]

server: Send an end_phase packet to observers at end of turn, otherwise
they don't get any and the messages pane fills up. Patch by Jason Dorje
Short

---

Only one issue in this ticket now remains:
- 'Wonders of the World' and 'Top Five Cities' should be
available but doesn't currently have any effect when selected.

___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] (PR#15260) GTK2: interface quirks being observer

2007-07-10 Thread Ulrik Sverdrup

URL: http://bugs.freeciv.org/Ticket/Display.html?id=15260 

Consolidated the above posted patches, ready for commit to trunk and S2_1
disable_reports.diff
end_phase.diff
observer_keys.diff

Changed the observer keys handling a bit: Now the shift-arrow keys to
scroll the mapview work as well, just like center on capital (not when
being global observer, then the message Oh my, You seem to have no
capital is generated, which seems harmless.

The logic was also simplified in key handling: return if observer after
having handled shift-key events. Removal of the large else clause caused
a lot of reindenting in the patch, but no changes.


Index: server/srv_main.c
===
--- server/srv_main.c	(revision 13088)
+++ server/srv_main.c	(arbetskopia)
@@ -759,6 +759,14 @@
 
   freelog(LOG_DEBUG, Endturn);
 
+  /* Hack: because observer players never get an end-phase packet we send
+   * one here.  It would be better perhaps to have a full end-turn packet. */
+  conn_list_iterate(game.est_connections, pconn) {
+if (!pconn-player) {
+  send_packet_end_phase(pconn);
+}
+  } conn_list_iterate_end;
+
   map_calculate_borders();
 
   /* Output some AI measurement information */
Index: client/gui-gtk-2.0/gui_main.c
===
--- client/gui-gtk-2.0/gui_main.c	(revision 13088)
+++ client/gui-gtk-2.0/gui_main.c	(arbetskopia)
@@ -455,89 +455,93 @@
 return FALSE;
   }
 
-  if (!client_is_observer()) { /* FIXME: is this check right? */
-if ((ev-state  GDK_SHIFT_MASK)) {
-  switch (ev-keyval) {
-	case GDK_Left:
-	  scroll_mapview(DIR8_WEST);
-	  return TRUE;
 
-	case GDK_Right:
-	  scroll_mapview(DIR8_EAST);
-	  return TRUE;
+  if ((ev-state  GDK_SHIFT_MASK)) {
+switch (ev-keyval) {
+case GDK_Left:
+  scroll_mapview(DIR8_WEST);
+  return TRUE;
 
-	case GDK_Up:
-	  scroll_mapview(DIR8_NORTH);
-	  return TRUE;
+case GDK_Right:
+  scroll_mapview(DIR8_EAST);
+  return TRUE;
 
-	case GDK_Down:
-	  scroll_mapview(DIR8_SOUTH);
-	  return TRUE;
+case GDK_Up:
+  scroll_mapview(DIR8_NORTH);
+  return TRUE;
 
-	case GDK_Home:
-	  key_center_capital();
-	  return TRUE;
+case GDK_Down:
+  scroll_mapview(DIR8_SOUTH);
+  return TRUE;
 
-	case GDK_Return:
-	case GDK_KP_Enter:
-	  key_end_turn();
-	  return TRUE;
+case GDK_Home:
+  key_center_capital();
+  return TRUE;
 
-case GDK_Page_Up:
-  g_signal_emit_by_name(main_message_area, move_cursor,
-			  GTK_MOVEMENT_PAGES, -1, FALSE);
-  return TRUE;
+case GDK_Return:
+case GDK_KP_Enter:
+  key_end_turn();
+  return TRUE;
 
-case GDK_Page_Down:
-  g_signal_emit_by_name(main_message_area, move_cursor,
-			  GTK_MOVEMENT_PAGES, 1, FALSE);
-  return TRUE;
-  
-	default:
-	  break;
-  }
+case GDK_Page_Up:
+  g_signal_emit_by_name(main_message_area, move_cursor,
+	  GTK_MOVEMENT_PAGES, -1, FALSE);
+  return TRUE;
+
+case GDK_Page_Down:
+  g_signal_emit_by_name(main_message_area, move_cursor,
+	  GTK_MOVEMENT_PAGES, 1, FALSE);
+  return TRUE;
+
+default:
+  break;
 }
+  }
+  /* Return here if observer */
+  if (client_is_observer()) {
+return FALSE;
+  }
 
-if (GTK_WIDGET_HAS_FOCUS(map_canvas)) {
-  switch (ev-keyval) {
-case GDK_Up:
-  key_unit_move(DIR8_NORTH);
-  return TRUE;
+  if (GTK_WIDGET_HAS_FOCUS(map_canvas)) {
+switch (ev-keyval) {
+case GDK_Up:
+  key_unit_move(DIR8_NORTH);
+  return TRUE;
 
-case GDK_Page_Up:
-  key_unit_move(DIR8_NORTHEAST);
-  return TRUE;
+case GDK_Page_Up:
+  key_unit_move(DIR8_NORTHEAST);
+  return TRUE;
 
-case GDK_Right:
-  key_unit_move(DIR8_EAST);
-  return TRUE;
+case GDK_Right:
+  key_unit_move(DIR8_EAST);
+  return TRUE;
 
-case GDK_Page_Down:
-  key_unit_move(DIR8_SOUTHEAST);
-  return TRUE;
+case GDK_Page_Down:
+  key_unit_move(DIR8_SOUTHEAST);
+  return TRUE;
 
-case GDK_Down:
-  key_unit_move(DIR8_SOUTH);
-  return TRUE;
+case GDK_Down:
+  key_unit_move(DIR8_SOUTH);
+  return TRUE;
 
-case GDK_End:
-  key_unit_move(DIR8_SOUTHWEST);
-  return TRUE;
-  
-case GDK_Left:
-  key_unit_move(DIR8_WEST);
-  return TRUE;
+case GDK_End:
+  key_unit_move(DIR8_SOUTHWEST);
+  return TRUE;
+  
+case GDK_Left:
+  key_unit_move(DIR8_WEST);
+  return TRUE;
 
-case GDK_Home:		
-  key_unit_move(DIR8_NORTHWEST);
-	  return TRUE;
+case GDK_Home:		
+  key_unit_move(DIR8_NORTHWEST);
+  return TRUE;
 
-	default:
-	  break;
-  }
+default:
+  break;
 }
+  }
 
-assert(MAX_NUM_BATTLEGROUPS == 4);
+