Views: 6,695,427 Homepage | Main | Rules/FAQ | Memberlist | Active users | Last posts | Calendar | Stats | Online users | Search 03-28-24 10:37 AM
Guest:

0 users reading My local multiplayer problem is solved | 1 bot

Main - Development - My local multiplayer problem is solved Hide post layouts | New reply


temp12312
Posted on 07-03-21 05:11 PM Link | #3939
Melonds is using broadcast address to send data in local multiplayer. For some reason one of pcs was not recieving broadcast data, other did somehow. So I changed source code, in platform.cpp I changed

res = setsockopt(MPSocket, SOL_SOCKET, SO_BROADCAST, (const char*)&opt_true, sizeof(int));
if (res < 0)
{
closesocket(MPSocket);
MPSocket = INVALID_SOCKET;
return false;
}

MPSendAddr.sa_family = AF_INET;
*(u32*)&MPSendAddr.sa_data[2] = htonl(INADDR_BROADCAST);
*(u16*)&MPSendAddr.sa_data[0] = htons(7064);

/*res = setsockopt(MPSocket, SOL_SOCKET, SO_BROADCAST, (const char*)&opt_true, sizeof(int));
if (res < 0)
{
closesocket(MPSocket);
MPSocket = INVALID_SOCKET;
return false;
}*/

MPSendAddr.sa_family = AF_INET;
*(u32*)&MPSendAddr.sa_data[2] = htonl(IP_HERE);
*(u16*)&MPSendAddr.sa_data[0] = htons(7064);

Change IP_HERE to ip of other pc, but firstly convert it to decimal or use other socket function

If you have similiar issue you can try to change source code and compile it.

To developers I hope you will consider it and change code, I wont change code because my solution will not work with 2+ players multiplayer. That is a bit of issue.


Main - Development - My local multiplayer problem is solved Hide post layouts | New reply

Page rendered in 0.020 seconds. (2048KB of memory used)
MySQL - queries: 26, rows: 67/67, time: 0.014 seconds.
[powered by Acmlm] Acmlmboard 2.064 (2018-07-20)
© 2005-2008 Acmlm, Xkeeper, blackhole89 et al.