Kudos to Shiz for providing the groundwork for this. Fundamentally re-think how launcher operates and bootstrapping the games is managed and configured. This brings it significantly closer to how the original bootstrap is doing the job: launcher now utilizes the data (structures) provided by the bootstrap.xml configuration file. This creates compatibility with vanilla data dumps and original stock images. Note that bemanitools does not include any code or means to run DRM'd data, only decrypted. But, this allows users to keep decrypted dumps as stock as possible which means: * No copying around of property files anymore * Keep the modules/ folder with the binaries * Have bemanitools binaries separate in the data * No need to edit/customize the original configuration files A list of key features of the "new" launcher: * Boostrap games by following the configuration provided by stock game's bootstrap.xml files * Custom launcher.xml configuration file that adds further launcher configurable features, composability of bootstrap.xml configuration(s) as well as configuration overriding/stacking of selected types of configurations, e.g. eamuse config, avs-config. The latter eliminates the need for modifying stock config files in the prop/ folder * Unified logging system: launcher and AVS logging uses the same logger, all output can now be in a single file * Original features such as various hook types still available Due to the significant architectural changes, this also breaks with any backwards compatibility to existing launcher setups. Thus, users need to migrate by re-applying the new configuration format and migrating their config parameters accordingly. Further migration instructions and updated documentation will be provided upon release. Co-authored-by: Shiz <hi@shiz.me>
104 lines
2.6 KiB
C
104 lines
2.6 KiB
C
#define LOG_MODULE "ea3-ident-config"
|
|
|
|
#include <string.h>
|
|
|
|
#include "core/log.h"
|
|
|
|
#include "imports/avs.h"
|
|
|
|
#include "launcher/ea3-ident-config.h"
|
|
#include "launcher/property-util.h"
|
|
|
|
#include "util/defs.h"
|
|
#include "util/hex.h"
|
|
#include "util/str.h"
|
|
|
|
#define ROOT_NODE "/ea3_conf"
|
|
|
|
PSMAP_BEGIN(ea3_ident_config_psmap)
|
|
PSMAP_OPTIONAL(
|
|
PSMAP_TYPE_STR, struct ea3_ident_config, softid, "/id/softid", "")
|
|
PSMAP_OPTIONAL(
|
|
PSMAP_TYPE_STR, struct ea3_ident_config, hardid, "/id/hardid", "")
|
|
PSMAP_OPTIONAL(PSMAP_TYPE_STR, struct ea3_ident_config, pcbid, "/id/pcbid", "")
|
|
PSMAP_REQUIRED(PSMAP_TYPE_STR, struct ea3_ident_config, model, "/soft/model")
|
|
PSMAP_REQUIRED(PSMAP_TYPE_STR, struct ea3_ident_config, dest, "/soft/dest")
|
|
PSMAP_REQUIRED(PSMAP_TYPE_STR, struct ea3_ident_config, spec, "/soft/spec")
|
|
PSMAP_REQUIRED(PSMAP_TYPE_STR, struct ea3_ident_config, rev, "/soft/rev")
|
|
PSMAP_REQUIRED(PSMAP_TYPE_STR, struct ea3_ident_config, ext, "/soft/ext")
|
|
PSMAP_END
|
|
|
|
void ea3_ident_config_init(struct ea3_ident_config *config)
|
|
{
|
|
memset(config, 0, sizeof(*config));
|
|
}
|
|
|
|
void ea3_ident_config_from_file_load(
|
|
const char *path, struct ea3_ident_config *config)
|
|
{
|
|
struct property *property;
|
|
|
|
log_assert(path);
|
|
log_assert(config);
|
|
|
|
log_info("Loading from file path: %s", path);
|
|
|
|
property = property_util_load(path);
|
|
|
|
ea3_ident_config_load(property, config);
|
|
|
|
property_util_free(property);
|
|
}
|
|
|
|
void ea3_ident_config_load(
|
|
struct property *property, struct ea3_ident_config *config)
|
|
{
|
|
struct property_node *node;
|
|
|
|
log_assert(property);
|
|
log_assert(config);
|
|
|
|
node = property_search(property, NULL, ROOT_NODE);
|
|
|
|
if (node == NULL) {
|
|
log_fatal("Root node '" ROOT_NODE "' missing");
|
|
}
|
|
|
|
if (!property_psmap_import(
|
|
property, node, config, ea3_ident_config_psmap)) {
|
|
log_fatal("Error reading config file");
|
|
}
|
|
}
|
|
|
|
bool ea3_ident_config_hardid_is_defined(struct ea3_ident_config *config)
|
|
{
|
|
log_assert(config);
|
|
|
|
return strlen(config->hardid) > 0;
|
|
}
|
|
|
|
void ea3_ident_config_hardid_from_ethernet_set(struct ea3_ident_config *config)
|
|
{
|
|
struct avs_net_interface netif;
|
|
int result;
|
|
|
|
log_assert(config);
|
|
|
|
result = avs_net_ctrl(1, &netif, sizeof(netif));
|
|
|
|
if (result < 0) {
|
|
log_fatal(
|
|
"avs_net_ctrl call to get MAC address returned error: %d", result);
|
|
}
|
|
|
|
config->hardid[0] = '0';
|
|
config->hardid[1] = '1';
|
|
config->hardid[2] = '0';
|
|
config->hardid[3] = '0';
|
|
|
|
hex_encode_uc(
|
|
netif.mac_addr,
|
|
sizeof(netif.mac_addr),
|
|
config->hardid + 4,
|
|
sizeof(config->hardid) - 4);
|
|
} |