rewrite text encoding to handle non-English properly

This commit is contained in:
Martin Michelsen
2023-10-24 12:02:22 -07:00
parent 6b97c628ef
commit 0c53a0dc41
65 changed files with 2483 additions and 2731 deletions
+3 -3
View File
@@ -138,7 +138,7 @@ shared_ptr<SavedAccountDataBB> ClientGameData::account(bool allow_load) {
if (!this->account_data.get() && allow_load) {
if (this->bb_username.empty()) {
this->account_data.reset(new SavedAccountDataBB());
this->account_data->signature = ACCOUNT_FILE_SIGNATURE;
this->account_data->signature.encode(ACCOUNT_FILE_SIGNATURE);
} else {
this->load_account_data();
}
@@ -223,7 +223,7 @@ void ClientGameData::load_account_data() {
try {
data.reset(new SavedAccountDataBB(
player_files_cache.get_obj_or_load<SavedAccountDataBB>(filename).obj));
if (data->signature != ACCOUNT_FILE_SIGNATURE) {
if (!data->signature.eq(ACCOUNT_FILE_SIGNATURE)) {
throw runtime_error("account data header is incorrect");
}
player_data_log.info("Loaded account data file %s", filename.c_str());
@@ -236,7 +236,7 @@ void ClientGameData::load_account_data() {
player_files_cache.get_obj_or_load<SavedAccountDataBB>(
"system/players/default.nsa")
.obj));
if (data->signature != ACCOUNT_FILE_SIGNATURE) {
if (!data->signature.eq(ACCOUNT_FILE_SIGNATURE)) {
throw runtime_error("default account data header is incorrect");
}
player_data_log.info("Loaded default account data file");