From 2dca523a4b9279fc5ceff7cc5633b05df366030a Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Sun, 1 Oct 2023 21:40:28 -0700 Subject: [PATCH] clean up comment about Ep3 reverse-engineering --- src/Episode3/DataIndexes.hh | 6 +----- src/Episode3/Server.cc | 4 ++-- src/Episode3/Server.hh | 19 +++++++++++++------ src/Episode3/Tournament.hh | 2 -- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/src/Episode3/DataIndexes.hh b/src/Episode3/DataIndexes.hh index 84824832..0c97266f 100644 --- a/src/Episode3/DataIndexes.hh +++ b/src/Episode3/DataIndexes.hh @@ -18,10 +18,6 @@ namespace Episode3 { -// The comment in Server.hh does not apply to this file (and DataIndexes.cc). -// Except for the Location structure, these structures and functions are not -// based on Sega's original implementation. - class CardIndex; class MapIndex; class COMDeckIndex; @@ -638,7 +634,7 @@ struct CardDefinition { // The game then samples N card IDs from the appropriate buckets (where N is // the number chosen above), but for the first 1 or 2 cards, it applies the // restriction described above and re-draws if the card is the wrong type. - // After sampling the N card IDs, it shuffles them and presents them to the + // After sampling the N card IDs, it sorts them and presents them to the // player. // // There is one more effect to consider after cards are chosen: cards may diff --git a/src/Episode3/Server.cc b/src/Episode3/Server.cc index 167e44dc..a45b9423 100644 --- a/src/Episode3/Server.cc +++ b/src/Episode3/Server.cc @@ -1621,14 +1621,14 @@ void Server::on_server_data_input(const string& data) { throw runtime_error("command is incomplete"); } if (header.subcommand != 0xB3) { - throw runtime_error("server data command is not B3"); + throw runtime_error("server data command is not 6xB3"); } handler_t handler = nullptr; try { handler = this->subcommand_handlers.at(header.subsubcommand); } catch (const out_of_range&) { - throw runtime_error("unknown CAxB3 subsubcommand"); + throw runtime_error("unknown CAx subsubcommand"); } string unmasked_data = data; diff --git a/src/Episode3/Server.hh b/src/Episode3/Server.hh index f538e4cd..892d19de 100644 --- a/src/Episode3/Server.hh +++ b/src/Episode3/Server.hh @@ -19,17 +19,24 @@ struct Lobby; namespace Episode3 { /** - * This implementation of Episode 3 battles (contained in all files in the - * src/Episode3 directory, except for DataIndexes.hh/cc) is derived from Sega's - * original server implementation, reverse-engineered from the Episode 3 client + * This implementation of Episode 3 battles is derived from Sega's original + * server implementation, reverse-engineered from the Episode 3 client * executable. The control flow, function breakdown, and structure definitions * in these files map very closely to how their server implementation was * written; notable differences (due to necessary environment differences or bug * fixes) are described in the comments therein. * - * Some debugging functions have been added which are not part of the original - * implementation. Notably, this applies to functions like debug message senders - * and loggers and all str() functions. + * The following files are direct reverse-engineerings of Sega's original code, + * except where noted in the comments: + * AssistServer.hh/cc + * Card.hh/cc + * CardSpecial.hh/cc + * DeckState.hh/cc + * MapState.hh/cc + * PlayerState.hh/cc + * PlayerStateSubordinates.hh/cc + * RulerServer.hh/cc + * Server.hh/cc * * There are likely undiscovered bugs in this code, some originally written by * Sega, but more written by me as I manually transcribed and updated this code. diff --git a/src/Episode3/Tournament.hh b/src/Episode3/Tournament.hh index f5575bd7..e168b812 100644 --- a/src/Episode3/Tournament.hh +++ b/src/Episode3/Tournament.hh @@ -18,8 +18,6 @@ struct ServerState; namespace Episode3 { -// The comment in Server.hh does not apply to this file (and Tournament.cc). - class Tournament : public std::enable_shared_from_this { public: enum Flag : uint8_t {