Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv3430/src

Modified Files:
	local.c newwin.c socket.c 
Log Message:
Fixed longstanding bug with UDP where display was redrawn too frequently (once for udp redraw,
and again anytime a TCP packet was sent, like with warning messages).
Observer support for show speed on tactical

Index: newwin.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/newwin.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- newwin.c	22 May 2006 08:27:53 -0000	1.27
+++ newwin.c	22 May 2006 22:05:14 -0000	1.28
@@ -1399,7 +1399,6 @@
     {
         while (!W_EventsPending ())
         {
-            HANDLE handles[FD_SETSIZE];
             time_t elapsed;
             fd_set rfds;
             struct timeval tv;
@@ -1415,6 +1414,7 @@
             FD_SET (sock, &rfds);
             if (udpSock >= 0)
                 FD_SET (udpSock, &rfds);
+            // HANDLE handles[FD_SETSIZE];
            // WaitForMultipleObjects(32, handles, TRUE, INFINITE);
             select (32, &rfds, 0, 0, &tv);      /* hmm, 32 might be too small */
 

Index: local.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/local.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- local.c	22 May 2006 08:27:53 -0000	1.26
+++ local.c	22 May 2006 22:05:14 -0000	1.27
@@ -1135,7 +1135,7 @@
                     buflen = 1;
                 }
 
-                if (j == me)
+                if (myPlayer(j) || isObsLockPlayer(j))
                 {
                     switch (me->p_flags & (PFGREEN | PFYELLOW | PFRED))
                     {
@@ -1422,7 +1422,7 @@
                         }
                         ph_counter++;
                         ph_col += (100/j->p_ship.s_phaserfuse/updatesPerSec);
-                        if (ph_counter == (updatesPerSec - 1))
+                        if (ph_counter == (updatesPerSec - 1)*j->p_ship.s_phaserfuse/10)
                         {
                             ph_counter = 0;
                             ph_col = 0;

Index: socket.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/socket.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- socket.c	7 May 2006 16:59:27 -0000	1.5
+++ socket.c	22 May 2006 22:05:14 -0000	1.6
@@ -738,7 +738,11 @@
         chan = sock;
         if (commMode == COMM_TCP)
             drop_flag = 0;      /* just in case */
-        retval += doRead (sock);
+        /* Bug fix for unnecessary redraws with UDP on - reported by TP */
+        if (commMode == COMM_UDP)
+            doRead (sock);
+        else
+            retval += doRead (sock);
     }
 
     dotimers ();