update some comments

This commit is contained in:
Martin Michelsen
2024-09-01 15:13:53 -07:00
parent 07308b192c
commit eaa982aae9
3 changed files with 23 additions and 23 deletions
+18 -19
View File
@@ -7003,11 +7003,10 @@ struct G_ServerVersionStrings_Ep3_6xB4x46 {
// battle, and contains the current time (in the format "YYYY/MM/DD hh:mm:ss") // battle, and contains the current time (in the format "YYYY/MM/DD hh:mm:ss")
// when ending a battle. This may have been used for identifying debug logs. // when ending a battle. This may have been used for identifying debug logs.
pstring<TextEncoding::MARKED, 0x40> date_str2; pstring<TextEncoding::MARKED, 0x40> date_str2;
// It seems Sega used to send 0 here when starting a battle, and 0x04157580 // This field contains uninitialized memory when the client generates this
// when ending a battle. Since the field is unused by the client, it's not // command. In normal operation, however, the client would never send this;
// clear what that value means, if anything. This behavior may be another // it would be handled locally in offline mode, and generated by the server
// uninitialized memory bug in the server implementation (of which there are // in online mode. The client completely ignores this field in either case.
// many other examples).
le_uint32_t unused = 0; le_uint32_t unused = 0;
} __packed_ws__(G_ServerVersionStrings_Ep3_6xB4x46, 0xCC); } __packed_ws__(G_ServerVersionStrings_Ep3_6xB4x46, 0xCC);
@@ -7061,8 +7060,8 @@ struct G_CardCounts_Ep3_CAx49 {
// This command is not valid on Episode 3 Trial Edition. // This command is not valid on Episode 3 Trial Edition.
// TODO: Document this from Episode 3 client/server disassembly // TODO: Document this from Episode 3 client/server disassembly
struct G_AddToSetCardlog_Ep3_6xB4x4A { struct G_AddToSetCardLog_Ep3_6xB4x4A {
G_CardBattleCommandHeader header = {0xB4, sizeof(G_AddToSetCardlog_Ep3_6xB4x4A) / 4, 0, 0x4A, 0, 0, 0}; G_CardBattleCommandHeader header = {0xB4, sizeof(G_AddToSetCardLog_Ep3_6xB4x4A) / 4, 0, 0x4A, 0, 0, 0};
// Note: entry_count appears not to be bounds-checked; presumably the server // Note: entry_count appears not to be bounds-checked; presumably the server
// could send up to 0xFF entries, but those after the 8th would not be // could send up to 0xFF entries, but those after the 8th would not be
// byteswapped before the client handles them. // byteswapped before the client handles them.
@@ -7070,22 +7069,22 @@ struct G_AddToSetCardlog_Ep3_6xB4x4A {
uint8_t entry_count = 0; uint8_t entry_count = 0;
le_uint16_t round_num = 0; le_uint16_t round_num = 0;
parray<le_uint16_t, 8> card_refs; parray<le_uint16_t, 8> card_refs;
} __packed_ws__(G_AddToSetCardlog_Ep3_6xB4x4A, 0x1C); } __packed_ws__(G_AddToSetCardLog_Ep3_6xB4x4A, 0x1C);
// 6xB4x4B: Set EX result values // 6xB4x4B: Set EX result values
// This command is not valid on Episode 3 Trial Edition. // This command is not valid on Episode 3 Trial Edition.
// This command specifies how much EX the player should get based on the // This command specifies how much EX the player should get based on the
// difference between their level and the levels of the players they defeated or // difference between their level and the levels of their opponents. (For
// were defeated by. (For multi-player opponent teams, the average of the // multi-player opponent teams, the average of the opponents' levels is used.)
// opponents' levels is used.) The game scans the appropriate list for the entry // The game scans the appropriate list for the entry whose threshold is less
// whose threshold is less than or equal to than the level difference, and // than or equal to than the level difference, and returns the corresponding
// returns the corresponding value. For example, if the first two entries in the // value. For example, if the first two entries in the win list are {20, 40}
// win list are {20, 40} and {10, 30}, and the player defeats an opponent who is // and {10, 30}, and the player defeats an opponent who is 15 levels above the
// 15 levels above the player's level, the player will get 30 EX when they win // player's level, the player will get 30 EX when they win the battle. If all
// the battle. If all thresholds are greater than the level difference, the last // thresholds are greater than the level difference, the last entry's value is
// entry's value is used. Finally, if the opponent team has no humans on it, the // used. Finally, if the opponent team has no humans on it, the resulting EX
// resulting EX values are divided by 2 (so in the example above, the player // values are divided by 2 (so in the example above, the player would only get
// would only get 15 EX for defeating COMs). // 15 EX for defeating COMs).
// If any entry in either list has .value < -100 or > 100, the entire command is // If any entry in either list has .value < -100 or > 100, the entire command is
// ignored and the EX thresholds and values are reset to their default values. // ignored and the EX thresholds and values are reset to their default values.
+3 -3
View File
@@ -1415,7 +1415,7 @@ bool PlayerState::set_card_from_hand(
s->send_6xB4x05(); s->send_6xB4x05();
if (!is_nte) { if (!is_nte) {
G_AddToSetCardlog_Ep3_6xB4x4A cmd; G_AddToSetCardLog_Ep3_6xB4x4A cmd;
cmd.card_refs.clear(0xFFFF); cmd.card_refs.clear(0xFFFF);
cmd.card_refs[0] = card_ref; cmd.card_refs[0] = card_ref;
cmd.client_id = this->client_id; cmd.client_id = this->client_id;
@@ -1782,7 +1782,7 @@ bool PlayerState::set_action_cards_for_action_state(const ActionState& pa) {
card->loc.direction = pa.facing_direction; card->loc.direction = pa.facing_direction;
log.debug("set facing direction to %s", phosg::name_for_enum(card->loc.direction)); log.debug("set facing direction to %s", phosg::name_for_enum(card->loc.direction));
G_AddToSetCardlog_Ep3_6xB4x4A cmd; G_AddToSetCardLog_Ep3_6xB4x4A cmd;
cmd.card_refs.clear(0xFFFF); cmd.card_refs.clear(0xFFFF);
cmd.client_id = this->client_id; cmd.client_id = this->client_id;
cmd.round_num = s->get_round_num(); cmd.round_num = s->get_round_num();
@@ -1842,7 +1842,7 @@ bool PlayerState::set_action_cards_for_action_state(const ActionState& pa) {
} }
} }
if (!is_nte) { if (!is_nte) {
G_AddToSetCardlog_Ep3_6xB4x4A cmd; G_AddToSetCardLog_Ep3_6xB4x4A cmd;
cmd.card_refs.clear(0xFFFF); cmd.card_refs.clear(0xFFFF);
cmd.client_id = this->client_id; cmd.client_id = this->client_id;
cmd.round_num = s->get_round_num(); cmd.round_num = s->get_round_num();
+2 -1
View File
@@ -12,7 +12,8 @@ using namespace std;
namespace Episode3 { namespace Episode3 {
// This is (obviously) not the original string. The original string is: // This is (obviously) not the original string. The original string is:
// "[V1][FINAL2.0] 03/09/13 15:30 by K.Toya" // "03/05/29 18:00 by K.Toya" (NTE)
// "[V1][FINAL2.0] 03/09/13 15:30 by K.Toya" (Final)
static const char* VERSION_SIGNATURE = static const char* VERSION_SIGNATURE =
"newserv Ep3 based on [V1][FINAL2.0] 03/09/13 15:30 by K.Toya"; "newserv Ep3 based on [V1][FINAL2.0] 03/09/13 15:30 by K.Toya";
static const char* VERSION_SIGNATURE_NTE = static const char* VERSION_SIGNATURE_NTE =