MCPcopy Create free account
hub / github.com/EasyRPG/Player / LogSource

Method LogSource

src/input_source.cpp:85–107  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85Input::LogSource::LogSource(const char* log_path, const Game_ConfigInput& cfg, DirectionMappingArray directions)
86 : Source(cfg, std::move(directions)),
87 log_file(FileFinder::Root().OpenInputStream(log_path, std::ios::in))
88{
89 if (!log_file) {
90 Output::Error("Error reading input logfile {}", log_path);
91 return;
92 }
93
94 std::string header;
95 Utils::ReadLine(log_file, header);
96 if (StartsWith(header, "H EasyRPG")) {
97 std::string ver;
98 Utils::ReadLine(log_file, ver);
99 if (StartsWith(ver, "V 2")) {
100 version = 2;
101 } else {
102 Output::Error("Unsupported logfile version {}", ver);
103 }
104 } else {
105 Output::Debug("Using legacy inputlog format");
106 }
107}
108
109void Input::LogSource::Update() {
110 if (version == 2) {

Callers

nothing calls this directly

Calls 1

OpenInputStreamMethod · 0.80

Tested by

no test coverage detected