Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Wipeout Pulse unable to see any Host, and should affect many other... #6425

Merged
merged 1 commit into from Jun 25, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 14 additions & 14 deletions Core/HLE/sceNetAdhoc.cpp
Expand Up @@ -497,17 +497,17 @@ int sceNetAdhocPdpSend(int id, const char *mac, u32 port, void *data, int len, i
DEBUG_LOG(SCENET, "sceNetAdhocPdpSend[%i:%u]: Sent %u bytes to %u.%u.%u.%u:%u", socket->id, ntohs(getLocalPort(socket->id)), sent, sip[0], sip[1], sip[2], sip[3], ntohs(target.sin_port));

// Return sent size
return sent;
//return sent;
// Success
//return 0;
return 0;
}
// Partially Sent Data (when non-blocking socket's send buffer is smaller than len)
else if (flag && (sent >= 0)) {
/*else if (flag && (sent >= 0)) {
DEBUG_LOG(SCENET, "sceNetAdhocPdpSend[%i:%u]: Partial Sent %u bytes to %u.%u.%u.%u:%u", socket->id, ntohs(getLocalPort(socket->id)), sent, sip[0], sip[1], sip[2], sip[3], ntohs(target.sin_port));

// Return sent size
return sent;
}
}*/

// Blocking Situation
if (flag) return ERROR_NET_ADHOC_WOULD_BLOCK;
Expand Down Expand Up @@ -535,7 +535,7 @@ int sceNetAdhocPdpSend(int id, const char *mac, u32 port, void *data, int len, i
// sceNetInetSendto(socket->id, data, len, ((flag != 0) ? (INET_MSG_DONTWAIT) : (0)), (SceNetInetSockaddr *)&target, sizeof(target));
//}
#endif
int maxsent = 0;
//int maxsent = 0;

// Acquire Peer Lock
peerlock.lock();
Expand All @@ -554,7 +554,7 @@ int sceNetAdhocPdpSend(int id, const char *mac, u32 port, void *data, int len, i
// Send Data
changeBlockingMode(socket->id, flag);
int sent = sendto(socket->id, (const char *)data, len, 0, (sockaddr *)&target, sizeof(target));
if (sent > maxsent) maxsent = sent;
//if (sent > maxsent) maxsent = sent;
if (sent == SOCKET_ERROR) {
ERROR_LOG(SCENET, "Socket Error (%i) on sceNetAdhocPdpSend[i%](Broadcast)", errno, socket->id);
}
Expand All @@ -571,10 +571,10 @@ int sceNetAdhocPdpSend(int id, const char *mac, u32 port, void *data, int len, i
// Free Network Lock
//_freeNetworkLock();

// Broadcast never fails!
//return 0;
// Success, Broadcast never fails!
return 0;
// Return sent size
return maxsent;
//return maxsent;
}
}

Expand Down Expand Up @@ -695,11 +695,11 @@ int sceNetAdhocPdpRecv(int id, void *addr, void * port, void *buf, void *dataLen
//_freeNetworkLock();

// Return Success
//return 0;
return 0;
}

//Return Received len
return received;
//Receiving data from unknown peer, ignored ?
return ERROR_NET_ADHOC_NO_DATA_AVAILABLE;
}

// Free Network Lock
Expand Down Expand Up @@ -2348,8 +2348,8 @@ int sceNetAdhocMatchingStop(int matchingId) {
friendFinderThread.join();
}*/

// Remove your own MAC, or All memebers, don't remove at all?
//delAllMembers();
// Remove your own MAC, or All memebers, or don't remove at all or we should do this on MatchingDelete ?
//deleteAllMembers(item);
}

return 0;
Expand Down