WineHQ
Wine Forums

Board index » WineHQ » Wine Help




 Page 1 of 2 [ 33 posts ] Go to page 1, 2  Next



 
Author Message
 Post Posted: Mon Feb 23, 2009 8:03 pm 
Offline
Level 5
Level 5

Joined: Mon Jul 28, 2008 6:44 pm
Posts: 365
Location: Coimbra, Portugal
Hello to all

I've been playing Command and Conquer: Red Alert 3 (LEGAL version of the game) with wine and it has been working very well.

However, I decided to try and play LAN (linux-to-linux) and did not manage to do it. There was a time where I could see my name twice on the list (should see once) plus my other pc's name. So this meant that:

PC A

Sees PC A TWICE and PC B ONCE

PC B

Sees PC B TWICE and PC A ONCE

Whenever I created a game and tried to connect to it, it said 'connection tiemd out'.


Later on, I tried to play via Hamachi with a friend of mine (linux-to-windows) and stumbled upon one more problem. One of the problems seems to be in the /etc/hosts file. Whenever I set my IP (in /etc/hosts) to hamachi's one, I can see him but he can't see me. The opposite happens if I set my IP to 127.0.0.1 (localhost) (that is, he sees me, I don't see him).

So does anybody know where the problem is? Is there a fix for this?

One thing I noticed (probably doesn't matter) was this message (not Wine's message, as I'm running WINEDEBUG=-all):
Quote:
WARNING: Trying to create a socket of type SOCK_RAW, this will fail unless you have special permissions.
WARNING: Trying to create a socket of type SOCK_RAW, this will fail unless you have special permissions.
WARNING: Trying to create a socket of type SOCK_RAW, this will fail unless you have special permissions.


Maybe it means something?

Thanks,

João


Last edited by jorl17 on Tue Jun 09, 2009 8:25 am, edited 1 time in total.

Top 
 Post Posted: Tue Feb 24, 2009 1:32 am 
Offline
Wine Developer
Wine Developer

Joined: Fri Feb 22, 2008 8:19 pm
Posts: 2383
On Mon, Feb 23, 2009 at 7:03 PM, jorl17 <wineforum-user@winehq.org> wrote:
Quote:
Hello to all

I've been playing Command and Conquer: Red Alert 3 (LEGAL version of the game) with wine and it has been working very well.

However, I decided to try and play LAN (linux-to-linux) and did not manage to do it. There was a time where I could see my name twice on the list (should see once) plus my other pc's name. So this meant that:

PC A

Sees PC A TWICE and PC B ONCE

PC B

Sees PC B TWICE and PC A ONCE

Whenever I created a game and tried to connect to it, it said 'connection tiemd out'.


Later on, I tried to play via Hamachi with a friend of mine (linux-to-windows) and stumbled upon one more problem. One of the problems seems to be in the /etc/hosts file. Whenever I set my IP (in /etc/hosts) to hamachi's one, I can see him but he can't see me. The opposite happens if I set my IP to 127.0.0.1 (localhost) (that is, he sees me, I don't see him).

So does anybody know where the problem is? Is there a fix for this?

http://wiki.winehq.org/FAQ#head-0344b43 ... 6855283afd

Quote:
One thing I noticed (probably doesn't matter) was this message (not Wine's message, as I'm running WINEDEBUG=-all):

Quote:
WARNING: Trying to create a socket of type SOCK_RAW, this will fail unless you have special permissions.
WARNING: Trying to create a socket of type SOCK_RAW, this will fail unless you have special permissions.
WARNING: Trying to create a socket of type SOCK_RAW, this will fail unless you have special permissions.

That message is from Wine...Wine has 4 debugging message types:
err, fixme, warn, trace and message.

WINEDEBUG repects the first 4. MESSAGE is used very rarely, you just
found one of the few times it is used :-).

--
-Austin


Top 
 Post Posted: Tue Feb 24, 2009 7:18 am 
Offline
Level 5
Level 5

Joined: Mon Jul 28, 2008 6:44 pm
Posts: 365
Location: Coimbra, Portugal
austin987 wrote:
On Mon, Feb 23, 2009 at 7:03 PM, jorl17 <wineforum-user@winehq.org> wrote:
Quote:
Hello to all

I've been playing Command and Conquer: Red Alert 3 (LEGAL version of the game) with wine and it has been working very well.

However, I decided to try and play LAN (linux-to-linux) and did not manage to do it. There was a time where I could see my name twice on the list (should see once) plus my other pc's name. So this meant that:

PC A

Sees PC A TWICE and PC B ONCE

PC B

Sees PC B TWICE and PC A ONCE

Whenever I created a game and tried to connect to it, it said 'connection tiemd out'.


Later on, I tried to play via Hamachi with a friend of mine (linux-to-windows) and stumbled upon one more problem. One of the problems seems to be in the /etc/hosts file. Whenever I set my IP (in /etc/hosts) to hamachi's one, I can see him but he can't see me. The opposite happens if I set my IP to 127.0.0.1 (localhost) (that is, he sees me, I don't see him).

So does anybody know where the problem is? Is there a fix for this?

http://wiki.winehq.org/FAQ#head-0344b43 ... 6855283afd

Quote:
One thing I noticed (probably doesn't matter) was this message (not Wine's message, as I'm running WINEDEBUG=-all):

Quote:
WARNING: Trying to create a socket of type SOCK_RAW, this will fail unless you have special permissions.
WARNING: Trying to create a socket of type SOCK_RAW, this will fail unless you have special permissions.
WARNING: Trying to create a socket of type SOCK_RAW, this will fail unless you have special permissions.

That message is from Wine...Wine has 4 debugging message types:
err, fixme, warn, trace and message.

WINEDEBUG repects the first 4. MESSAGE is used very rarely, you just
found one of the few times it is used :-).

--
-Austin


Thanks, I surely did not know about MESSAGE() calls, thanks.

One thing I forgot to say was that I am behind a router (and yet again if LAN doesn't work, why would Hamachi work??)...

You pointed me to the first place where I saw this solution which unfortunately does not seem to work...

I could have also said that I am perfectly able to play online, just not in the LAN (and Hamachi). The fact that it also fails within the LAN shows that it is not a 'class A'-'class C' mismatch (LAN addresses: 192.168.1.3 and 192.168.1.15). Hamachi addresses are not on class C, but that, as said before, doesn't seem to matter.


Top 
 Post subject:
 Post Posted: Tue Feb 24, 2009 11:55 am 
Offline
Level 5
Level 5

Joined: Mon Jul 28, 2008 6:44 pm
Posts: 365
Location: Coimbra, Portugal
Update.

I provided incorrect information. When I set my IP to the hamachi one, I can not see my friend, but he can see me. There was a time when setting my IP to 127.0.0.1 let me see him (although he did not see me)...now that doesn't seem to be happening anymore...


Top 
 Post subject:
 Post Posted: Tue Feb 24, 2009 1:37 pm 
Offline
Level 5
Level 5

Joined: Mon Jul 28, 2008 6:44 pm
Posts: 365
Location: Coimbra, Portugal
Seems to be related with: http://bugs.winehq.org/show_bug.cgi?id=7929


Top 
 Post subject: No peers at all
 Post Posted: Mon Mar 16, 2009 5:10 am 
Offline
Newbie
Newbie

Joined: Thu Mar 12, 2009 9:24 am
Posts: 3
In my case, I see no peers at all in the network room of the game. Even though I have my hamachi ip associated with hostname and set in game settings, and that I m able to see other hamachi users and ping them on the command line

What s wrong ? :(


Top 
 Post subject:
 Post Posted: Thu Mar 19, 2009 5:59 am 
Offline
Level 5
Level 5

Joined: Mon Jul 28, 2008 6:44 pm
Posts: 365
Location: Coimbra, Portugal
As I said, it's related to the above bug.

I Also tried using a program suggested to play Linux-against-windows but it didn't work. Figures it's hard to control a Vista pc only talking through speak freely.

An idea for an experienced developer would be to try and mess with bind() and other stuff without touching wine and using LD_PRELOAD. I've tried quite a few things but it seems impossible to me.


Top 
 Post subject:
 Post Posted: Thu Mar 19, 2009 10:44 am 
Offline
Level 4
Level 4

Joined: Thu Jun 12, 2008 12:40 pm
Posts: 194
Location: Quebec
I would like to know how you set yourself up to play over the network. I play a mod of Diablo (The Hell) which can be played over IPX under Windows with a few modifications. Do you use a Windows version of Hamachi in wine or you use a native Linux version?


Top 
 Post subject:
 Post Posted: Fri Mar 20, 2009 5:48 am 
Offline
Level 1
Level 1

Joined: Fri Mar 20, 2009 5:28 am
Posts: 8
Possibly your Linux's Firewall is on the way. On UbuntuIbex w/ GNOME, I installed Gufw -> set "Defaultly ALLOW traffic" -> "Shutdown Firewall" and LAN started to work BETTER but not perfectly. Sometimes "Enable Firewall" -> "Defaultly DENY traffic" -> add needed ports (see www.portforward.com -> "Router list" -> select "TW-EA-510" as the router and examine what ports it tells you to allow) worked even better.


Top 
 Post subject:
 Post Posted: Fri Mar 20, 2009 8:28 am 
Offline
Level 5
Level 5

Joined: Mon Jul 28, 2008 6:44 pm
Posts: 365
Location: Coimbra, Portugal
Das Letzte Einhorn wrote:
I would like to know how you set yourself up to play over the network. I play a mod of Diablo (The Hell) which can be played over IPX under Windows with a few modifications. Do you use a Windows version of Hamachi in wine or you use a native Linux version?


In terms of overall play I do as I do with other games.

My linux hamachi (it _has_ to be the linux one, because hamachi uses drivers and these drivers are, AFAIK, not supported in Wine). is on, I'm online as usual.
I open up a game with a shortcut I previously created and I play. I only know wine is there because I know a bit about the subject. Someone who came to my PC wouldn't realize that.

However, you may want to check the AppDB for your app and, also, some topics that were discussed here regarding IPX (search them, I think they were related to another C&C game).

There are, however, some games that require you to 'tell them' what the correct IP is. You can try to do this buy modifying your /etc/hosts file and poiting your host to your hamachi IP or by informing yourself if there is a specific file in the game directory (I had to do that with AoEIII).

Anyway, firewall (router or Linux's) can also be in the way, but given you're using hamachi...


Top 
 Post subject:
 Post Posted: Wed Mar 25, 2009 10:56 am 
Offline
Newbie
Newbie

Joined: Wed Mar 25, 2009 10:48 am
Posts: 1
Hi! Im new in this forum. I have similar problem. I want to play in LAN with a windows xp pc.

Wine: 1.1.17
Linux: Kubuntu 8.10

Hosts file:
127.0.0.1 localhost
127.0.1.1 user

When I open the multiplayer window I can see myself twice from my pc and i can see the windows user. We can talk. But when i create the game in linux pc, the windows user can join, but in few seconds connection fails :S
If windows user creates the game, i cant join, always connection timed out.

It s strange, because we can speak in the chat, but after the windows user joins in my game.. it fails. Any solution? Thank u, and sorry for my bad english, im spanish :)


Top 
 Post subject: VPN + LAN
 Post Posted: Sun May 24, 2009 11:35 am 
Offline
Level 1
Level 1

Joined: Tue May 05, 2009 4:43 am
Posts: 9
Well, I found a solution and posted it on the appdb's page of Red Alert 3.

http://appdb.winehq.org/objectManager.p ... &iId=14371

Here's a copy of the informations I posted on the Red Alert's Appdb webpage :

Quote:
Thanks to raphael, here's a mini "how to play on LAN to RA3 with Wine + windows users, when the LAN is a VPN"

My hostname, in this tutorial, is TACHIBANA.

1. First establish a VPN. I use a bridged VPN set up with OpenVPN. It works fine.
The VPN client created a tap0 interface with the IP 11.0.0.3.
2. Re-route packets for 255.255.255.255 to your VPN interface (Here tap0)
# route add host 255.255.255.255 dev tap0
3. In /etc/hosts, remove any reference to your hostname (TACHIBANA here) and, on the first line, add :
11.0.0.3 TACHIBANA
4. Compile this little hack made by Raphael : http://hughes.homelinux.org:8080/~rapha ... ck.tar.bz2 . On a 64 bits machine, here's how I compiled this little hack :
$ cc bind_hack.c -o bind_hack.so -O2 -fPIC -Wall -shared -lc -nostdlib -m32
5. Launch RA3 with wine, while preloading this little hack.
/path/to/RA3$ LD_PRELOAD=/tmp/bind_hack/bind_hack.so wine RA3
6. Connect on the Lobby and check if you see your friends.
7. Create a game, let the users connect, choose their team, ...
8. Launch the game
9. Play
10. ?????
11. Profit !

For info, here are my network informations :
TACHIBANA:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:1d:09:c3:25:9e
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interruption:17

lo Link encap:Boucle locale
inet adr:127.0.0.1 Masque:255.0.0.0
adr inet6: ::1/128 Scope:Hôte
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:21802 errors:0 dropped:0 overruns:0 frame:0
TX packets:21802 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:1104381 (1.0 MiB) TX bytes:1104381 (1.0 MiB)

tap0 Link encap:Ethernet HWaddr 66:b6:cc:e4:c2:23
inet adr:11.0.0.3 Bcast:11.0.0.255 Masque:255.255.255.0
adr inet6: fe80::64b6:ccff:fee4:c223/64 Scope:Lien
UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST MTU:1500 Metric:1
RX packets:76098 errors:0 dropped:0 overruns:0 frame:0
TX packets:63247 errors:0 dropped:1122 overruns:0 carrier:0
collisions:0 lg file transmission:100
RX bytes:29197572 (27.8 MiB) TX bytes:22467044 (21.4 MiB)

wlan0 Link encap:Ethernet HWaddr 00:1f:3c:12:cd:75
inet adr:192.168.1.50 Bcast:192.168.1.255 Masque:255.255.255.0
adr inet6: fe80::21f:3cff:fe12:cd75/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:131405 errors:0 dropped:0 overruns:0 frame:0
TX packets:125745 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:72057503 (68.7 MiB) TX bytes:41252460 (39.3 MiB)

wmaster0 Link encap:UNSPEC HWaddr 00-1F-3C-12-CD-75-00-00-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)


TACHIBANA:~# route
Table de routage IP du noyau
Destination Passerelle Genmask Indic Metric Ref Use Iface
255.255.255.255 * 255.255.255.255 UH 0 0 0 tap0
11.0.0.0 * 255.255.255.0 U 0 0 0 tap0
192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
link-local * 255.255.0.0 U 1000 0 0 wlan0
default neufbox 0.0.0.0 UG 0 0 0 wlan0

TACHIBANA:~# cat /etc/hosts
11.0.0.3 TACHIBANA
127.0.0.1 localhost.localdomain localhost

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

# dpkg -l wine
[...]
ii wine 1.1.21~winehq1-1 Microsoft Windows Compatibility Layer

System : Debian Sid


Top 
 Post subject: Re: VPN + LAN
 Post Posted: Mon Jun 08, 2009 3:16 pm 
Offline
Level 5
Level 5

Joined: Mon Jul 28, 2008 6:44 pm
Posts: 365
Location: Coimbra, Portugal
ThE_TemPLaR wrote:
Well, I found a solution and posted it on the appdb's page of Red Alert 3.

http://appdb.winehq.org/objectManager.p ... &iId=14371

Here's a copy of the informations I posted on the Red Alert's Appdb webpage :

Quote:
Thanks to raphael, here's a mini "how to play on LAN to RA3 with Wine + windows users, when the LAN is a VPN"

My hostname, in this tutorial, is TACHIBANA.

1. First establish a VPN. I use a bridged VPN set up with OpenVPN. It works fine.
The VPN client created a tap0 interface with the IP 11.0.0.3.
2. Re-route packets for 255.255.255.255 to your VPN interface (Here tap0)
# route add host 255.255.255.255 dev tap0
3. In /etc/hosts, remove any reference to your hostname (TACHIBANA here) and, on the first line, add :
11.0.0.3 TACHIBANA
4. Compile this little hack made by Raphael : http://hughes.homelinux.org:8080/~rapha ... ck.tar.bz2 . On a 64 bits machine, here's how I compiled this little hack :
$ cc bind_hack.c -o bind_hack.so -O2 -fPIC -Wall -shared -lc -nostdlib -m32
5. Launch RA3 with wine, while preloading this little hack.
/path/to/RA3$ LD_PRELOAD=/tmp/bind_hack/bind_hack.so wine RA3
6. Connect on the Lobby and check if you see your friends.
7. Create a game, let the users connect, choose their team, ...
8. Launch the game
9. Play
10. ?????
11. Profit !

For info, here are my network informations :
TACHIBANA:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:1d:09:c3:25:9e
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interruption:17

lo Link encap:Boucle locale
inet adr:127.0.0.1 Masque:255.0.0.0
adr inet6: ::1/128 Scope:Hôte
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:21802 errors:0 dropped:0 overruns:0 frame:0
TX packets:21802 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:0
RX bytes:1104381 (1.0 MiB) TX bytes:1104381 (1.0 MiB)

tap0 Link encap:Ethernet HWaddr 66:b6:cc:e4:c2:23
inet adr:11.0.0.3 Bcast:11.0.0.255 Masque:255.255.255.0
adr inet6: fe80::64b6:ccff:fee4:c223/64 Scope:Lien
UP BROADCAST RUNNING PROMISC ALLMULTI MULTICAST MTU:1500 Metric:1
RX packets:76098 errors:0 dropped:0 overruns:0 frame:0
TX packets:63247 errors:0 dropped:1122 overruns:0 carrier:0
collisions:0 lg file transmission:100
RX bytes:29197572 (27.8 MiB) TX bytes:22467044 (21.4 MiB)

wlan0 Link encap:Ethernet HWaddr 00:1f:3c:12:cd:75
inet adr:192.168.1.50 Bcast:192.168.1.255 Masque:255.255.255.0
adr inet6: fe80::21f:3cff:fe12:cd75/64 Scope:Lien
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:131405 errors:0 dropped:0 overruns:0 frame:0
TX packets:125745 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:72057503 (68.7 MiB) TX bytes:41252460 (39.3 MiB)

wmaster0 Link encap:UNSPEC HWaddr 00-1F-3C-12-CD-75-00-00-00-00-00-00-00-00-00-00
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 lg file transmission:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)


TACHIBANA:~# route
Table de routage IP du noyau
Destination Passerelle Genmask Indic Metric Ref Use Iface
255.255.255.255 * 255.255.255.255 UH 0 0 0 tap0
11.0.0.0 * 255.255.255.0 U 0 0 0 tap0
192.168.1.0 * 255.255.255.0 U 0 0 0 wlan0
link-local * 255.255.0.0 U 1000 0 0 wlan0
default neufbox 0.0.0.0 UG 0 0 0 wlan0

TACHIBANA:~# cat /etc/hosts
11.0.0.3 TACHIBANA
127.0.0.1 localhost.localdomain localhost

# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

# dpkg -l wine
[...]
ii wine 1.1.21~winehq1-1 Microsoft Windows Compatibility Layer

System : Debian Sid


I could kiss you! Wait, I WILL kiss you!!

Thank you so much for that.

I was really close, in fact, I had done the exact same thing before (except that the shared library was programmed by me, but the purpose was the same).

The only difference between what I did and what you is that I never tried to use that exact combination (hamachi ip in hosts and hack). I managed to get my friend in my game when I made it bind to 0.0.0.0 with my /etc/hosts, but it would fail, since the packages weren't being sent to my IP after that.

Thank you very much, once more!!

This solves LAN and Hamachi!


Top 
 Post subject:
 Post Posted: Tue Jun 09, 2009 4:58 am 
Offline
Level 1
Level 1

Joined: Tue May 05, 2009 4:43 am
Posts: 9
Glad that could help ;).

The combination looks quite difficult to find. I also tried to advertise myself as 255.255.255.255 instead of 0.0.0.0 but the only thing it does was to be able to chat on the lobby while my name appeared twice. When creating a game, everything would go wrong since the others players wouldn't find the guy with this bizarre IP.

The missing part for me was the little hack.

I guess "[SOLVED]" can now be prefixed to the title of this thread.

I would just like to add the code of this hack, in case the HTTP server linked in the tutorial died.

Filename : bind_hack.c
Code:
/* This file is ditributed under the GPLv2 */

#define _GNU_SOURCE

#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <dlfcn.h>
#include <string.h>

int (*real_bind)(int fd, const struct sockaddr* add, socklen_t len);

void _init(void) {
    real_bind = dlsym(RTLD_NEXT, "bind");
}

int bind(int fd, const struct sockaddr* addr, socklen_t len) {
    struct sockaddr_in* sa;

    if(addr->sa_family==AF_INET) {
        sa = (struct sockaddr_in*) addr;
        memset(&sa->sin_addr, 0, sizeof(sa->sin_addr));
    }
    return real_bind(fd, addr, len);
}


Top 
 Post subject:
 Post Posted: Tue Jun 09, 2009 8:24 am 
Offline
Level 5
Level 5

Joined: Mon Jul 28, 2008 6:44 pm
Posts: 365
Location: Coimbra, Portugal
ThE_TemPLaR wrote:
Glad that could help ;).

The combination looks quite difficult to find. I also tried to advertise myself as 255.255.255.255 instead of 0.0.0.0 but the only thing it does was to be able to chat on the lobby while my name appeared twice. When creating a game, everything would go wrong since the others players wouldn't find the guy with this bizarre IP.

The missing part for me was the little hack.

I guess "[SOLVED]" can now be prefixed to the title of this thread.

I would just like to add the code of this hack, in case the HTTP server linked in the tutorial died.

Filename : bind_hack.c
Code:
/* This file is ditributed under the GPLv2 */

#define _GNU_SOURCE

#include <sys/socket.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <dlfcn.h>
#include <string.h>

int (*real_bind)(int fd, const struct sockaddr* add, socklen_t len);

void _init(void) {
    real_bind = dlsym(RTLD_NEXT, "bind");
}

int bind(int fd, const struct sockaddr* addr, socklen_t len) {
    struct sockaddr_in* sa;

    if(addr->sa_family==AF_INET) {
        sa = (struct sockaddr_in*) addr;
        memset(&sa->sin_addr, 0, sizeof(sa->sin_addr));
    }
    return real_bind(fd, addr, len);
}


Solved will certainly be up there!

That hack was smart, and a good technique to bind to all addresses and then managing to get to recv only from the right one. Now I hope wine gets its infraestructure changed to get a new layer on top of the WINSOCK library, to surpass problems like these. I think that a simple linked list could do, but the problem would really be a way to detect which IP we're talking about. And then again I think that we can try and use pointers to pointers, but that changes the whole function....prrrf.

Best thing to do would be to include the bind to device could in the kernel which, AFAIK, won't happen so soon. Maybe a custom kernel build over here will be rolling!!

Anyway, once again, thanks!

Jorl17


Top 
 Post subject:
 Post Posted: Thu Aug 06, 2009 1:35 pm 
Offline
Level 2
Level 2

Joined: Sun Jul 19, 2009 1:03 pm
Posts: 20
Code:
1. First establish a VPN. I use a bridged VPN set up with OpenVPN. It works fine.
The VPN client created a tap0 interface with the IP 11.0.0.3.
2. Re-route packets for 255.255.255.255 to your VPN interface (Here tap0)
# route add host 255.255.255.255 dev tap0
3. In /etc/hosts, remove any reference to your hostname (TACHIBANA here) and, on the first line, add :
11.0.0.3 TACHIBANA
4. Compile this little hack made by Raphael : http://hughes.homelinux.org:8080/~raphael/bind_hack.tar.bz2 . On a 64 bits machine, here's how I compiled this little hack :
$ cc bind_hack.c -o bind_hack.so -O2 -fPIC -Wall -shared -lc -nostdlib -m32
5. Launch RA3 with wine, while preloading this little hack.
/path/to/RA3$ LD_PRELOAD=/tmp/bind_hack/bind_hack.so wine RA3
6. Connect on the Lobby and check if you see your friends.
7. Create a game, let the users connect, choose their team, ...
8. Launch the game
9. Play
10. ?????
11. Profit !


Sorry for bumping this thread but, could you elaborate step 1?
I'm trying to set up a bridged vpn with openvpn

does it need ssl and such too?


Top 
 Post subject:
 Post Posted: Fri Aug 07, 2009 10:17 am 
Offline
Level 5
Level 5

Joined: Mon Jul 28, 2008 6:44 pm
Posts: 365
Location: Coimbra, Portugal
MarcoBR wrote:
Code:
1. First establish a VPN. I use a bridged VPN set up with OpenVPN. It works fine.
The VPN client created a tap0 interface with the IP 11.0.0.3.
2. Re-route packets for 255.255.255.255 to your VPN interface (Here tap0)
# route add host 255.255.255.255 dev tap0
3. In /etc/hosts, remove any reference to your hostname (TACHIBANA here) and, on the first line, add :
11.0.0.3 TACHIBANA
4. Compile this little hack made by Raphael : http://hughes.homelinux.org:8080/~raphael/bind_hack.tar.bz2 . On a 64 bits machine, here's how I compiled this little hack :
$ cc bind_hack.c -o bind_hack.so -O2 -fPIC -Wall -shared -lc -nostdlib -m32
5. Launch RA3 with wine, while preloading this little hack.
/path/to/RA3$ LD_PRELOAD=/tmp/bind_hack/bind_hack.so wine RA3
6. Connect on the Lobby and check if you see your friends.
7. Create a game, let the users connect, choose their team, ...
8. Launch the game
9. Play
10. ?????
11. Profit !


Sorry for bumping this thread but, could you elaborate step 1?
I'm trying to set up a bridged vpn with openvpn

does it need ssl and such too?


The way you set up the VPN has nothing to do with Wine, I guess. I, for instance, use hamachi as the 'VPN'. So this questions isn't wine related and, even though I have never set up openvpn in my life, here's your "Best Friend":

http://www.google.com/search?q=linux+se ... =&aq=f&oq=

What this thing does is help Red Alert 3 find the other PC and actually connect to it, due to differences in the way Linux and Windows do things. As far as Wine is concerned, that's just another "interface".


Top 
 Post subject:
 Post Posted: Sat Aug 08, 2009 6:16 am 
Offline
Level 2
Level 2

Joined: Sun Jul 19, 2009 1:03 pm
Posts: 20
jorl17 wrote:
I, for instance, use hamachi as the 'VPN'


And that's exactly what I want. I though you need openvpn to make hamachi work?

Sorry for the off topic, but this is kind of related since cnc3 can't see hamachi's IP.

Could you kindly help me out with hamachi if yours work?
If it's not related to wine you could PM me if you want, though i think many uses hamachi and would like to have it right with a game running on wine.

Mine is running ok but cnc3 won't show the ip to change it as it does in windows.


Top 
 Post subject:
 Post Posted: Sat Aug 08, 2009 9:38 am 
Offline
Level 5
Level 5

Joined: Mon Jul 28, 2008 6:44 pm
Posts: 365
Location: Coimbra, Portugal
MarcoBR wrote:
jorl17 wrote:
I, for instance, use hamachi as the 'VPN'


And that's exactly what I want. I though you need openvpn to make hamachi work?

Sorry for the off topic, but this is kind of related since cnc3 can't see hamachi's IP.

Could you kindly help me out with hamachi if yours work?
If it's not related to wine you could PM me if you want, though i think many uses hamachi and would like to have it right with a game running on wine.

Mine is running ok but cnc3 won't show the ip to change it as it does in windows.


Well, it's quite simple, actually. First, make sure you have Hamachi well setup. Install it from their website. IIRC you have to compile a module and then install it (make && sudo make install).

After that, remember that for each session you have to:

sudo tuncfg #Initialize tuneling module, only required once, AFAIK
hamachi start
hamachi login

Do not forget about:

hamachi go-online <network> #If you haven't gone online yet. I always forget about this.

After that, make sure Hamachi is working by pinging, using samba shares, or whatever your method is. I currently ask a friend to access my HTTP server via my hamachi IP to see if it works (his pretty windows firewall blocks pinging).

After having Hamachi open you only need to follow the above steps, exactly like the author wrote them (of course you will ue ham0 and not tap0) and I am not sure if you have to use sudo to execute route ad d (I think you don't).

Works like a charm over here, we never desync and we sure have fun trying to win on a 2vs1 (Human on Brutal) game.


Top 
 Post subject:
 Post Posted: Sun Aug 09, 2009 11:10 am 
Offline
Level 2
Level 2

Joined: Sun Jul 19, 2009 1:03 pm
Posts: 20
Quote:
Works like a charm over here, we never desync and we sure have fun trying to win on a 2vs1 (Human on Brutal) game.


Now i envy you! I also played 2vs1 with a friend when i had a desktop. Now I have to make this work on my linux laptop :?

So here's what's happening:

- Hamachi is up, the device shows on ifconfig. Also added hamachi's ip on /etc/hosts

The game still doesn't show hamachi's ip to select so i started doing those steps.

I got stuck right in the beginning as i can't compile that bind hack:

Code:
In file included from /usr/include/features.h:376,
                 from /usr/include/sys/socket.h:24,
                 from bind_hack.c:5:
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory


it appears some package is missing but I can't tell which one.

I also did what's in the appdb page:
Code:
For network play you also need to start regedit and browse to HKEY_CURRENT_USER/Software/Wine/Network (create Network if it doesn't exist).

Then add a string value with name UseBindAddressHack and value Enabled. If you're having trouble connecting, make sure your /etc/hosts file is properly set up;


No difference :(

Thanks for your help.


Top 
 Post subject:
 Post Posted: Sun Aug 09, 2009 2:10 pm 
Offline
Level 5
Level 5

Joined: Mon Jul 28, 2008 6:44 pm
Posts: 365
Location: Coimbra, Portugal
Well, you can't play because you don't have the hack. That compile error shows that something is wrong within your packages, because one file is being included from another file included in the code...as for that compile error I can't help, but you might search online and see if someone else has that problem with your distro.

As for that registry key, It is related to another patch which, AFAIK, is not included in Wine....so adding that key did nothing.

What does your /etc/hosts file look like? It _is_ odd that you can't see your IP in RA3's options.

If you really can't compile the hack even after googling, I can send you my binary, if the architecture is OK.


Top 
 Post subject:
 Post Posted: Tue Aug 11, 2009 6:07 am 
Offline
Level 2
Level 2

Joined: Sun Jul 19, 2009 1:03 pm
Posts: 20
jorl17 wrote:
Well, you can't play because you don't have the hack. That compile error shows that something is wrong within your packages, because one file is being included from another file included in the code...as for that compile error I can't help, but you might search online and see if someone else has that problem with your distro.

As for that registry key, It is related to another patch which, AFAIK, is not included in Wine....so adding that key did nothing.

What does your /etc/hosts file look like? It _is_ odd that you can't see your IP in RA3's options.

If you really can't compile the hack even after googling, I can send you my binary, if the architecture is OK.


Please note that the game I'm trying is the CNC3 "Tiberium Wars" version, but it should be the same thing. I'm sorry I though i had mentioned (not fond of this RA3..the second is great though).

The problem is practically the same as described in the first post.

Googling just brings me back to this wine forum.. hard to google a personal (raphael's) hack solution. Is your system a 64 bit arch? If so, please send me the binary.

My /etc/hosts look like this:
Code:
#hamachi's IP
#5.110.192.199 localhost
127.0.0.1   localhost.localdomain localhost


No big deal there right? But the only thing that shows is 127.0.0.1 in the game.

Thanks again. I will keep looking for more information.


Top 
 Post subject:
 Post Posted: Tue Aug 11, 2009 10:53 am 
Offline
Level 5
Level 5

Joined: Mon Jul 28, 2008 6:44 pm
Posts: 365
Location: Coimbra, Portugal
Well that's the first problem I see...You commented the Hamachi IP? Why on earth? :P

Have that file only have:

5.110.192.199 <local domain>
127.0.0.1 localhost

Where local domain is the name of your computer. For instance, mines are jorl17-desktop jorl17-main jorl17-laptop jorl17-mail...

Yours should show up in a bash session.

Also, when I said google, I was talking about your include files, which seem to be messed up. I only own 32-bit machines...

Google something such as:

"<distro name> In file included from /usr/include/features.h:376,
from /usr/include/sys/socket.h:24
/usr/include/gnu/stubs.h:7:27: error: gnu/stubs-32.h: No such file or directory"

Without the quotes. You'll probably get a decent result.

A quick google search shows me:
http://ubuntuforums.org/archive/index.php/t-300266.html
http://ubuntuforums.org/archive/index.php/t-370114.html
http://www.linux-solved.com/post/gnu-st ... D-564.html
http://br.answers.yahoo.com/question/in ... 855AALIBGH

Out of thin air I'd say it's something related to not defining a 64 bit flag on that compilation process.

Here's a possible solution:

Quote:
After no useful help here, the programming forum or gcc-help, I worked it out.

Solution was simple: set CFLAGS to -m64 before configure.


Try that and see if it works :D

Glad to help,

Jorl17


Top 
 Post subject:
 Post Posted: Tue Aug 11, 2009 3:57 pm 
Offline
Level 2
Level 2

Joined: Sun Jul 19, 2009 1:03 pm
Posts: 20
Nice! Now the hack is compiled :D

Unfortunately I can't load it :

Code:
ERROR: ld.so: object '/tmp/bind_hack.so' from LD_PRELOAD cannot be preloaded: ignored.


And it seems I'm not the only one. But almost there!
http://appdb.winehq.org/commentview.php?iAppId=7968&iVersionId=14371&iThreadId=46199

I've googled a bit, and some people were having that with aoss and one mentioned:
https://bugs.launchpad.net/fedora/+source/alsa-oss/+bug/173487
Quote:
After a bit more digging it seems like the error is because wine is a 32 bit application and the libaoss is probably not.

If that is right then this is indeed confusing. That would mean that I need the 32bit version of this hack since wine is 32 bit, but since my system is 64bit i won't be able to compile that.

You think I could use an already compiled in 32 bit? I think that wouldn't work.
Also the guy in this topic says that in 64 bit machine he explicitly uses the -m32 to keep it 32 bit.

Quote:
4. Compile this little hack made by Raphael : http://hughes.homelinux.org:8080/~rapha ... ck.tar.bz2 . On a 64 bits machine, here's how I compiled this little hack :
$ cc bind_hack.c -o bind_hack.so -O2 -fPIC -Wall -shared -lc -nostdlib -m32


I hope I'm wrong!

Thanks for the help anyway jorl17, I would give you some tiberium if I could :)


Top 
 Post subject:
 Post Posted: Tue Aug 11, 2009 4:10 pm 
Offline
Level 5
Level 5

Joined: Mon Jul 28, 2008 6:44 pm
Posts: 365
Location: Coimbra, Portugal
Try that, it might be a good thing to do.

If it _still_ doesn't work, I'll send you a 32-bit binary.

After that it _should_ work.

Cheers,

Jorl17


Top 
Display posts from previous:  Sort by  
 
 Page 1 of 2 [ 33 posts ] Go to page 1, 2  Next




Board index » WineHQ » Wine Help


Who is online

Users browsing this forum: Bing [Bot] and 15 guests

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: