Update of /cvsroot/netrek/client/netrekxp/src
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26036/src
Modified Files:
mswindow.c parsemeta.c
Log Message:
Fixed regression that was causing UDP metacache to not load.
Reversed order of load UDP metacache and send request, so that cache is loaded
first.
Removed redundant metasort from user request for metaserver refresh, if a
metaserver
packet is received, metasort called already.
Added check if message window is totally clipped instead of just partially
clipped -
if totally clipped, window behaves as an unmapped window.
If server list has multiple servers with same IP, metaping will now display
correct
for all servers, as they will all use the same ping response packets.
Index: mswindow.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/mswindow.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- mswindow.c 13 Jan 2007 02:53:27 -0000 1.41
+++ mswindow.c 23 Jan 2007 11:12:04 -0000 1.42
@@ -4540,6 +4540,7 @@
int HiddenLines;
int y;
int clipped = 0;
+ int totally_clipped = 0;
RECT r;
WINDOWPLACEMENT loc;
FNHEADER_VOID;
@@ -4562,14 +4563,19 @@
// For mapped windows, do full redraw if more than half of window content
// is changed, or if part of window is outside viewable area, because
// ScrollDC fails to properly scroll text in such cases
- if (W_IsMapped(window))
+ if (W_IsMapped (window) && W_IsMapped (baseWin))
{
GetWindowPlacement (win->hwnd, &loc);
GetWindowRect (((Window *) baseWin)->hwnd, &r);
+ // At least partially clipped
if (loc.rcNormalPosition.left < r.left || loc.rcNormalPosition.right >
r.right
|| loc.rcNormalPosition.top < r.top || loc.rcNormalPosition.bottom >
r.bottom)
clipped = 1;
- if (win->AddedStrings > (win->TextHeight / 2) || clipped)
+ // Totally clipped, treat like unmapped window
+ if (loc.rcNormalPosition.right < r.left || loc.rcNormalPosition.left >
r.right
+ || loc.rcNormalPosition.bottom < r.top || loc.rcNormalPosition.top >
r.bottom)
+ totally_clipped = 1;
+ if (win->AddedStrings > (win->TextHeight / 2) || (clipped &&
!totally_clipped))
{
InvalidateRect (win->hwnd, NULL, FALSE);
UpdateWindow (win->hwnd); //Generates paint msg, which calls
RedrawScrolling
Index: parsemeta.c
===================================================================
RCS file: /cvsroot/netrek/client/netrekxp/src/parsemeta.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- parsemeta.c 21 Dec 2006 13:48:27 -0000 1.26
+++ parsemeta.c 23 Jan 2007 11:12:05 -0000 1.27
@@ -881,13 +881,13 @@
num_servers = 0;
return;
}
-
- cache = fopen(cacheFileName, "r");
- if (cache == NULL)
- {
+ if (!findfile (metaUDPCache, cacheFileName)
+ || !(cache = fopen (cacheFileName, "r")))
+ {
num_servers = 0;
return;
}
+
/* Obtain file size. */
fseek (cache , 0 , SEEK_END);
lSize = ftell (cache);
@@ -1281,8 +1281,8 @@
switch (type)
{
case 1:
- ReadMetasSend();
LoadMetasCache();
+ ReadMetasSend();
if (num_servers == 0) ReadMetasRecv(-1);
if (num_servers != 0) {
/* Allocate 4 spots for header/refresh/quit/link */
@@ -1687,7 +1687,6 @@
{
W_WriteText(metaWin, 0, metaHeight-3, W_Red, "Asking for refresh from
metaservers and nearby servers", 54, 0);
ReadMetasSend();
- metasort();
}
else if (data->y == (metaHeight-2)) /* Quit selected */
{
@@ -2066,13 +2065,13 @@
// Receive reply
if (!metaPing_recvEchoReply(rawSocket, &saSrc,
&rtt, &nSeq))
{
- //printf("\nReply from: %s: rtt=%ldms
seq=%d", inet_ntoa(saSrc.sin_addr), rtt, nSeq);
+ //LineToConsole("\nReply from: %s:
rtt=%ldms seq=%d", inet_ntoa(saSrc.sin_addr), rtt, nSeq);
for (i = 0; i < num_servers; ++i)
+ {
+ // Support multiple servers
with same IP - update every server entry with latest ping time
if (saSrc.sin_addr.s_addr ==
serverlist[i].ip_addr)
- {
serverlist[i].pkt_rtt[nSeq % RTT_AVG_BUFLEN] = rtt;
- break;
- }
+ }
}
}
}
_______________________________________________
netrek-cvs mailing list
[email protected]
http://mailman.us.netrek.org/mailman/listinfo/netrek-cvs