Skip to content

Commit 1c9a910

Browse files
committed
SQLite tests and CMakeLists Binary Path
1 parent b2b1da2 commit 1c9a910

File tree

5 files changed

+503
-48
lines changed

5 files changed

+503
-48
lines changed

CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ add_subdirectory(LeagueAPI)
1010
add_subdirectory(sqlite)
1111
include_directories("${PROJECT_SOURCE_DIR}/sqlite")
1212

13+
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/bin)
14+
1315
add_executable(VoliBot
1416
src/main.cpp
1517
src/common.hpp

LeagueAPI

src/BotEvents.hpp

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,52 @@
4848
#include <lol/op/DeleteLolLeaverBusterV1NotificationsById.hpp>
4949
#include <lol/op/GetLolMatchmakingV1SearchErrors.hpp>
5050

51+
#include "../sqlite/sqlite_orm.h"
52+
53+
using namespace sqlite_orm;
54+
5155
namespace voli {
5256

5357
static voli::VoliServer *server;
5458
static voli::InstanceManager *manager;
5559

60+
struct Account {
61+
int id;
62+
std::string username;
63+
std::string password;
64+
std::string region;
65+
int maxlvl;
66+
int maxbe;
67+
std::string status;
68+
};
69+
70+
static std::vector<Account> accounts;
71+
72+
static inline auto initStorage(const std::string &path) {
73+
using namespace sqlite_orm;
74+
return make_storage(path,
75+
make_table("Accounts",
76+
make_column("Id",
77+
&Account::id,
78+
primary_key()),
79+
make_column("username",
80+
&Account::username),
81+
make_column("password",
82+
&Account::password),
83+
make_column("region",
84+
&Account::region),
85+
make_column("maxlevel",
86+
&Account::maxlvl),
87+
make_column("maxbe",
88+
&Account::maxbe),
89+
make_column("status",
90+
&Account::status)));
91+
}
92+
93+
94+
typedef decltype(initStorage("")) Storage;
95+
static std::shared_ptr<Storage> database;
96+
5697
static void checkUpdate(voli::LeagueInstance& c) {
5798
auto state = lol::GetPatcherV1ProductsByProductIdState(c, "league_of_legends");
5899
if (state->isCorrupted) {

0 commit comments

Comments
 (0)