Move built-in AdhocServer Thread to __NetAdhocInit

There are games (ie. Naruto Kizuna Drive) who tried to initialize
network/connect to adhoc server early when the game started, if adhoc
server wasn't ready the player may need to restart the game in order to
connect successfully
This commit is contained in:
sum2012 2014-08-24 04:46:28 +08:00 committed by Henrik Rydgard
parent 6ed15ab1f5
commit aa69489aaf

View file

@ -181,6 +181,12 @@ void __NetAdhocInit() {
actionAfterMatchingMipsCall = __KernelRegisterActionType(AfterMatchingMipsCall::Create);
eventAdhocctlHandlerUpdate = CoreTiming::RegisterEvent("AdhocctlHandlerUpdateEvent", __handlerAdhocctlUpdateCallback);
eventMatchingHandlerUpdate = CoreTiming::RegisterEvent("MatchingHandlerUpdateEvent", __handlerMatchingUpdateCallback);
// Create built-in AdhocServer Thread
if (g_Config.bEnableWlan && g_Config.bEnableAdhocServer) {
//_status = 1;
adhocServerRunning = true;
adhocServerThread = std::thread(proAdhocServerThread, SERVER_PORT);
}
}
u32 sceNetAdhocInit() {
@ -203,13 +209,6 @@ u32 sceNetAdhocInit() {
__KernelStartThread(threadAdhocID, 0, 0);
}
// Create built-in AdhocServer Thread
if (g_Config.bEnableWlan && g_Config.bEnableAdhocServer) {
//_status = 1;
adhocServerRunning = true;
adhocServerThread = std::thread(proAdhocServerThread, SERVER_PORT);
}
// Return Success
return 0;
}