Jump to content
Sign in to follow this  
firefly2442

Arma2MySQL

Recommended Posts

I've started work on it and there are some development testing branches on Github. The trouble has been the third party Mono libraries for SQLite and MySQL. I haven't had much time lately to work on it. So at this point, no sorry. If anyone wants to dive in and try it, everything is up on Github.

Yeah Guys is Arma2NETMySQLPlugin work only linux ???

Share this post


Link to post
Share on other sites
Perhaps try using "compile" on the result. This should convert it to an array type. https://community.bistudio.com/wiki/compile
Perhaps try using "compile" on the result. This should convert it to an array type. https://community.bistudio.com/wiki/compile

i tried this and it gives me errors

_playerLosts = format ["SELECT playerLosts FROM `player_stats` WHERE playerUID = ''%1''", _playerID];

_playerLostsResult = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['dbserver', '%1']", _playerLosts];

_playerLostsResult = call compile format["%1", _playerLostsResult];

error i get

diag_log ("Log: " + _playerLostsResult);>
19:19:44   Error position: <+ _playerLostsResult);>
19:19:44   Error Generic error in expression

Share this post


Link to post
Share on other sites

Try this instead:

_playerLostsResult = call compile _playerLostsResult;

i tried this and it gives me errors

_playerLosts = format ["SELECT playerLosts FROM `player_stats` WHERE playerUID = ''%1''", _playerID];

_playerLostsResult = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['dbserver', '%1']", _playerLosts];

_playerLostsResult = call compile format["%1", _playerLostsResult];

error i get

diag_log ("Log: " + _playerLostsResult);>
19:19:44   Error position: <+ _playerLostsResult);>
19:19:44   Error Generic error in expression

Share this post


Link to post
Share on other sites

hello i have found one more problem if anyone can help whats wrong using this code

_playerLosts = format ["SELECT playerLosts FROM `player_stats` WHERE playerUID = ''%1''", _playerID];
_playerLostsResult = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['dbserver', '%1']", _playerLosts];
_playerLostsResult = call compile format["%1", _playerLostsResult];
_playerLostsResults = _playerLostsResult select 0 select 0 select 0; 
_query = format["UPDATE player_stats SET playerLosts=(_playerLostsResults + 1) WHERE playerUID = ''%1''", _playerID];
_result = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['dbserver', '%1']", _query];

i get the correct data from playerLosts but when i try to update it and + 1 each time they die i get this error

"Log: [[["Error"]]]"

nothing else

Share this post


Link to post
Share on other sites

I'm guessing that's an invalid SQL query. Try printing it out before you execute it and run it manually to see if there's an error. Or, check the Arma2NETMySQL log file, there might be additional information and/or the error message in there.

hello i have found one more problem if anyone can help whats wrong using this code

_playerLosts = format ["SELECT playerLosts FROM `player_stats` WHERE playerUID = ''%1''", _playerID];
_playerLostsResult = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['dbserver', '%1']", _playerLosts];
_playerLostsResult = call compile format["%1", _playerLostsResult];
_playerLostsResults = _playerLostsResult select 0 select 0 select 0; 
_query = format["UPDATE player_stats SET playerLosts=(_playerLostsResults + 1) WHERE playerUID = ''%1''", _playerID];
_result = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['dbserver', '%1']", _query];

i get the correct data from playerLosts but when i try to update it and + 1 each time they die i get this error

"Log: [[["Error"]]]"

nothing else

Share this post


Link to post
Share on other sites
I'm guessing that's an invalid SQL query. Try printing it out before you execute it and run it manually to see if there's an error. Or, check the Arma2NETMySQL log file, there might be additional information and/or the error message in there.

10/29/2014 19:32:14 function: Arma2NETMySQLCommand ['dbserver', 'UPDATE player_stats SET playerLosts=(_playerLostsResults + 1) WHERE playerUID = ''myplayeruidhere''']
10/29/2014 19:32:14 maxResultSize: 10239
10/29/2014 19:32:14 Result size: 13
10/29/2014 19:32:14 Result: [[["Error"]]]

thats all it shows in the logs

Share this post


Link to post
Share on other sites

Ahh, I think I see the error. The _playerLostsResults + 1 that you're trying to do inside the query there is being evaluated as a string literal. You need to use format to create the string first before sending it through the plugin.

10/29/2014 19:32:14 function: Arma2NETMySQLCommand ['dbserver', 'UPDATE player_stats SET playerLosts=(_playerLostsResults + 1) WHERE playerUID = ''myplayeruidhere''']
10/29/2014 19:32:14 maxResultSize: 10239
10/29/2014 19:32:14 Result size: 13
10/29/2014 19:32:14 Result: [[["Error"]]]

thats all it shows in the logs

Share this post


Link to post
Share on other sites
Ahh, I think I see the error. The _playerLostsResults + 1 that you're trying to do inside the query there is being evaluated as a string literal. You need to use format to create the string first before sending it through the plugin.

i thought it was already in the format

_query = [color="#FF0000"]format[/color]["UPDATE player_stats SET playerLosts=(_playerLostsResults + 1) WHERE playerUID = ''%1''", _playerID];
_result = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['dbserver', '%1']", _query];

Share this post


Link to post
Share on other sites

Try printing _query via diag_log to make sure it's what it should be. Then run that query. You're only setting the ending value with %1. You need to do the same thing for _playerLostsResults as well. MySQL/SQL has no idea what that is. You're trying to pass it as a variable but it's interpreting it as a string literal.

i thought it was already in the format

_query = [color="#FF0000"]format[/color]["UPDATE player_stats SET playerLosts=(_playerLostsResults + 1) WHERE playerUID = ''%1''", _playerID];
_result = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['dbserver', '%1']", _query];

Share this post


Link to post
Share on other sites

ok thanks now i have another problem i hope you can help with

i got it to input info like playerid, name,etc into a the table but if i reconnect it makes another entry how can i make it so if that playeruid already exists into the table to not run the code

this is what i got and it is working

_query = format ["INSERT INTO player_stats (playerUID, playerName, playerWins, playerLosts, playerKills) VALUES('%1', '%2', '0', '0', '0')", _playerID, _playerName];
"Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['dbserver', '%1']", _query];

Share this post


Link to post
Share on other sites

Anyone knows why i've been getting errors like this one ?

11/09/2014 13:26:29 function: Arma2NETMySQLCommand ['dayz_epoch',"UPDATE object_data SET Hitpoints = '[]', Damage = '0' WHERE ObjectID = '6467'"]
11/09/2014 13:26:29 maxResultSize: 10239
11/09/2014 13:26:29 Result size: 4
11/09/2014 13:26:29 Result: [[]]
11/09/2014 13:26:32 Caught exception of type System.Reflection.TargetInvocationException
11/09/2014 13:26:32 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Value does not fall within the expected range.
  at Arma2NETMySQLPlugin.Arma2NETMySQLPluginCommand.Invoke(String args, Int32 maxResultSize)
  at Arma2Net.Managed.AddInManager.DomainInvokeAddIn(AddInArguments args)
  --- End of inner exception stack trace ---
  at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
  at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
  at System.Delegate.DynamicInvokeImpl(Object[] args)
  at Arma2Net.Managed.AddInManager.DomainDoCallback()
  at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
  at Arma2Net.Managed.AddInManager.DoCallbackImpl(AppDomain domain, Delegate func, Object arg)
  at Arma2Net.Managed.AddInManager.DoCallbackWithResult[T,TResult](AppDomain domain, Func`2 func, T arg)
  at Arma2Net.Managed.AddInManager.InvokeAddIn(String addInName, String arguments, Int32 maxResultSize)
  at Arma2Net.Managed.Bridge.InvokeBuiltInOrAddIn(String function, Int32 maxResultSize)
  at Arma2Net.Managed.Bridge.InvokeFunction(String function, Int32 maxResultSize)

or

11/09/2014 13:26:56 function: Arma2NETMySQLCommand ['dayz_epoch','SELECT Worldspace from object_data where ObjectUID = ''6048414236097''']
11/09/2014 13:26:56 maxResultSize: 10239
11/09/2014 13:26:56 Result size: 66
11/09/2014 13:26:56 Result: [[["[325,[6047.64,1427.83,0.00263214],""0,1,0,1"",""1,0,0,1""]"]]]
11/09/2014 13:26:56 Caught exception of type System.Reflection.TargetInvocationException
11/09/2014 13:26:56 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Value does not fall within the expected range.
  at Arma2NETMySQLPlugin.Arma2NETMySQLPluginCommand.Invoke(String args, Int32 maxResultSize)
  at Arma2Net.Managed.AddInManager.DomainInvokeAddIn(AddInArguments args)
  --- End of inner exception stack trace ---
  at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
  at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
  at System.Delegate.DynamicInvokeImpl(Object[] args)
  at Arma2Net.Managed.AddInManager.DomainDoCallback()
  at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
  at Arma2Net.Managed.AddInManager.DoCallbackImpl(AppDomain domain, Delegate func, Object arg)
  at Arma2Net.Managed.AddInManager.DoCallbackWithResult[T,TResult](AppDomain domain, Func`2 func, T arg)
  at Arma2Net.Managed.AddInManager.InvokeAddIn(String addInName, String arguments, Int32 maxResultSize)
  at Arma2Net.Managed.Bridge.InvokeBuiltInOrAddIn(String function, Int32 maxResultSize)
  at Arma2Net.Managed.Bridge.InvokeFunction(String function, Int32 maxResultSize)

Ok on the 2nd example i know its the double quotes are pissing it off....but how can i retrieve data then when i need to have double quotes in the db cell ?

I've tried:

_sql = "Arma2Net.Unmanaged" callExtension format["Arma2NETMySQLCommand ['dayz_epoch','SELECT Worldspace from object_data where ObjectUID = ''%1''']",_pid];
_result = call compile _sql;

and

_sql = format["SELECT Worldspace from object_data where ObjectUID = '%1'", _pid];
_qresult = _sql call myserver_hiveReadWrite;
_qselect = _qresult select 0 select 0 select 0;

where myserver_hiveReadWrite is

myserver_hiveReadWrite = {
private["_mykey","_qres","_mydata"];
_mykey = _this;
_mydata = format["Arma2NETMySQLCommand ['dayz_epoch",""%1""]",_mykey];
SQL_RESULT = "Arma2Net.Unmanaged" callExtension _mydata;
_qres = call compile format ["%1",SQL_RESULT];
_qres
};

Also on another note...I notice something weird....When i have tons of entries in my db and i parse them one by one so i can spawn them on the map, sometimes some objects are getting skipped. Although in the logs the SQL query was executed fine. For example

for "_i" from 0 to (_objectCount) do {
if (_i != _objectCount) then {
	_keyvg = format["SELECT `ObjectID`, `ObjectUID`, `Classname`, `CharacterID`, `Worldspace`, `Inventory`, `Hitpoints`, `Fuel`, `Damage` FROM object_data WHERE `Instance`='%1' AND `Classname` IS NOT NULL LIMIT %2,1",dayZ_instance, _i];
	_data2 = _keyvg call myserver_hiveReadWriteLarge;
	_response = _data2 select 0 select 0;
	if ((_response select 2) isKindOf "ModularItems") then {
		_BuildingQueue set [_bQty,_response];
		_bQty = _bQty + 1;
	} else {
		_objectQueue set [_vQty,_response];
		_vQty = _vQty + 1;
	};
};
sleep 0.0001;    ////////////
};

This function checks whether the row has a vehicle or a building, and add it to the proper array.

Notice the sleep in the end ? If i dont put that there....It might skip some objects. Not that the sleep saves the days....But it helps....

For example....here is the diag_log entry, while streaming objects:

">>>HIVE ["5959","60382140201447","OutHouse_DZ","76561198017478031","[292.742,[6038.19,1402,-0.143723],[[-0.922254,0.386585,0],[0,0,1]]]","[[[],[]],[[],[]],[[],[]]]","[]","0","0"] OutHouse_DZ"
">>>HIVE ["6127","6039314122016","Plastic_Pole_EP1_DZ","76561198017478031","[171.11,[6039.29,1412.18,0],[[0.154541,-0.987986,0],[0,0,1]]]","[]","[]","0","0"] Plastic_Pole_EP1_DZ"
">>>HIVE ["6131","60275140882220","CinderWallHalf_DZ","76561198017478031","[40.4377,[6027.52,1408.78,-0.0235214],[[0.648621,0.761111,0],[0.538187,-0.458644,0.707107]]]","[]","[]","0","0"] CinderWallHalf_DZ"
">>>HIVE ["6173","60351141250123","CinderWall_DZ","76561198017478031","[227.203,[6035.05,1412.53,0.0175705],[[-0.733765,-0.679404,0],[0,0,1]]]","[]","[]","0","0"] CinderWall_DZ"
">>>HIVE <null> any"
Error in expression <t 0;

diag_log (format[">>>HIVE %1 %2", _response, (_response select 2)]);
if ((>
 Error position: <_response, (_response select 2)]);
if ((>
 Error Undefined variable in expression: _response
">>>HIVE ["6333","60353141733319","Land_psi_bouda","76561198017478031","[318.667,[6035.35,1417.31,0.301598]]","[]","[]","3","0"] Land_psi_bouda"
">>>HIVE ["6366","60349142362300","Land_MBG_Garage_Single_D","76561198017478031","[300.118,[6034.88,1423.57,0.201233]]","[]","[]","0","0"] Land_MBG_Garage_Single_D"
">>>HIVE ["6367","6048514236271","HeliH","76561198017478031","[71.1653,[6048.46,1423.59,0.219681]]","[]","[]","0","0"] HeliH"

See that null there ? If i restart the server, it will grab it correctly though....It might skip something else.

Its as if the query is slower than then loop or something, which is weird since this is on a XEON machine, with 32GB ram, and the standard professional mysql server (no xampp and crap like that).

Any input would be really appreciated.

-Thanks

Edited by Sandbird

Share this post


Link to post
Share on other sites

Maybe try something like this? http://bogdan.org.ua/2007/10/18/mysql-insert-if-not-exists-syntax.html

ok thanks now i have another problem i hope you can help with

i got it to input info like playerid, name,etc into a the table but if i reconnect it makes another entry how can i make it so if that playeruid already exists into the table to not run the code

this is what i got and it is working

_query = format ["INSERT INTO player_stats (playerUID, playerName, playerWins, playerLosts, playerKills) VALUES('%1', '%2', '0', '0', '0')", _playerID, _playerName];
"Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQLCommand ['dbserver', '%1']", _query];

---------- Post added at 16:59 ---------- Previous post was at 16:50 ----------

For your first question, it might be getting hung on this:

Hitpoints = '[]'

. Try just using the empty string '' instead. Or maybe that was formatted as an integer value in MySQL? Basically, whatever type that's set as, I'm guessing you're passing in something it doesn't like.

Regarding the double quotes, I would recommend stripping those out before saving them to the database. You'll just have more headaches later on otherwise.

For the multiple queries and missing items, I'm not sure. Have you tried the async method instead? That actually should be faster and perhaps it's more reliable? Also, are you sure writing to the database is only being called via the server one at a time? If you have multiple threads or different scripts spawning off, you can't have more than one trying to write/read from the database at the same time.

Anyone knows why i've been getting errors like this one ?

11/09/2014 13:26:29 function: Arma2NETMySQLCommand ['dayz_epoch',"UPDATE object_data SET Hitpoints = '[]', Damage = '0' WHERE ObjectID = '6467'"]
11/09/2014 13:26:29 maxResultSize: 10239
11/09/2014 13:26:29 Result size: 4
11/09/2014 13:26:29 Result: [[]]
11/09/2014 13:26:32 Caught exception of type System.Reflection.TargetInvocationException
11/09/2014 13:26:32 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Value does not fall within the expected range.
  at Arma2NETMySQLPlugin.Arma2NETMySQLPluginCommand.Invoke(String args, Int32 maxResultSize)
  at Arma2Net.Managed.AddInManager.DomainInvokeAddIn(AddInArguments args)
  --- End of inner exception stack trace ---
  at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
  at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
  at System.Delegate.DynamicInvokeImpl(Object[] args)
  at Arma2Net.Managed.AddInManager.DomainDoCallback()
  at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
  at Arma2Net.Managed.AddInManager.DoCallbackImpl(AppDomain domain, Delegate func, Object arg)
  at Arma2Net.Managed.AddInManager.DoCallbackWithResult[T,TResult](AppDomain domain, Func`2 func, T arg)
  at Arma2Net.Managed.AddInManager.InvokeAddIn(String addInName, String arguments, Int32 maxResultSize)
  at Arma2Net.Managed.Bridge.InvokeBuiltInOrAddIn(String function, Int32 maxResultSize)
  at Arma2Net.Managed.Bridge.InvokeFunction(String function, Int32 maxResultSize)

or

11/09/2014 13:26:56 function: Arma2NETMySQLCommand ['dayz_epoch','SELECT Worldspace from object_data where ObjectUID = ''6048414236097''']
11/09/2014 13:26:56 maxResultSize: 10239
11/09/2014 13:26:56 Result size: 66
11/09/2014 13:26:56 Result: [[["[325,[6047.64,1427.83,0.00263214],""0,1,0,1"",""1,0,0,1""]"]]]
11/09/2014 13:26:56 Caught exception of type System.Reflection.TargetInvocationException
11/09/2014 13:26:56 System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.ArgumentException: Value does not fall within the expected range.
  at Arma2NETMySQLPlugin.Arma2NETMySQLPluginCommand.Invoke(String args, Int32 maxResultSize)
  at Arma2Net.Managed.AddInManager.DomainInvokeAddIn(AddInArguments args)
  --- End of inner exception stack trace ---
  at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
  at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
  at System.Delegate.DynamicInvokeImpl(Object[] args)
  at Arma2Net.Managed.AddInManager.DomainDoCallback()
  at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
  at Arma2Net.Managed.AddInManager.DoCallbackImpl(AppDomain domain, Delegate func, Object arg)
  at Arma2Net.Managed.AddInManager.DoCallbackWithResult[T,TResult](AppDomain domain, Func`2 func, T arg)
  at Arma2Net.Managed.AddInManager.InvokeAddIn(String addInName, String arguments, Int32 maxResultSize)
  at Arma2Net.Managed.Bridge.InvokeBuiltInOrAddIn(String function, Int32 maxResultSize)
  at Arma2Net.Managed.Bridge.InvokeFunction(String function, Int32 maxResultSize)

Ok on the 2nd example i know its the double quotes are pissing it off....but how can i retrieve data then when i need to have double quotes in the db cell ?

I've tried:

_sql = "Arma2Net.Unmanaged" callExtension format["Arma2NETMySQLCommand ['dayz_epoch','SELECT Worldspace from object_data where ObjectUID = ''%1''']",_pid];
_result = call compile _sql;

and

_sql = format["SELECT Worldspace from object_data where ObjectUID = '%1'", _pid];
_qresult = _sql call myserver_hiveReadWrite;
_qselect = _qresult select 0 select 0 select 0;

where myserver_hiveReadWrite is

myserver_hiveReadWrite = {
private["_mykey","_qres","_mydata"];
_mykey = _this;
_mydata = format["Arma2NETMySQLCommand ['dayz_epoch",""%1""]",_mykey];
SQL_RESULT = "Arma2Net.Unmanaged" callExtension _mydata;
_qres = call compile format ["%1",SQL_RESULT];
_qres
};

Also on another note...I notice something weird....When i have tons of entries in my db and i parse them one by one so i can spawn them on the map, sometimes some objects are getting skipped. Although in the logs the SQL query was executed fine. For example

for "_i" from 0 to (_objectCount) do {
if (_i != _objectCount) then {
	_keyvg = format["SELECT `ObjectID`, `ObjectUID`, `Classname`, `CharacterID`, `Worldspace`, `Inventory`, `Hitpoints`, `Fuel`, `Damage` FROM object_data WHERE `Instance`='%1' AND `Classname` IS NOT NULL LIMIT %2,1",dayZ_instance, _i];
	_data2 = _keyvg call myserver_hiveReadWriteLarge;
	_response = _data2 select 0 select 0;
	if ((_response select 2) isKindOf "ModularItems") then {
		_BuildingQueue set [_bQty,_response];
		_bQty = _bQty + 1;
	} else {
		_objectQueue set [_vQty,_response];
		_vQty = _vQty + 1;
	};
};
sleep 0.0001;    ////////////
};

This function checks whether the row has a vehicle or a building, and add it to the proper array.

Notice the sleep in the end ? If i dont put that there....It might skip some objects. Not that the sleep saves the days....But it helps....

For example....here is the diag_log entry, while streaming objects:

">>>HIVE ["5959","60382140201447","OutHouse_DZ","76561198017478031","[292.742,[6038.19,1402,-0.143723],[[-0.922254,0.386585,0],[0,0,1]]]","[[[],[]],[[],[]],[[],[]]]","[]","0","0"] OutHouse_DZ"
">>>HIVE ["6127","6039314122016","Plastic_Pole_EP1_DZ","76561198017478031","[171.11,[6039.29,1412.18,0],[[0.154541,-0.987986,0],[0,0,1]]]","[]","[]","0","0"] Plastic_Pole_EP1_DZ"
">>>HIVE ["6131","60275140882220","CinderWallHalf_DZ","76561198017478031","[40.4377,[6027.52,1408.78,-0.0235214],[[0.648621,0.761111,0],[0.538187,-0.458644,0.707107]]]","[]","[]","0","0"] CinderWallHalf_DZ"
">>>HIVE ["6173","60351141250123","CinderWall_DZ","76561198017478031","[227.203,[6035.05,1412.53,0.0175705],[[-0.733765,-0.679404,0],[0,0,1]]]","[]","[]","0","0"] CinderWall_DZ"
">>>HIVE <null> any"
Error in expression <t 0;

diag_log (format[">>>HIVE %1 %2", _response, (_response select 2)]);
if ((>
 Error position: <_response, (_response select 2)]);
if ((>
 Error Undefined variable in expression: _response
">>>HIVE ["6333","60353141733319","Land_psi_bouda","76561198017478031","[318.667,[6035.35,1417.31,0.301598]]","[]","[]","3","0"] Land_psi_bouda"
">>>HIVE ["6366","60349142362300","Land_MBG_Garage_Single_D","76561198017478031","[300.118,[6034.88,1423.57,0.201233]]","[]","[]","0","0"] Land_MBG_Garage_Single_D"
">>>HIVE ["6367","6048514236271","HeliH","76561198017478031","[71.1653,[6048.46,1423.59,0.219681]]","[]","[]","0","0"] HeliH"

See that null there ? If i restart the server, it will grab it correctly though....It might skip something else.

Its as if the query is slower than then loop or something, which is weird since this is on a XEON machine, with 32GB ram, and the standard professional mysql server (no xampp and crap like that).

Any input would be really appreciated.

-Thanks

Share this post


Link to post
Share on other sites

The double quotes problem...i fixed it with thousand call compiles and str() tricks :P

For the second (and biggest problem with the 'skips') I never thought that multiple SQLs might be doing this....You are probably right.

If a player connects while the server is streaming data....it would try to load his character also from the database.

I really wish i could find a working example of async calls....but i cant find any :/

I understand what the concept does, i just dont know how to implement it.

The example in : http://arma2netmysqlplugin.readthedocs.org/en/latest/#using-the-plugin isnt very helpful about what happens 'after' the call.

-Thanks again for your answer

Share this post


Link to post
Share on other sites

The example mission for Arma 3 uses async. See server_events.sqf https://github.com/firefly2442/Arma2NetMySQLPlugin-Arma3-ExampleMission

The double quotes problem...i fixed it with thousand call compiles and str() tricks :P

For the second (and biggest problem with the 'skips') I never thought that multiple SQLs might be doing this....You are probably right.

If a player connects while the server is streaming data....it would try to load his character also from the database.

I really wish i could find a working example of async calls....but i cant find any :/

I understand what the concept does, i just dont know how to implement it.

The example in : http://arma2netmysqlplugin.readthedocs.org/en/latest/#using-the-plugin isnt very helpful about what happens 'after' the call.

-Thanks again for your answer

Share this post


Link to post
Share on other sites

Hi,

There is any way to run stored procedures async ? like Async queries ?

Or is that only posible with the async command for queries?

Share this post


Link to post
Share on other sites

No sorry, the async method only works for straight SQL queries, not stored procedures.

Hi,

There is any way to run stored procedures async ? like Async queries ?

Or is that only posible with the async command for queries?

Share this post


Link to post
Share on other sites
No sorry, the async method only works for straight SQL queries, not stored procedures.

So for performance is better to use async straight queries then, right ?

Share this post


Link to post
Share on other sites

Yes, from feedback received from people who run servers with large numbers of players, the async query is better because it doesn't block the server waiting for the callExtension return.

So for performance is better to use async straight queries then, right ?

Share this post


Link to post
Share on other sites
Yes, from feedback received from people who run servers with large numbers of players, the async query is better because it doesn't block the server waiting for the callExtension return.

Did you find any pitfall that prevents you to implement async on procedures, or is just due the lack of time?

I mean, that if its posible, I can implement that myself. (I want to use procedures but have not performance issues).

Btw, thanks for the project, is really good.

Share this post


Link to post
Share on other sites

Yes, it's absolutely possible. Basically, I wrote the stored procedures part first and the straight queries and async second. It would definitely be do-able and if you were able to add it in I could merge it in so others could benefit. Good luck! :)

Did you find any pitfall that prevents you to implement async on procedures, or is just due the lack of time?

I mean, that if its posible, I can implement that myself. (I want to use procedures but have not performance issues).

Btw, thanks for the project, is really good.

Share this post


Link to post
Share on other sites
Yes, it's absolutely possible. Basically, I wrote the stored procedures part first and the straight queries and async second. It would definitely be do-able and if you were able to add it in I could merge it in so others could benefit. Good luck! :)

You have a pull request.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×