Play Modern worlds in the text console (openbmh_modern_cli)
The console and its desk/window actions are compiled a second time against ModernSession (src/app/session.hpp, OPENBMH_MODERN_SESSION), so a Modern world can be played before the new interface is connected: new career, club picker, desk, live matchday, results, save and load. - The CLI opens a Modern world like the season sim and keys its save folder by the SHA-256 of the world id. - Rollbacks keep the whole session state (app::SessionState) instead of slicing it to GameState, which would drop Modern data. - Club picker: clubs a world adds get unused master ids so the original picker's order stays unique; only German clubs can be confirmed in Modern. Classic openbmh_cli is unchanged (same sources without the switch). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
a11311994d
commit
ce79697b20
13 files changed
+163
-11
No files matched your search
@@ -1,7 +1,7 @@
|
||||
// SPDX-License-Identifier: GPL-3.0-only
|
||||
#pragma once
|
||||
|
||||
#include "app/career_session.hpp"
|
||||
#include "app/session.hpp"
|
||||
|
||||
namespace bmh::app::detail {
|
||||
|
||||
@@ -30,7 +30,8 @@ bool apply_window(CareerSession& session, uint64_t& revision, Checkpoint before,
|
||||
|
||||
inline bool apply_native(CareerSession& session, uint64_t& revision, const std::function<bool()>& action) {
|
||||
return apply_window(session, revision, session.state(),
|
||||
[&](GameState before) { session.state() = std::move(before); }, action);
|
||||
// the whole session state (the Modern one carries more than GameState)
|
||||
[&](SessionState before) { session.state() = std::move(before); }, action);
|
||||
}
|
||||
|
||||
} // namespace bmh::app::detail
|
||||
Reference in new issue
Block a user