diff --git a/src/CommandFormats.hh b/src/CommandFormats.hh index 110e56f1..7edd452c 100644 --- a/src/CommandFormats.hh +++ b/src/CommandFormats.hh @@ -7003,11 +7003,10 @@ struct G_ServerVersionStrings_Ep3_6xB4x46 { // 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. pstring date_str2; - // It seems Sega used to send 0 here when starting a battle, and 0x04157580 - // when ending a battle. Since the field is unused by the client, it's not - // clear what that value means, if anything. This behavior may be another - // uninitialized memory bug in the server implementation (of which there are - // many other examples). + // This field contains uninitialized memory when the client generates this + // command. In normal operation, however, the client would never send this; + // it would be handled locally in offline mode, and generated by the server + // in online mode. The client completely ignores this field in either case. le_uint32_t unused = 0; } __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. // TODO: Document this from Episode 3 client/server disassembly -struct G_AddToSetCardlog_Ep3_6xB4x4A { - G_CardBattleCommandHeader header = {0xB4, sizeof(G_AddToSetCardlog_Ep3_6xB4x4A) / 4, 0, 0x4A, 0, 0, 0}; +struct G_AddToSetCardLog_Ep3_6xB4x4A { + 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 // could send up to 0xFF entries, but those after the 8th would not be // byteswapped before the client handles them. @@ -7070,22 +7069,22 @@ struct G_AddToSetCardlog_Ep3_6xB4x4A { uint8_t entry_count = 0; le_uint16_t round_num = 0; parray card_refs; -} __packed_ws__(G_AddToSetCardlog_Ep3_6xB4x4A, 0x1C); +} __packed_ws__(G_AddToSetCardLog_Ep3_6xB4x4A, 0x1C); // 6xB4x4B: Set EX result values // This command is not valid on Episode 3 Trial Edition. // 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 -// were defeated by. (For multi-player opponent teams, the average of the -// opponents' levels is used.) The game scans the appropriate list for the entry -// whose threshold is less than or equal to than the level difference, and -// returns the corresponding value. For example, if the first two entries in the -// win list are {20, 40} and {10, 30}, and the player defeats an opponent who is -// 15 levels above the player's level, the player will get 30 EX when they win -// the battle. If all thresholds are greater than the level difference, the last -// entry's value is used. Finally, if the opponent team has no humans on it, the -// resulting EX values are divided by 2 (so in the example above, the player -// would only get 15 EX for defeating COMs). +// difference between their level and the levels of their opponents. (For +// multi-player opponent teams, the average of the opponents' levels is used.) +// The game scans the appropriate list for the entry whose threshold is less +// than or equal to than the level difference, and returns the corresponding +// value. For example, if the first two entries in the win list are {20, 40} +// and {10, 30}, and the player defeats an opponent who is 15 levels above the +// player's level, the player will get 30 EX when they win the battle. If all +// thresholds are greater than the level difference, the last entry's value is +// used. Finally, if the opponent team has no humans on it, the resulting EX +// values are divided by 2 (so in the example above, the player would only get +// 15 EX for defeating COMs). // 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. diff --git a/src/Episode3/PlayerState.cc b/src/Episode3/PlayerState.cc index 590db8d0..d723ea7b 100644 --- a/src/Episode3/PlayerState.cc +++ b/src/Episode3/PlayerState.cc @@ -1415,7 +1415,7 @@ bool PlayerState::set_card_from_hand( s->send_6xB4x05(); if (!is_nte) { - G_AddToSetCardlog_Ep3_6xB4x4A cmd; + G_AddToSetCardLog_Ep3_6xB4x4A cmd; cmd.card_refs.clear(0xFFFF); cmd.card_refs[0] = card_ref; 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; 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.client_id = this->client_id; 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) { - G_AddToSetCardlog_Ep3_6xB4x4A cmd; + G_AddToSetCardLog_Ep3_6xB4x4A cmd; cmd.card_refs.clear(0xFFFF); cmd.client_id = this->client_id; cmd.round_num = s->get_round_num(); diff --git a/src/Episode3/Server.cc b/src/Episode3/Server.cc index 5a054860..cc82e6bd 100644 --- a/src/Episode3/Server.cc +++ b/src/Episode3/Server.cc @@ -12,7 +12,8 @@ using namespace std; namespace Episode3 { // 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 = "newserv Ep3 based on [V1][FINAL2.0] 03/09/13 15:30 by K.Toya"; static const char* VERSION_SIGNATURE_NTE =