netAdhocctlInited should be true when return success

Update back new file

Windows (?) build fix
This commit is contained in:
sum2012 2014-09-07 19:27:26 +08:00 committed by Henrik Rydgard
parent 43b3707ee6
commit 9933ae0c6e
4 changed files with 10 additions and 10 deletions

View File

@ -1456,7 +1456,6 @@ int initNetwork(SceNetAdhocctlAdhocId *adhoc_id){
return iResult;
}
// Prepare Login Packet
SceNetAdhocctlLoginPacketC2S packet;
packet.base.opcode = OPCODE_LOGIN;
@ -1563,7 +1562,7 @@ bool resolveMAC(SceNetEtherAddr * mac, uint32_t * ip) {
bool validNetworkName(const SceNetAdhocctlGroupName * group_name) {
// Result
int valid = true;
bool valid = true;
// Name given
if (group_name != NULL) {

View File

@ -1157,7 +1157,7 @@ int initNetwork(SceNetAdhocctlAdhocId *adhocid);
/**
* Broadcast MAC Check
* @param addr To-be-checked MAC Address
* @return true if Broadcast MAC, false otherwise.
* @return true if Broadcast MAC or... 0
*/
bool isBroadcastMAC(const SceNetEtherAddr * addr);
@ -1165,7 +1165,7 @@ bool isBroadcastMAC(const SceNetEtherAddr * addr);
* Resolve IP to MAC
* @param ip Peer IP Address
* @param mac OUT: Peer MAC
* @return true on success, false otherwise.
* @return true on success
*/
bool resolveIP(uint32_t ip, SceNetEtherAddr * mac);
@ -1173,14 +1173,14 @@ bool resolveIP(uint32_t ip, SceNetEtherAddr * mac);
* Resolve MAC to IP
* @param mac Peer MAC Address
* @param ip OUT: Peer IP
* @return true on success, false otherwise.
* @return true on success
*/
bool resolveMAC(SceNetEtherAddr * mac, uint32_t * ip);
/**
* Check whether Network Name contains only valid symbols
* @param group_name To-be-checked Network Name
* @return true if valid, false otherwise.
* @return 1 if valid or... 0
*/
bool validNetworkName(const SceNetAdhocctlGroupName * groupname);

View File

@ -29,7 +29,6 @@
#include "sceKernel.h"
#include "sceKernelThread.h"
#include "sceKernelMutex.h"
#include "sceNet.h"
#include "sceUtility.h"
#include "Core/HLE/proAdhoc.h"

View File

@ -243,8 +243,8 @@ static u32 sceNetAdhocctlInit(int stackSize, int prio, u32 productAddr) {
friendFinderThread = std::thread(friendFinder);
}
netAdhocctlInited = true; //needed for cleanup during AdhocctlTerm even when it failed to connect to Adhoc Server (since it's being faked as success)
}
netAdhocctlInited = true; //needed for cleanup during AdhocctlTerm even when it failed to connect to Adhoc Server (since it's being faked as success)
return 0;
}
@ -297,7 +297,8 @@ static int sceNetAdhocPdpCreate(const char *mac, u32 port, int bufferSize, u32 u
//return ERROR_NET_ADHOC_PORT_IN_USE;
// Create Internet UDP Socket
int usocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
int usocket = (int)INVALID_SOCKET;
usocket = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP);
// Valid Socket produced
if (usocket != INVALID_SOCKET) {
// Change socket buffer size when necessary
@ -1679,7 +1680,8 @@ static int sceNetAdhocPtpOpen(const char *srcmac, int sport, const char *dstmac,
// Valid Arguments
if (bufsize > 0 && rexmt_int > 0 && rexmt_cnt > 0) {
// Create Infrastructure Socket
int tcpsocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
int tcpsocket = (int)INVALID_SOCKET;
tcpsocket = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
// Valid Socket produced
if (tcpsocket > 0) {