forked from Hay1tsme/segatools
ekt: implement y3ws
This commit is contained in:
39
common/y3io/impl/websockets/config.c
Normal file
39
common/y3io/impl/websockets/config.c
Normal file
@ -0,0 +1,39 @@
|
||||
#include <windows.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "config.h"
|
||||
|
||||
void y3ws_config_load(struct y3ws_config *cfg, const wchar_t *filename)
|
||||
{
|
||||
assert(cfg != NULL);
|
||||
assert(filename != NULL);
|
||||
|
||||
cfg->enable = GetPrivateProfileIntW(L"y3ws", L"enable", 1, filename);
|
||||
cfg->debug = GetPrivateProfileIntW(L"y3ws", L"debug", 0, filename);
|
||||
|
||||
cfg->port = GetPrivateProfileIntW(L"y3ws", L"port", 3497, filename);
|
||||
|
||||
wchar_t tmpstr[16];
|
||||
|
||||
GetPrivateProfileStringW(
|
||||
L"y3ws",
|
||||
L"gameId",
|
||||
L"SDEY",
|
||||
tmpstr,
|
||||
_countof(tmpstr),
|
||||
filename);
|
||||
|
||||
wcstombs(cfg->game_id, tmpstr, sizeof(cfg->game_id));
|
||||
|
||||
GetPrivateProfileStringW(
|
||||
L"y3ws",
|
||||
L"cardDirectory",
|
||||
L"DEVICE\\print",
|
||||
cfg->card_path,
|
||||
_countof(cfg->card_path),
|
||||
filename);
|
||||
}
|
Reference in New Issue
Block a user