Networkpatch for Grand Prix Legends, Nascar 2002 and maybe other
Papyrus games
Christoph Frick
frick at SC-Networks.de
Mon Dec 2 12:09:31 CST 2002
hi!
i asked in the devel list two times for help about this issue - but no one was
able to push me in the right direction. Maybe submitting it as patch cause
some reactions :)
The patch make the games Grand Prix Legends and Nascar 2002 work - and
Neverwinter Nights still works with it.
CU!
ChangeLog:
* dlls/winsock/socket.c:
Christoph Frick <frick at sc-networks.de>
Force (WS_)SO_REUSEADDR before binding to a socket; ignore
(WS_)SO_DONTROUTE; Network games in Grand Prix Legends and Nascar 2002
are possible now.
Index: socket.c
===================================================================
RCS file: /home/wine/wine/dlls/winsock/socket.c,v
retrieving revision 1.109
diff -u -r1.109 socket.c
--- socket.c 17 Oct 2002 16:43:43 -0000 1.109
+++ socket.c 25 Oct 2002 08:00:48 -0000
@@ -1451,6 +1451,7 @@
{
int fd = _get_sock_fd(s);
int res;
+ int on = 1;
TRACE("socket %04x, ptr %p, length %d\n", s, name, namelen);
#if DEBUG_SOCKADDR
@@ -1476,6 +1477,11 @@
}
else
{
+ /* The game GrandPrixLegends binds more than one time, but does
+ * not do a SO_REUSEADDR - Stevens says this is ok */
+ FIXME( "Setting WS_SO_REUSEADDR on socket before we binding it\n");
+ WS_setsockopt( s, WS_SOL_SOCKET, WS_SO_REUSEADDR, (char*)&on, sizeof(on) );
+
if (bind(fd, uaddr, uaddrlen) < 0)
{
int loc_errno = errno;
@@ -2665,6 +2671,17 @@
TRACE("setting global SO_OPENTYPE to 0x%x\n", *(int *)optval );
return 0;
}
+
+ /* For some reason the game GrandPrixLegends does set SO_DONTROUTE on its
+ * socket. This will either not happen under windows or it is ignored in
+ * windows (but it works in linux and therefor prevents the game to find
+ * games outsite the current network) */
+ if ( level==WS_SOL_SOCKET && optname==WS_SO_DONTROUTE )
+ {
+ FIXME("Does windows ignore SO_DONTROUTE?\n");
+ return 0;
+ }
+
fd = _get_sock_fd(s);
if (fd != -1)
More information about the wine-patches
mailing list