mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-21 14:41:39 +00:00
Phantasy Star Portable 2 port offset fix
This commit is contained in:
parent
01481da449
commit
55de66b5ef
@ -54,6 +54,7 @@ std::thread friendFinderThread;
|
||||
recursive_mutex peerlock;
|
||||
SceNetAdhocPdpStat * pdp[255];
|
||||
SceNetAdhocPtpStat * ptp[255];
|
||||
uint32_t localip;
|
||||
|
||||
int isLocalMAC(const SceNetEtherAddr * addr) {
|
||||
SceNetEtherAddr saddr;
|
||||
@ -1302,7 +1303,7 @@ int getLocalIp(sockaddr_in * SocketAddress){
|
||||
}
|
||||
return -1;
|
||||
#else
|
||||
SocketAddress->sin_addr.s_addr = inet_addr("192.168.12.1");
|
||||
memcpy(&SocketAddress->sin_addr, &localip, sizeof(uint32_t));
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
@ -1445,6 +1446,8 @@ int initNetwork(SceNetAdhocctlAdhocId *adhoc_id){
|
||||
host->NotifyUserMessage(buffer, 8.0f);
|
||||
return iResult;
|
||||
}
|
||||
//grab local ip for later use better than constant ip on non windows platform
|
||||
localip = getLocalIp(metasocket);
|
||||
|
||||
// Prepare Login Packet
|
||||
SceNetAdhocctlLoginPacketC2S packet;
|
||||
|
@ -1640,6 +1640,8 @@ static int sceNetAdhocPtpOpen(const char *srcmac, int sport, const char *dstmac,
|
||||
|
||||
// Valid Ports
|
||||
if (!isPTPPortInUse(sport) /*&& dport != 0*/) {
|
||||
//sport 0 should be shifted back to 0 when using offset Phantasy Star Portable 2 use this
|
||||
if (sport == 0) sport = -(int)portOffset;
|
||||
// Valid Arguments
|
||||
if (bufsize > 0 && rexmt_int > 0 && rexmt_cnt > 0) {
|
||||
// Create Infrastructure Socket
|
||||
|
Loading…
x
Reference in New Issue
Block a user