here have more code aaaaaaaaaaaaa

This commit is contained in:
Arisotura 2019-03-15 01:08:37 +01:00
parent 4de4631c15
commit b52458d7be
3 changed files with 20 additions and 6 deletions

View File

@ -124,7 +124,17 @@ bool Init()
void DeInit()
{
// TODO CLEANUP SHIT!!!!
for (int i = 0; i < (sizeof(TCPSocketList)/sizeof(TCPSocket)); i++)
{
TCPSocket* sock = &TCPSocketList[i];
if (sock->Backend) closesocket(sock->Backend);
}
for (int i = 0; i < (sizeof(UDPSocketList)/sizeof(UDPSocket)); i++)
{
UDPSocket* sock = &UDPSocketList[i];
if (sock->Backend) closesocket(sock->Backend);
}
}

View File

@ -279,10 +279,12 @@ bool LAN_Init()
void LAN_DeInit()
{
// checkme. blarg
if (Config::DirectLAN)
LAN_PCap::DeInit();
else
LAN_Socket::DeInit();
//if (Config::DirectLAN)
// LAN_PCap::DeInit();
//else
// LAN_Socket::DeInit();
LAN_PCap::DeInit();
LAN_Socket::DeInit();
}
int LAN_SendPacket(u8* data, int len)

View File

@ -632,6 +632,7 @@ int EmuThreadFunc(void* burp)
if (joybuttons) delete[] joybuttons;
NDS::DeInit();
Platform::LAN_DeInit();
return 44203;
}
@ -1679,7 +1680,8 @@ void ApplyNewSettings(int type)
Platform::MP_Init();
}
// TODO: cycle LAN shito
Platform::LAN_DeInit();
Platform::LAN_Init();
}
EmuRunning = prevstatus;