OpenKO Database Model
Table- and column-level documentation generated from the jsonSchema
Loading...
Searching...
No Matches
AujardModel.h
1#ifndef AUJARD_MODEL_AUJARDMODEL_H
2#define AUJARD_MODEL_AUJARDMODEL_H
3
4#pragma once
5
6#include <ModelUtil/ModelUtil.h>
7#include <cstdint>
8#include <optional>
9#include <string>
10#include <unordered_set>
11#include <vector>
12
13namespace aujard_binder
14{
15 class Battle;
16 class CurrentUser;
17 class Item;
18 class Knights;
19 class UserData;
20 class Warehouse;
21}
22
23namespace aujard_model
24{
28 class Battle
29 {
31 public:
32 using BinderType = aujard_binder::Battle;
33
37 int16_t Index = {};
38
42 uint8_t Nation = {};
43
47 std::optional<std::string> UserName;
48
50 static const std::string& TableName();
51
53 static const std::unordered_set<std::string>& ColumnNames();
54
56 static const std::vector<std::string>& OrderedColumnNames();
57
59 static const std::unordered_set<std::string>& BlobColumns();
60
63
65 static const std::vector<std::string>& PrimaryKey();
66
68 const int16_t& MapKey() const;
69
70 };
71
76 {
78 public:
79 using BinderType = aujard_binder::CurrentUser;
80
84 int32_t ServerId = {};
85
89 std::string ServerIP;
90
94 std::string AccountId;
95
99 std::string CharId;
100
104 std::string ClientIP;
105
107 static const std::string& TableName();
108
110 static const std::unordered_set<std::string>& ColumnNames();
111
113 static const std::vector<std::string>& OrderedColumnNames();
114
116 static const std::unordered_set<std::string>& BlobColumns();
117
119 static modelUtil::DbType DbType();
120
122 static const std::vector<std::string>& PrimaryKey();
123
125 const std::string& MapKey() const;
126
127 };
128
132 class Item
133 {
135 public:
136 using BinderType = aujard_binder::Item;
137
141 int32_t ID = {};
142
147 uint8_t Countable = {};
148
151 enum class EnumCountable
152 {
153 NonStackable = 0,
154 Stackable = 1,
155 Coins = 2
156 };
157
159 static const std::string& TableName();
160
162 static const std::unordered_set<std::string>& ColumnNames();
163
165 static const std::vector<std::string>& OrderedColumnNames();
166
168 static const std::unordered_set<std::string>& BlobColumns();
169
171 static modelUtil::DbType DbType();
172
174 static const std::vector<std::string>& PrimaryKey();
175
177 const int32_t& MapKey() const;
178
179 };
180
184 class Knights
185 {
187 public:
188 using BinderType = aujard_binder::Knights;
189
193 int16_t ID = {};
194
198 uint8_t Nation = {};
199
203 uint8_t Ranking = {};
204
208 std::string Name;
209
213 int16_t Members = {};
214
218 int32_t Points = {};
219
221 static const std::string& TableName();
222
224 static const std::unordered_set<std::string>& ColumnNames();
225
227 static const std::vector<std::string>& OrderedColumnNames();
228
230 static const std::unordered_set<std::string>& BlobColumns();
231
233 static modelUtil::DbType DbType();
234
236 static const std::vector<std::string>& PrimaryKey();
237
239 const int16_t& MapKey() const;
240
241 };
242
246 class UserData
247 {
249 public:
250 using BinderType = aujard_binder::UserData;
251
255 std::string UserId;
256
260 int32_t Exp = {};
261
265 int32_t DwTime = {};
266
268 static const std::string& TableName();
269
271 static const std::unordered_set<std::string>& ColumnNames();
272
274 static const std::vector<std::string>& OrderedColumnNames();
275
277 static const std::unordered_set<std::string>& BlobColumns();
278
280 static modelUtil::DbType DbType();
281
283 static const std::vector<std::string>& PrimaryKey();
284
286 const std::string& MapKey() const;
287
288 };
289
294 {
296 public:
297 using BinderType = aujard_binder::Warehouse;
298
302 std::string AccountId;
303
307 int32_t Money = {};
308
312 int32_t DwTime = {};
313
317 std::optional<std::vector<uint8_t>> ItemData;
318
322 std::optional<std::vector<uint8_t>> Serial;
323
325 static const std::string& TableName();
326
328 static const std::unordered_set<std::string>& ColumnNames();
329
331 static const std::vector<std::string>& OrderedColumnNames();
332
334 static const std::unordered_set<std::string>& BlobColumns();
335
337 static modelUtil::DbType DbType();
338
340 static const std::vector<std::string>& PrimaryKey();
341
343 const std::string& MapKey() const;
344
345 };
346}
347
348#endif // AUJARD_MODEL_AUJARDMODEL_H
generated nanodbc column binder for aujard_model::Battle
Definition AujardBinder.h:29
generated nanodbc column binder for aujard_model::CurrentUser
Definition AujardBinder.h:52
generated nanodbc column binder for aujard_model::Item
Definition AujardBinder.h:81
generated nanodbc column binder for aujard_model::Knights
Definition AujardBinder.h:101
generated nanodbc column binder for aujard_model::UserData
Definition AujardBinder.h:133
generated nanodbc column binder for aujard_model::Warehouse
Definition AujardBinder.h:156
[BATTLE] Battle data for the game server
Definition AujardModel.h:29
static const std::vector< std::string > & PrimaryKey()
Returns the columns associated with the table's Primary Key.
Definition AujardModel.cpp:49
static const std::unordered_set< std::string > & BlobColumns()
Returns a set of blob column names for the table.
Definition AujardModel.cpp:33
static const std::string & TableName()
Returns the table name.
Definition AujardModel.cpp:6
static const std::unordered_set< std::string > & ColumnNames()
Returns a set of column names for the table.
Definition AujardModel.cpp:13
std::optional< std::string > UserName
Column [strUserName]: User Name.
Definition AujardModel.h:47
static const std::vector< std::string > & OrderedColumnNames()
Returns an ordered vector of column names for the table.
Definition AujardModel.cpp:23
int16_t Index
Column [sIndex]: Server Index.
Definition AujardModel.h:37
uint8_t Nation
Column [byNation]: Nation Identifier.
Definition AujardModel.h:42
const int16_t & MapKey() const
Returns a value for use in map keys based on the table's primary key.
Definition AujardModel.cpp:59
static modelUtil::DbType DbType()
Returns the associated database type for the table.
Definition AujardModel.cpp:43
[CURRENTUSER] Keeps track of users currently connected to the server
Definition AujardModel.h:76
static const std::unordered_set< std::string > & ColumnNames()
Returns a set of column names for the table.
Definition AujardModel.cpp:71
std::string ServerIP
Column [strServerIP]: Server IP Address.
Definition AujardModel.h:89
const std::string & MapKey() const
Returns a value for use in map keys based on the table's primary key.
Definition AujardModel.cpp:117
static const std::string & TableName()
Returns the table name.
Definition AujardModel.cpp:64
std::string AccountId
Column [strAccountID]: User Account Identifier.
Definition AujardModel.h:94
static const std::unordered_set< std::string > & BlobColumns()
Returns a set of blob column names for the table.
Definition AujardModel.cpp:91
int32_t ServerId
Column [nServerNo]: Server Index.
Definition AujardModel.h:84
static const std::vector< std::string > & OrderedColumnNames()
Returns an ordered vector of column names for the table.
Definition AujardModel.cpp:81
std::string ClientIP
Column [strClientIP]: User IP Address.
Definition AujardModel.h:104
static const std::vector< std::string > & PrimaryKey()
Returns the columns associated with the table's Primary Key.
Definition AujardModel.cpp:107
std::string CharId
Column [strCharID]: User Character Name.
Definition AujardModel.h:99
static modelUtil::DbType DbType()
Returns the associated database type for the table.
Definition AujardModel.cpp:101
[ITEM] Item information
Definition AujardModel.h:133
uint8_t Countable
Column [Countable]: Price at which item can be sold to a merchant.
Definition AujardModel.h:147
int32_t ID
Column [Num]: Item number.
Definition AujardModel.h:141
static const std::vector< std::string > & OrderedColumnNames()
Returns an ordered vector of column names for the table.
Definition AujardModel.cpp:139
static modelUtil::DbType DbType()
Returns the associated database type for the table.
Definition AujardModel.cpp:159
static const std::vector< std::string > & PrimaryKey()
Returns the columns associated with the table's Primary Key.
Definition AujardModel.cpp:165
static const std::unordered_set< std::string > & BlobColumns()
Returns a set of blob column names for the table.
Definition AujardModel.cpp:149
static const std::unordered_set< std::string > & ColumnNames()
Returns a set of column names for the table.
Definition AujardModel.cpp:129
static const std::string & TableName()
Returns the table name.
Definition AujardModel.cpp:122
const int32_t & MapKey() const
Returns a value for use in map keys based on the table's primary key.
Definition AujardModel.cpp:175
EnumCountable
Known valid values for Countable.
Definition AujardModel.h:152
[KNIGHTS] Knights are the clan/guild system of the game
Definition AujardModel.h:185
int32_t Points
Column [Points]: National points.
Definition AujardModel.h:218
int16_t ID
Column [IDNum]: Identification number.
Definition AujardModel.h:193
uint8_t Nation
Column [Nation]: Nation identifier.
Definition AujardModel.h:198
static const std::vector< std::string > & OrderedColumnNames()
Returns an ordered vector of column names for the table.
Definition AujardModel.cpp:197
static modelUtil::DbType DbType()
Returns the associated database type for the table.
Definition AujardModel.cpp:217
uint8_t Ranking
Column [Ranking]: Ranking by sum of members National Points.
Definition AujardModel.h:203
static const std::unordered_set< std::string > & BlobColumns()
Returns a set of blob column names for the table.
Definition AujardModel.cpp:207
int16_t Members
Column [Members]: Member count.
Definition AujardModel.h:213
static const std::string & TableName()
Returns the table name.
Definition AujardModel.cpp:180
static const std::unordered_set< std::string > & ColumnNames()
Returns a set of column names for the table.
Definition AujardModel.cpp:187
std::string Name
Column [IDName]: Name of the Knights clan.
Definition AujardModel.h:208
const int16_t & MapKey() const
Returns a value for use in map keys based on the table's primary key.
Definition AujardModel.cpp:233
static const std::vector< std::string > & PrimaryKey()
Returns the columns associated with the table's Primary Key.
Definition AujardModel.cpp:223
[USERDATA] User data contains saved character information
Definition AujardModel.h:247
int32_t DwTime
Column [dwTime]: DwTime TODO.
Definition AujardModel.h:265
static const std::vector< std::string > & OrderedColumnNames()
Returns an ordered vector of column names for the table.
Definition AujardModel.cpp:255
const std::string & MapKey() const
Returns a value for use in map keys based on the table's primary key.
Definition AujardModel.cpp:291
int32_t Exp
Column [Exp]: Experience.
Definition AujardModel.h:260
static const std::unordered_set< std::string > & BlobColumns()
Returns a set of blob column names for the table.
Definition AujardModel.cpp:265
static const std::vector< std::string > & PrimaryKey()
Returns the columns associated with the table's Primary Key.
Definition AujardModel.cpp:281
std::string UserId
Column [strUserId]: User identifier.
Definition AujardModel.h:255
static const std::string & TableName()
Returns the table name.
Definition AujardModel.cpp:238
static modelUtil::DbType DbType()
Returns the associated database type for the table.
Definition AujardModel.cpp:275
static const std::unordered_set< std::string > & ColumnNames()
Returns a set of column names for the table.
Definition AujardModel.cpp:245
[WAREHOUSE] The warehouse system is referred to as the Inn in-game. It is account-level storage for a...
Definition AujardModel.h:294
static const std::vector< std::string > & OrderedColumnNames()
Returns an ordered vector of column names for the table.
Definition AujardModel.cpp:313
int32_t DwTime
Column [dwTime]: DwTime TODO.
Definition AujardModel.h:312
std::optional< std::vector< uint8_t > > Serial
Column [strSerial]: Serial TODO.
Definition AujardModel.h:322
static modelUtil::DbType DbType()
Returns the associated database type for the table.
Definition AujardModel.cpp:333
static const std::vector< std::string > & PrimaryKey()
Returns the columns associated with the table's Primary Key.
Definition AujardModel.cpp:339
const std::string & MapKey() const
Returns a value for use in map keys based on the table's primary key.
Definition AujardModel.cpp:349
std::optional< std::vector< uint8_t > > ItemData
Column [WarehouseData]: Data on items stored in the warehouse.
Definition AujardModel.h:317
int32_t Money
Column [nMoney]: Money stored in the warehouse.
Definition AujardModel.h:307
std::string AccountId
Column [strAccountID]: Account identifier.
Definition AujardModel.h:302
static const std::unordered_set< std::string > & BlobColumns()
Returns a set of blob column names for the table.
Definition AujardModel.cpp:323
static const std::string & TableName()
Returns the table name.
Definition AujardModel.cpp:296
static const std::unordered_set< std::string > & ColumnNames()
Returns a set of column names for the table.
Definition AujardModel.cpp:303
DbType
Database type identifier.
Definition ModelUtil.h:14