logo UO Mapistro
DL 34,377 / Version 0,1ch 0b47 2ch 0b46
Japanese / English

Test mode


 * This function is available in 0b37 version or later.

What is test mode? (What is test mode?)
 Uovmc works with the latest official client, but there were many requests to use old clients that do not support it.
 Since uovmc is being developed to be an approved third party program, it will only support the latest official clients.
 However, it is not desirable to ignore many requests, so we created a mechanism to push information to uovmc from the outside.


How uovmc users can use test mode
 If you want to allow receiving information in test mode, turn on "Allow test mode - ON / OFF" in "Switch display - ON / OFF" in the menu.


How to send information to uovmc test mode
 The following is a technical document for developers who understand programming.
 Also, please do not ask any technical questions about this content.


● points
・1st : [require] soruce hwnd send to uovmc window (WM_USER_TESTMODE_SET_HWND). recommend use SendMessage.

・2nd : COPYDATASTRUCT set UOVMC_COPYDATA_NAME1 struct and send to uovmc window (WM_COPYDATA / UOVMC_COPYDATA_DW_NAME1). recommend use SendMessage.

・3rd : location send to uovmc window (WM_USER_TESTMODE_SET_XY). WPARAM(low 16bit = x(unsigned), high 16bit = y(unsigned)). LPARAM(low 16bit = z(signed), high 16bit = facet(unsigned) ). recommend use PostMessage.

dead flag send to uovmc window (WM_USER_TESTMODE_SET_DEAD). LPARAM( 0 = not dead, 1 = dead ). recommend use PostMessage.

・4th : source window close, or source window hwnd is disable to quit.



● defines (C++)

#define WM_USER_TESTMODE_SET_HWND WM_USER + 10011
#define WM_USER_TESTMODE_SET_XY WM_USER + 10021
#define WM_USER_TESTMODE_SET_DEAD WM_USER + 10051

#define UOVMC_COPYDATA_DW_NAME1 10091

typedef struct
{
wchar_t player_name[100];
wchar_t shard_name[100];
}
UOVMC_COPYDATA_NAME1;


● sample program (C++ / console)

#include <stdio.h>
#include <windows.h>

int main(void)
{
wchar_t cBuff[256] = {0};
GetConsoleTitleW(cBuff,256);

// source hwnd (require)
HWND my_window = FindWindowW(NULL,cBuff);

// uovmc hwnd find (require)
HWND vmc_window = FindWindowW( L"uovmc", NULL);

if( ! my_window || ! vmc_window ) {
wprintf( L"error: window not found." );
getchar();
return 0;
}

// hwnd set (require)
SendMessage( vmc_window, WM_USER_TESTMODE_SET_HWND, 0, (LPARAM)my_window );

// player/shard name set
UOVMC_COPYDATA_NAME1 name1 = {0};

wcscpy_s( name1.player_name, 100, L"TestModePlayer" );
wcscpy_s( name1.shard_name, 100, L"TestModeShard" );

COPYDATASTRUCT cds;
cds.dwData = UOVMC_COPYDATA_DW_NAME1;
cds.cbData = sizeof(UOVMC_COPYDATA_NAME1);
cds.lpData = &name1;
SendMessage( vmc_window, WM_COPYDATA, (WPARAM)(HWND)my_window, (LPARAM)(LPVOID)&cds );

// location change
int x = 0, y = 0, z = 0, facet = 0;
for( int i = 0; i < 20; i++ ) {
PostMessage( vmc_window, WM_USER_TESTMODE_SET_XY,
(USHORT)x | ( (USHORT)y << 16 ), (USHORT)z | ( (USHORT)facet << 16 ) );

x++;
y++;
Sleep(250);
}

// dead flag change
PostMessage( vmc_window, WM_USER_TESTMODE_SET_DEAD, 0, 1 );
Sleep(1000);
PostMessage( vmc_window, WM_USER_TESTMODE_SET_DEAD, 0, 0 );

// press key to exit
wprintf( L"press key to exit." );
getchar();
return 0;
}

© Gakuto Matsumura (uo.mapistrogmail.com) Privacy Policy