diff --git a/server/cardnet.cpp b/server/cardnet.cpp index 69975bd..45a02d6 100644 --- a/server/cardnet.cpp +++ b/server/cardnet.cpp @@ -2,11 +2,10 @@ Compiler: MinGW g++ 6.3.0 (Windows) MinGW g++ 5.3.1 (Ubuntu 16.04) Flags: -std=c++11 -static-libgcc -static-libstdc++ -lws2_32 -Run ex: cardnet.exe -c1="G:\card0.txt" -c2="H:\card0.txt" -l1="G:\check.txt" -l2="H:\check.txt" -p="4500" +Run ex: cardnet.exe -p1="G:\card0.txt" -p2="H:\card0.txt" -c1="G:\check.txt" -c2="H:\check.txt" -p="4500" TODO: Fix extra buffer character (maybe, it occurs in telnet) -Change card0.txt file based on information given by client (p1/p2) */ #include @@ -333,4 +332,17 @@ bool overwriteCard(std::string buffer, std::string location) // check if card exists debugOutput("Card data: " + card + "\n"); + + // try to write card file + std::ofstream cardFile(location); + if(cardFile.is_open()) + { + cardFile << card; + cardFile.close(); + debugOutput("Successfully written card number to: " + location + "\n"); + } + else + { + debugOutput("Unable to write to card in: " + location + "\n"); + } } \ No newline at end of file diff --git a/server/cardnet.exe b/server/cardnet.exe index 2fcc6e0..8d0f2b3 100755 Binary files a/server/cardnet.exe and b/server/cardnet.exe differ