Views: 9,246,949 | Homepage | Main | Rules/FAQ | Memberlist | Active users | Last posts | Calendar | Stats | Online users | Search | 09-08-24 06:08 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 |
| ||
Member Normal user Level: 8 Posts: 5/13 EXP: 1631 Next: 556 Since: 05-15-21 Last post: 1008 days ago Last view: 425 days ago |
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.034 seconds. (2048KB of memory used) MySQL - queries: 29, rows: 70/70, time: 0.029 seconds. Acmlmboard 2.064 (2018-07-20) © 2005-2008 Acmlm, Xkeeper, blackhole89 et al. |