Skip to content

Commit 2bc8b65

Browse files
committed
Add dbVersion command
1 parent 71aadb9 commit 2bc8b65

3 files changed

Lines changed: 5 additions & 1 deletion

File tree

src/config.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ game_value cmd_reloadConfig(game_state&) {
8787
void Config::initCommands() {
8888

8989
handle_cmd_reloadConfig = intercept::client::host::register_sqf_command("dbReloadConfig", "TODO", cmd_reloadConfig, game_data_type::STRING);
90+
handle_cmd_version = intercept::client::host::register_sqf_command("dbVersion", "TODO", [](game_state&) -> game_value {
91+
return "1.0";
92+
}, game_data_type::STRING);
9093

9194

9295
}

src/config.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ class Config : public intercept::singleton<Config> {
2424

2525
static void initCommands();
2626
static inline registered_sqf_function handle_cmd_reloadConfig;
27+
static inline registered_sqf_function handle_cmd_version;
2728

2829
private:
2930
std::map<intercept::types::r_string, mariadb::account_ref> accounts;

src/connection.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ void Connection::initCommands() {
306306
handle_cmd_executeAsync = host::register_sqf_command("dbExecuteAsync", "TODO", Connection::cmd_executeAsync, Result::GameDataDBAsyncResult_typeE, GameDataDBConnection_typeE, Query::GameDataDBQuery_typeE);
307307
handle_cmd_ping = host::register_sqf_command("dbPing", "TODO", Connection::cmd_ping, game_data_type::BOOL, GameDataDBConnection_typeE);
308308
handle_cmd_isConnected = host::register_sqf_command("dbIsConnected", "TODO", Connection::cmd_isConnected, game_data_type::BOOL, GameDataDBConnection_typeE);
309-
handle_cmd_addErrorHandler = host::register_sqf_command("dbIsConnected", "TODO", Connection::cmd_addErrorHandler, game_data_type::ARRAY, GameDataDBConnection_typeE, game_data_type::CODE);
309+
handle_cmd_addErrorHandler = host::register_sqf_command("dbAddErrorHandler", "TODO", Connection::cmd_addErrorHandler, game_data_type::NOTHING, GameDataDBConnection_typeE, game_data_type::CODE);
310310

311311

312312

0 commit comments

Comments
 (0)