Set a unique System Name

This commit is contained in:
Florin9doi 2024-04-14 22:46:43 +03:00 committed by Elad Ashkenazi
parent e48ec75896
commit e0d6f8a311
3 changed files with 10 additions and 0 deletions

View File

@ -469,6 +469,7 @@ error_code cellSysutilGetSystemParamString(CellSysutilParamId id, vm::ptr<char>
case CELL_SYSUTIL_SYSTEMPARAM_ID_NICKNAME:
{
copy_size = CELL_SYSUTIL_SYSTEMPARAM_NICKNAME_SIZE;
param_str = g_cfg.sys.system_name.to_string();
break;
}

View File

@ -10,3 +10,9 @@ bool cfg_root::node_core::enable_tsx_by_default()
{
return utils::has_rtm() && utils::has_mpx() && !utils::has_tsx_force_abort();
}
std::string cfg_root::node_sys::get_random_system_name()
{
std::srand(std::time(nullptr));
return "RPCS3-" + std::to_string(100 + std::rand() % 899);
}

View File

@ -287,6 +287,8 @@ struct cfg_root : cfg::node
struct node_sys : cfg::node
{
static std::string get_random_system_name();
node_sys(cfg::node* _this) : cfg::node(_this, "System") {}
cfg::_enum<CellSysutilLicenseArea> license_area{ this, "License Area", CellSysutilLicenseArea{1} }; // CELL_SYSUTIL_LICENSE_AREA_A
@ -294,6 +296,7 @@ struct cfg_root : cfg::node
cfg::_enum<CellKbMappingType> keyboard_type{ this, "Keyboard Type", CellKbMappingType{0} }; // CELL_KB_MAPPING_101 = US
cfg::_enum<enter_button_assign> enter_button_assignment{ this, "Enter button assignment", enter_button_assign::cross };
cfg::_int<-60*60*24*365*100LL, 60*60*24*365*100LL> console_time_offset{ this, "Console time offset (s)", 0 }; // console time offset, limited to +/-100years
cfg::string system_name{this, "System Name", get_random_system_name()};
cfg::uint<0, umax> console_psid_high{this, "PSID high"};
cfg::uint<0, umax> console_psid_low{this, "PSID low"};
cfg::string hdd_model{this, "HDD Model Name", ""};