blob: 0f29f2947a4bc099cb9de331c294e9edf86e51c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
|
#include <Client.hpp>
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); }
}
|