Skip to content

Commit

Permalink
add debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
zyr17 committed Mar 14, 2024
1 parent 17925e8 commit 708706c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/test_macos_PA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
mkdir bin
mkdir bin/release
cd bin/release
cmake ../.. -DCMAKE_BUILD_TYPE=Release
cmake ../.. -DCMAKE_BUILD_TYPE=Debug
make -j
- name: collect
run: |
Expand Down
3 changes: 3 additions & 0 deletions src/analyzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2076,6 +2076,7 @@ void analyzetenhou(const std::string &dataf, const std::string &source, const st
}

void analyzemain(const std::string &dataf, const std::string &source, const std::string &id, CJsonObject &config){
std::cout << "Go into main" << std::endl;
auto &filter = config["filter"];
PaipuAnalyzer pa = PaipuAnalyzer(filter);
int paipunum = 0;
Expand Down Expand Up @@ -2153,7 +2154,9 @@ void analyzemain(const std::string &dataf, const std::string &source, const std:
}
else{
std::vector<CJsonObject*> paipus;
std::cout << "Read paipu file: " << dataf + "/" + source + "/" + id + "/paipus.txt" << std::endl;
auto paipuarr = Algo::ReadJSON(dataf + "/" + source + "/" + id + "/paipus.txt");
std::cout << "Read paipu file success: " << dataf + "/" + source + "/" + id + "/paipus.txt" << std::endl;
for (int i = 0; i < paipuarr.GetArraySize(); i ++ )
paipus.push_back(&paipuarr[i]);
//int step = paipus.size() - 1;
Expand Down
6 changes: 6 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,13 @@ namespace MAIN{
std::cout << "open success: " << dataprefix + "data/" + source << std::endl;
dirent *entry;
while (entry = readdir(dirptr)){
std::cout << "entry id: " << entry -> d_name << std::endl;
ids.push_back(entry -> d_name);
if (*ids.rbegin() == "." || *ids.rbegin() == ".." || *ids.rbegin() == "0")
ids.pop_back();
}
closedir(dirptr);
std::cout << "close success: " << dataprefix + "data/" + source << std::endl;
#else
Out::cout << I18N::get("MAIN", "MACROUNDEFINED") << '\n';
PAUSEEXIT;
Expand Down Expand Up @@ -94,13 +96,16 @@ namespace MAIN{
}
config.Get("id", id);
std::vector<std::string> ids = findid(Header::datafolderprefix, source, id);
std::cout << "ID: " << id << std::endl;
if (!ids.size()){
Out::cout << I18N::get("MISC", "ERROR") + I18N::get("MAIN", "CANTDATA/SRC/*") + source + I18N::get("MAIN", "CANTDATA/SRC/*AFT") + "\n";
PAUSEEXIT;
return 1;
}
std::cout << "Try to print to Out" << std::endl;
Out::cout << '\n';
Out::cout << I18N::get("MAIN", "SRC") + I18N::get("MISC", "COLON") + source + "\n";
std::cout << "Try to print to Out Success" << std::endl;
std::string outputid = id;
#ifdef _WIN32
outputid = Algo::UTF82GBK(outputid);
Expand Down Expand Up @@ -137,6 +142,7 @@ int main(int argc, char *argv[]){
//Algo::testtenpai(); return 0;

auto rcres = readconfig();
std::cout << "Read Config Result: " << rcres << std::endl;
if (rcres == 1) return 0;

if (argc > 1 && argv[1] == std::string("--tenhou-basedata")){
Expand Down

0 comments on commit 708706c

Please sign in to comment.