Skip to content

Commit

Permalink
feat: add GameDownloader class for managing game downloads and updates
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterLaplace committed Dec 10, 2024
1 parent 484bff5 commit 63430ca
Show file tree
Hide file tree
Showing 3 changed files with 56 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ set(SOURCES
Flakkari/Server/Game/ResourceManager.cpp

Flakkari/Server/Internals/CommandManager.cpp
Flakkari/Server/Internals/GameDownloader.cpp
)

set(HEADERS
Expand Down Expand Up @@ -71,6 +72,7 @@ set(HEADERS
Flakkari/Server/Game/ResourceManager.hpp

Flakkari/Server/Internals/CommandManager.hpp
Flakkari/Server/Internals/GameDownloader.hpp
)

set(HEADER_LIB_LOGGER
Expand Down
3 changes: 3 additions & 0 deletions Flakkari/Server/Internals/GameDownloader.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#include "GameDownloader.hpp"

using namespace Flakkari::Internals;
51 changes: 51 additions & 0 deletions Flakkari/Server/Internals/GameDownloader.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/**************************************************************************
* Flakkari Library v0.5.0
*
* Flakkari Library is a C++ Library for Network.
* @file GameDownloader.hpp
* @brief GameDownloader is a class that downloads games from the remote
* repository and stores them in the Games folder.
* It also updates the games if they are already present and removes them
* if they are not present in the remote repository.
*
* Flakkari Library is under MIT License.
* https://opensource.org/licenses/MIT
* © 2023 @MasterLaplace
* @version 0.5.0
* @date 2024-12-09
**************************************************************************/

#ifndef GAMEDOWNLOADER_HPP_
#define GAMEDOWNLOADER_HPP_

#include <cstdio>
#include <cstdlib>
#include <regex>

#include "../Game/GameManager.hpp"
#include "config.h.in"


namespace Flakkari::Internals {

class GameDownloader {
public:
/**
* @brief Construct a new Game Downloader object
*
*/
GameDownloader(const std::string &gameDir) : _gameDir(gameDir) {}

/**
* @brief Destroy the Game Downloader object
*
*/
~GameDownloader() = default;

private:
std::string _gameDir;
};

} // namespace Flakkari::Internals

#endif /* !GAMEDOWNLOADER_HPP_ */

0 comments on commit 63430ca

Please sign in to comment.