Re: C&C Red Alert 3 - Lan (and also hamachi) play

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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);
}









[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux