diff --git a/README.md b/README.md index 22ab38ee..80252985 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # newserv -newserv is a game server and proxy for Phantasy Star Online (PSO). +newserv is a game server, proxy, and reverse-engineering tool for Phantasy Star Online (PSO). This project includes code that was reverse-engineered by the community in ages long past, and has been included in many projects since then. It also includes some game data from Phantasy Star Online itself, which was originally created by Sega. diff --git a/src/PlayerSubordinates.hh b/src/PlayerSubordinates.hh index ee2a36c9..76d62e09 100644 --- a/src/PlayerSubordinates.hh +++ b/src/PlayerSubordinates.hh @@ -30,8 +30,8 @@ extern FileContentsCache player_files_cache; // levels (so a level 20 tech would have 14 in technique_levels_v1 and 5 // in the corresponding item's extension_data1 field). // items[0].extension_data2 through items[3].extension_data2: -// The value known as unknown_a1 in the PSOGCCharacterFile::Character -// struct. See SaveFileFormats.hh. +// The flags field from the PSOGCCharacterFile::Character struct; see +// SaveFileFormats.hh for details. // items[4].extension_data2 through items[7].extension_data2: // The timestamp when the character was last saved, in seconds since // January 1, 2000. Stored little-endian, so items[4] contains the LSB. @@ -107,7 +107,7 @@ struct PlayerStats { struct PlayerVisualConfig { /* 00 */ ptext name; - /* 10 */ le_uint64_t unknown_a2 = 0; // Note: This is probably not actually a 64-bit int. + /* 10 */ parray unknown_a2; /* 18 */ le_uint32_t name_color = 0x00000000; // RGBA /* 1C */ uint8_t extra_model = 0; /* 1D */ parray unused; diff --git a/src/QuestScript.cc b/src/QuestScript.cc index 37e0c111..15a6b821 100644 --- a/src/QuestScript.cc +++ b/src/QuestScript.cc @@ -1400,7 +1400,8 @@ std::string disassemble_quest_script(const void* data, size_t size, QuestScriptV string name = format_data_string(visual.name); lines.emplace_back(string_printf(" %04zX name %s", l->offset + offsetof(PlayerVisualConfig, name), name.c_str())); lines.emplace_back(string_printf(" %04zX name_color %08" PRIX32, l->offset + offsetof(PlayerVisualConfig, name_color), visual.name_color.load())); - lines.emplace_back(string_printf(" %04zX a2 %016" PRIX64, l->offset + offsetof(PlayerVisualConfig, unknown_a2), visual.unknown_a2.load())); + string a2_str = format_data_string(visual.unknown_a2.data(), sizeof(visual.unknown_a2)); + lines.emplace_back(string_printf(" %04zX a2 %s", l->offset + offsetof(PlayerVisualConfig, unknown_a2), a2_str.c_str())); lines.emplace_back(string_printf(" %04zX extra_model %02hhX", l->offset + offsetof(PlayerVisualConfig, extra_model), visual.extra_model)); string unused = format_data_string(visual.unused.data(), visual.unused.bytes()); lines.emplace_back(string_printf(" %04zX unused %s", l->offset + offsetof(PlayerVisualConfig, unused), unused.c_str())); diff --git a/src/SaveFileFormats.hh b/src/SaveFileFormats.hh index e642e6e4..56db5406 100644 --- a/src/SaveFileFormats.hh +++ b/src/SaveFileFormats.hh @@ -170,7 +170,11 @@ struct PSOGCCharacterFile { // to the start of the second internal structure (second column). /* 0000:---- */ PlayerInventory inventory; /* 034C:---- */ PlayerDispDataDCPCV3 disp; - /* 041C:0000 */ be_uint32_t unknown_a1; + // Known bits in the flags field: + // 00000001: Character was not saved after disconnecting (and the message + // about items being deleted is shown in the select menu) + // 00000002: Used for something, but it's not known what it does + /* 041C:0000 */ be_uint32_t flags; /* 0420:0004 */ be_uint32_t creation_timestamp; // The signature field holds the value 0xA205B064, which is 2718281828 in // decimal - approximately e * 10^9. It's unknown why Sega chose this value.