hack to make GrandPrixLegens and N2002 work
Christoph Frick
frick at SC-Networks.de
Fri Oct 25 03:33:41 CDT 2002
Hi!
This is an more or less a straight forward hack to make the game grand prix
legends work. It will also effect other games from Papyrus.
The game has two problems:
1) It binds more than one time to the same port without doing an SO_REUSEADDR.
Acording to UNP it is no big deal to do so - so i just force it.
2) The game sets SO_DONTROUTE on the socket. This works in linux and prevent
the user of connecting to games in other networks. Either windows ignores
the SO_DONTROUTE or it is not set in native windows or it is ignored. I
dont have any opportunity to find out.
Another thing is a registry key the game expexcts:
[System\\CurrentControlSet\\Services\\Class\\NetTrans\\0000] 1027876728
"IPAddress"="192.168.66.6"
It runs with this setting (also N2002); maybe the dontroute problem could also
be solved, if the remaining keys to properly define the TCP/IP config for a
NIC in windows are set?!
So my plea: Could some windows network/socket guru point me in a direction to
do further investigations?
BTW: i can not imagine this "patch" makes it to the tree - but just to have it
said: The patch is under BSD License.
CU!
-------------- next part --------------
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-devel
mailing list