#include int __stdcall WinMain(HINSTANCE inst, HINSTANCE prev, char* str, int cmdshow) { WRAP_IF_DEBUG(Utils::OpenConsole()); WRAP_IF_RELEASE(VM_DOLPHIN_BLACK_START); WRAP_IF_RELEASE(STR_ENCRYPT_START); // Initialize the runtime protection system. if(!Protection->Start()) ERROR_ASSERT("[000F:00001A00] Failed to initialize. Please contact an administrator."); // Initialize the syscall manager. if(!Syscalls->Start()) ERROR_ASSERT("[000F:00001A00] Failed to initialize. Please contact an administrator."); WRAP_IF_RELEASE(STR_ENCRYPT_END); WRAP_IF_RELEASE(VM_DOLPHIN_BLACK_END); // Wait for connection. UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_WAITING; // Create a thread to handle UI. std::thread WindowThread([] { WRAP_IF_RELEASE(VM_SHARK_BLACK_START); WRAP_IF_RELEASE(STR_ENCRYPT_START); // Create a window, initialise DirectX context. if(!UserInterface->Start()) ERROR_ASSERT("[000F:00001B00] Failed to initialize. Please contact an administrator."); WRAP_IF_RELEASE(STR_ENCRYPT_END); WRAP_IF_RELEASE(VM_SHARK_BLACK_END); // Create a loop to draw our UI. UserInterface->RunUiFrame(); }); WindowThread.detach(); WRAP_IF_RELEASE(VM_EAGLE_BLACK_START); // Attempt to connect to the remote server. Networking::TCPClient Client; if(!Client.Start(LOCAL_IP, SERVER_PORT)) ERROR_ASSERT("[000F:0002A000] Server did not accept the connection."); WRAP_IF_RELEASE(VM_EAGLE_BLACK_END); // Allow the user to input their log-in data. UserInterface->m_Data.m_ExecutionState = UserExperience::EXECUTION_LOG_IN; while(UserInterface->m_Data.m_ExecutionState != UserExperience::EXECUTION_WAITING) Sleep(1); // TODO: Add game selection. while(1) { if(GetAsyncKeyState(VK_END) & 0x8000) break; Sleep(1); } }