Write to database using HiveEXT.dll

Why bother? You can write to DB programatically using any ODBC driver.

maybe he needs to store game data related...from his mod....


mdk, check the bliss dll there are 2 store procedure called around, see how is wrapped it will easy to find in files searching for the names proc_loglogout and proc_loglogin and other that are related with Messages
 
maybe he needs to store game data related...from his mod....


mdk, check the bliss dll there are 2 store procedure called around, see how is wrapped it will easy to find in files searching for the names proc_loglogout and proc_loglogin and other that are related with Messages

Yes I'm trying to store data from my mod in the database. I've found a method called customExecute in the HiveEXT sourcecode

Code:
Sqf::Value HiveExtApp::customExecute( Sqf::Parameters params )
{
    string query = Sqf::GetStringAny(params.at(0));
    Sqf::Parameters rawParams = boost::get<Sqf::Parameters>(params.at(1));
    return _custData->customExecute(query, rawParams);
}

which is bound to code 998 in HiveExtApp.cpp

Code:
handlers[998] = boost::bind(&HiveExtApp::customExecute,this,_1);

and apparently takes a string (this is the prepared statement) and parameters for the sql query as an argument. I don't understand though how to properly format my query, because this example obviously doesn't work:

Code:
_key = format ["CHILD:998:update `my_table` set `worldspace` = ? where `unique_id` = ?:[%1, %2]:", _param1, _param2];
// worldspace is set to values like "78.123,[123.456,654.321,3.145]:" when it should be [78.123,[123.456,654.321,3.145]]

I also tried to compile HiveEXT.dll from source code but i always end up with the following error
Code:
DirectHiveApp.obj : error LNK2001:  unresolved external symbol ""public: __thiscall SqlCustDataSource::SqlCustDataSource(class Poco::Logger &,class boost::shared_ptr<class Database>)" (??0SqlCustDataSource@@QAE@AAVLogger@Poco@@V?$shared_ptr@VDatabase@@@boost@@@Z)".

//edit:
Code:
SqlCustDataSource::SqlCustDataSource( Poco::Logger& logger, shared_ptr<Database> db ) : SqlDataSource(logger,db)
{
//todo: anything?
}
 
//this is the function which causes an error...

Any help you can give would be greatly appreciated.
 
from server_monitor.sqf for messaging:

_key = format["CHILD:999:select payload, loop_interval, start_delay from message where instance_id = ?:[%1]:", dayZ_instance];
_data = "HiveEXT" callExtension _key;
 
I solved the problem by adding additional quotation marks. The argument is now handled as a string and everything works fine.

Code:
_key = format ["CHILD:998:update `my_table` set `worldspace` = ? where `unique_id` = ?:[%1, ""%2""]:", _param1, _param2];
 
does not work over here..

Code:
_recht = ">= 1";
_key = format["CHILD:999:SELECT unique_id FROM `profile` where `recht` %1", _recht];
_data = "HiveEXT" callExtension _key;
 
diag_log("Member: Fetching messages...");
 
//Process result
_result = call compile format ["%1", _data];
_status = _result select 0;
 
_Member = [];
_MemberCount = 0;
_val = _result select 1;
for "_i" from 1 to _val do {
    _data = "HiveEXT" callExtension _key;
    _result = call compile format ["%1",_data];
 
    _status = _result select 0;
    _Member set [count _Member, _result];
    _MemberCount = MemberCount+1;
};
diag_log ("SERVER: Added " + str(_msgCount) + " member!");
 
another point is to check the version of the hive and the distribution, the generic query can be numbered with 999 or 998 or other custom if its a repack of the hive
 
hive properties says that the version is called "0.9.6.10"

how can i check the number (eg. 999)
 
Back
Top