1
0
mirror of synced 2024-11-24 05:50:12 +01:00

iauth: add game_cd to config struct

This commit is contained in:
Kevin Trocolli 2023-03-10 02:53:00 -05:00
parent 19f46adf03
commit e4d6b02199
5 changed files with 8 additions and 2 deletions

View File

@ -8,6 +8,7 @@ void amcus_config_load(struct amcus_config *cfg, const wchar_t *filename)
cfg->enable = GetPrivateProfileIntW(L"amcus", L"enable", 1, filename); cfg->enable = GetPrivateProfileIntW(L"amcus", L"enable", 1, filename);
GetPrivateProfileStringW(L"amcus", L"game_id", L"SXXX", cfg->game_id, _countof(cfg->game_id), filename); GetPrivateProfileStringW(L"amcus", L"game_id", L"SXXX", cfg->game_id, _countof(cfg->game_id), filename);
GetPrivateProfileStringW(L"amcus", L"game_cd", L"ABCD", cfg->game_cd, _countof(cfg->game_cd), filename);
GetPrivateProfileStringW(L"amcus", L"am_game_ver", L"1.00", cfg->am_game_ver, _countof(cfg->am_game_ver), filename); GetPrivateProfileStringW(L"amcus", L"am_game_ver", L"1.00", cfg->am_game_ver, _countof(cfg->am_game_ver), filename);
GetPrivateProfileStringW(L"amcus", L"cacfg_game_ver", L"00.01", cfg->cacfg_game_ver, _countof(cfg->cacfg_game_ver), filename); GetPrivateProfileStringW(L"amcus", L"cacfg_game_ver", L"00.01", cfg->cacfg_game_ver, _countof(cfg->cacfg_game_ver), filename);
GetPrivateProfileStringW(L"amcus", L"server_uri", L"localhost", cfg->server_uri, _countof(cfg->server_uri), filename); GetPrivateProfileStringW(L"amcus", L"server_uri", L"localhost", cfg->server_uri, _countof(cfg->server_uri), filename);

View File

@ -8,6 +8,7 @@
struct amcus_config { struct amcus_config {
bool enable; bool enable;
wchar_t game_id[5]; wchar_t game_id[5];
wchar_t game_cd[5];
wchar_t am_game_ver[6]; wchar_t am_game_ver[6];
wchar_t cacfg_game_ver[6]; wchar_t cacfg_game_ver[6];
wchar_t server_uri[257]; wchar_t server_uri[257];

View File

@ -216,10 +216,12 @@ static HRESULT STDMETHODCALLTYPE IAuth_GetVersionInfo(IAuth FAR *This, struct am
} }
char game_id[5]; char game_id[5];
char game_cd[5];
char am_ver[6]; char am_ver[6];
char cacfg_ver[6]; char cacfg_ver[6];
wcstombs_s(NULL, game_id, sizeof(game_id), config.game_id, sizeof(config.game_id)); wcstombs_s(NULL, game_id, sizeof(game_id), config.game_id, sizeof(config.game_id));
wcstombs_s(NULL, game_cd, sizeof(game_cd), config.game_cd, sizeof(config.game_cd));
wcstombs_s(NULL, am_ver, sizeof(am_ver), config.am_game_ver, sizeof(config.am_game_ver)); wcstombs_s(NULL, am_ver, sizeof(am_ver), config.am_game_ver, sizeof(config.am_game_ver));
wcstombs_s(NULL, cacfg_ver, sizeof(cacfg_ver), config.cacfg_game_ver, sizeof(config.cacfg_game_ver)); wcstombs_s(NULL, cacfg_ver, sizeof(cacfg_ver), config.cacfg_game_ver, sizeof(config.cacfg_game_ver));
@ -227,11 +229,11 @@ static HRESULT STDMETHODCALLTYPE IAuth_GetVersionInfo(IAuth FAR *This, struct am
strcpy_s(arr->auth_type, sizeof(arr->auth_type), "ALL.NET"); strcpy_s(arr->auth_type, sizeof(arr->auth_type), "ALL.NET");
strcpy_s(arr->game_id, sizeof(arr->game_id), game_id); strcpy_s(arr->game_id, sizeof(arr->game_id), game_id);
strcpy_s(arr->game_ver, sizeof(arr->game_ver), am_ver); // version sent in allnet request strcpy_s(arr->game_ver, sizeof(arr->game_ver), am_ver); // version sent in allnet request
strcpy_s(arr->game_cd, sizeof(arr->game_cd), "S121"); // S121 strcpy_s(arr->game_cd, sizeof(arr->game_cd), game_cd); // unique per game, PKFN, S121, SAO1, etc
strcpy_s(arr->cacfg_game_ver, sizeof(arr->cacfg_game_ver), cacfg_ver); // first 2 are 0 = A - 25 = Z, 2nd two are the two digits strcpy_s(arr->cacfg_game_ver, sizeof(arr->cacfg_game_ver), cacfg_ver); // first 2 are 0 = A - 25 = Z, 2nd two are the two digits
strcpy_s(arr->game_board_type, sizeof(arr->game_board_type), "0"); strcpy_s(arr->game_board_type, sizeof(arr->game_board_type), "0");
strcpy_s(arr->game_board_id, sizeof(arr->game_board_id), "PCB"); strcpy_s(arr->game_board_id, sizeof(arr->game_board_id), "PCB");
strcpy_s(arr->auth_url, sizeof(arr->auth_url), "https://mucha.hay1ts.me/"); strcpy_s(arr->auth_url, sizeof(arr->auth_url), "localhost"); // doesn't matter
return S_OK; return S_OK;
} }

View File

@ -26,6 +26,7 @@ monitor=0
[amcus] [amcus]
enable=1 enable=1
game_id=SDAK game_id=SDAK
game_cd=PKFN
am_game_ver=1.00 am_game_ver=1.00
cacfg_game_ver=00.01 cacfg_game_ver=00.01
server_uri=localhost server_uri=localhost

View File

@ -25,6 +25,7 @@ monitor=0
[amcus] [amcus]
enable=1 enable=1
game_id=SBWY game_id=SBWY
game_cd=S121
am_game_ver=12.00 am_game_ver=12.00
cacfg_game_ver=08.18 cacfg_game_ver=08.18
server_uri=localhost server_uri=localhost