MCPcopy Create free account
hub / github.com/NoMercy-ac/NoMercy / InitSocketConnection

Method InitSocketConnection

Source/Client/NM_Engine/SocketConnection.cpp:121–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

119#endif
120
121bool CNetwork::InitSocketConnection()
122{
123 NETWORK_LOG(LL_SYS, "Thread creation has been started!");
124
125 auto ulFuncSize = g_nmApp->ThreadManagerInstance()->GetThreadFuncSize((LPBYTE)NetworkRoutine);
126 if (!ulFuncSize || ulFuncSize > 1024)
127 {
128 NETWORK_LOG(LL_ERR, "Not valid thread func size: %u", ulFuncSize);
129 return false;
130 }
131
132 auto thread = g_nmApp->ThreadManagerInstance()->CreateCustomThread(SELF_THREAD_NETWORKROUTINE, NetworkRoutine, ulFuncSize, nullptr, 0, false);
133 if (!IS_VALID_SMART_PTR(thread) || thread->IsCorrect() == false)
134 {
135 NETWORK_LOG(LL_ERR, "Thread can NOT created! Error: %u", g_winapiApiTable->GetLastError());
136 return false;
137 }
138
139 NETWORK_LOG(LL_SYS, "Info - %u[%p->%p][%d-%s] - Completed! Shared:%p Custom:%p",
140 thread->GetId(), thread->GetHandle(), thread->GetStartAddress(), thread->GetCustomCode(), thread->GetThreadCustomName().c_str(), thread, thread.get());
141
142 return true;
143}
144

Callers 3

InitTestFunctionsMethod · 0.80
InitializeServerMethod · 0.80

Calls 10

GetThreadFuncSizeMethod · 0.80
ThreadManagerInstanceMethod · 0.80
CreateCustomThreadMethod · 0.80
IsCorrectMethod · 0.80
GetHandleMethod · 0.80
GetStartAddressMethod · 0.80
GetCustomCodeMethod · 0.80
GetThreadCustomNameMethod · 0.80
GetIdMethod · 0.45
getMethod · 0.45

Tested by 1

InitTestFunctionsMethod · 0.64