Jump to content
Sign in to follow this  
firefly2442

Arma2MySQL

Recommended Posts

Are you talking about a specific log file named after the plugin or the rpt files? These only have one line that relates to the SQL, nothing else.

---------- Post added at 12:52 AM ---------- Previous post was at 12:27 AM ----------

Could you also show a precise location where the plugin has to be? I placed it in both folder structures as the readme tells, but it apparently never gets loaded, as there is no log file for it. The databases.txt is in place too.

Share this post


Link to post
Share on other sites

Well, whatever log file is the newest, they're sorted by date. You don't need them in both places, that actually is just more confusing for you. I would recommend sticking with putting everything in the AppData folder if possible. The databases.txt file goes there too. Go through the Readme again, I think perhaps you are missing something. If the readme is not clear, tell me which part of the readme specifically is unclear.

Share this post


Link to post
Share on other sites

Going to retrace my install to check, I might have messed up at some point.

You need a Windows server. (see known issues) -check

One of the following:

A MySQL server and database setup -check

A SQLite database setup -skipped, using mysql

MySQL Connector for .NET The program has been successfully tested with version 6.5.4 -check

Precompiled Binaries of SQLite for 32-bit Windows (.NET Framework 4.0) The program has been successfully tested with version 1.0.81.0 -check

Microsoft .NET Framework 4 Client Profile -check

Arma2OA Beta version 87640 or later (full client or dedicated server) -check

See here for a note about Windows dedicated servers and required files.

The folders:

C:\Users\Administrator\AppData\Local\Arma2NETMySQL +/logs and the databases.text is in there too. (in the sql root one)

no box is spawned at all and the log file folder is empty.

The databases entry: (pw and name removed obviously)

mysql,arma2,127.0.0.1,3306,my_username,my_pw

Plugin folder:

C:\Program Files (x86)\Steam\steamapps\common\Arma 2 Operation Arrowhead\@Arma2NET\AddIns\Arma2NETMySQLPlugin

I found out that I accidently skipped this step:

Use the provided .sql file (in the "sql" folder) which will load into MySQL and create the appropriate database and stored procedures.

Being an SQL newb I imported the sql file using "import", which created a new sql database in the root location called "weapons". So I adjusted the databases entry to:

mysql,weapons,127.0.0.1,3306,my_username,my_pw

and it still wont work (no logfiles, no box)

Am I doing something wrong when importing that .sql?

Share this post


Link to post
Share on other sites

Hmm, what about the launcher that you use to launch Arma2? Did you add @Arma2NET to the launcher mods list? If you imported the database as root, make sure to adjust the Databases.txt file with the root username and password. While I don't recommend it, it will work. You didn't get any messages/errors when importing? And your Databases.txt file is here right?

C:\Users\Administrator\AppData\Local\Arma2NETMySQL\Databases.txt

Also, make sure you don't have Databases.txt file in the root Arma2 directory. By default, it will look there first. If you have an old one there from previous attempts, that could be why it's not working.

Share this post


Link to post
Share on other sites

image.jpg

This is how the privileges look on sqladmin thingy.

cat_arma2 is the user that is listed in the databases.txt.

I also deleted the leftover databases in my OA game folder as you suggested, retried and it would not work.

As far as loading the mod folder goes, I think that is working, because the server is listed in the browser as having the @Arma2NET.. folder loaded.

If you imported the database as root, make sure to adjust the Databases.txt file with the root username and password.

What I did was to click import on the sql admin tool and then selected the .sql file. Although had the an "arma2" database loaded and it even said "import sql into arma2 database" the new weapons database still ended up in the "root" area of the sql stuff.

I wonder, if there is not even a log file being created, would that be an error of a faulty database setup or a problem with the plugin loading? I think it is the plugin side not working, because if the plugin worked it would leave some errors

EDIT: Also what exactly is ARMA2NET? Your readme says:

Arma2NET also stores log files which are located here:

C:\Users\Yourname\AppData\Local\Arma2NET\

Do I have to install that too? (From what I read, it is needed to compile the plugin, but not to run it)

Edited by alleycat

Share this post


Link to post
Share on other sites

Tried using SQLite database, and still it wont work. I think a problem on the DB side can be ruled out. Something is messed up with my plugin install.

EDIT: Narrowed the problem down to a problem of wether to use OA game root folder or the appdata (the appdata folders have no file changes for days). Going to try to drop the whole folder structure in the OA root.

EDIT2: Did not work. Going to retrace the plugin installation part again and see if I messed it up somewhere.

EDIT3: HAS to be something with the modfolder loading Arma2NET. Tried it on my local pc too and what is weird is that the folder never appears in the ingame extension menu

EDIT4: I think I am missing something completely obvious. Any example mission that needs ARMA2NET fails to work on my server pc and gaming pc

EDIT5: Reinstalled the .NET profile, now Arma2NET is writing the log files, also the datetime mission works. However still no working SQL. Nothing in any SQL log. COuld it be that SQL based missions need time for their database calls to kick in or something?

Version 1.62.95251
11:26:10 Mission Arma2NetMySQLPlugin-ExampleMis.utes: Missing 'description.ext::Header'
11:26:11 Server error: Player without identity cat (id 65834884)
11:26:23 Warning: looped for animation: ca\anims\characters\data\anim\sdr\mov\erc\wlk\non\non\amovpercmwlksnonwnondf.rtm differs (looped now 0)! MoveName: amovpercmstpsnonwnondnon_amovpercmstpsraswpstdnon
11:26:23 Warning: looped for animation: ca\anims\characters\data\anim\sdr\mov\erc\wlk\non\non\amovpercmwlksnonwnondf.rtm differs (looped now 1)! MoveName: amovpercmrunsnonwbindf_rfl
11:26:23 [3100,97.468,0,"XEH: PreInit Started. v1.0.0.189. MISSINIT: missionName=Arma2NetMySQLPlugin-ExampleMis, worldName=utes, isMultiplayer=true, isServer=true, isDedicated=true"]
11:26:25 [3100,99.375,0,"XEH: PreInit Finished. CACHE DISABLED? (Disable caching with cba_disable_cache.pbo): SLX_XEH_RECOMPILE=false, CBA_COMPILE_RECOMPILE=false, CBA_FUNC_RECOMPILE=false"]
11:26:26 [3101,99.68,0,"XEH: PostInit Started"]
11:26:26 [3101,99.753,0,"CBA_VERSIONING: cba=1.0.0.190, cba_a2=1.0.0.8, cba_oa=1.0.0.6, "]
11:26:26 [3101,99.79,0,"XEH: PostInit Finished. State: _isClient=false, _isJip=false, _isDedClient=false, _isServer=true, _isDedServer=true, _playerCheckDone=true, _sp=false, _startInitDone=true, _postInitDone=true, _mpRespawn=false, _machineType=0, _sessionId=1, _level=0, _timeOut=false, _game=1, BIS_functions=L 1-1-B:1, group=L 1-1-B"]
11:26:44 Mission Arma2NetMySQLPlugin-ExampleMis.utes: Missing 'description.ext::Header'


=====================================================================
== C:\Program Files (x86)\Steam\steamapps\common\Arma 2 Operation Arrowhead\arma2oaserver.exe
== "C:\Program Files (x86)\Steam\steamapps\common\Arma 2 Operation Arrowhead\arma2oaserver.exe"  -port=2302 "-config=C:\Program Files (x86)\Steam\steamapps\common\Arma 2 Operation Arrowhead\TA2DST\cat_sql\TA2DST_config.cfg" "-cfg=C:\Program Files (x86)\Steam\steamapps\common\Arma 2 Operation Arrowhead\TA2DST\cat_sql\TA2DST_basic.cfg" "-profiles=C:\Program Files (x86)\Steam\steamapps\common\Arma 2 Operation Arrowhead\TA2DST\cat_sql" -name=TA2DST -netlog -pid=PID.log "-ranking=ranking.log" "-mod=Expansion\beta;Expansion\beta\Expansion;@CBA;@CBA_A2;@CBA_OA;@Arma2NET" 
=====================================================================
Exe timestamp: 2013/01/24 23:31:30
Current time:  2013/01/30 11:37:04

Version 1.62.95251
11:37:04 Mission Arma2NetMySQLPlugin-ExampleMis.utes: Missing 'description.ext::Header'
11:37:05 Server error: Player without identity cat (id 720118622)
11:37:18 Warning: looped for animation: ca\anims\characters\data\anim\sdr\mov\erc\wlk\non\non\amovpercmwlksnonwnondf.rtm differs (looped now 0)! MoveName: amovpercmstpsnonwnondnon_amovpercmstpsraswpstdnon
11:37:19 Warning: looped for animation: ca\anims\characters\data\anim\sdr\mov\erc\wlk\non\non\amovpercmwlksnonwnondf.rtm differs (looped now 1)! MoveName: amovpercmrunsnonwbindf_rfl
11:37:19 [6911,174.245,0,"XEH: PreInit Started. v1.0.0.189. MISSINIT: missionName=Arma2NetMySQLPlugin-ExampleMis, worldName=utes, isMultiplayer=true, isServer=true, isDedicated=true"]
11:37:22 [6911,176.777,0,"XEH: PreInit Finished. CACHE DISABLED? (Disable caching with cba_disable_cache.pbo): SLX_XEH_RECOMPILE=false, CBA_COMPILE_RECOMPILE=false, CBA_FUNC_RECOMPILE=false"]
11:37:22 [6912,177.172,0,"XEH: PostInit Started"]
11:37:23 [6912,177.31,0,"CBA_VERSIONING: cba=1.0.0.190, cba_a2=1.0.0.8, cba_oa=1.0.0.6, "]
11:37:23 [6912,177.368,0,"XEH: PostInit Finished. State: _isClient=false, _isJip=false, _isDedClient=false, _isServer=true, _isDedServer=true, _playerCheckDone=true, _sp=false, _startInitDone=true, _postInitDone=true, _mpRespawn=false, _machineType=0, _sessionId=1, _level=0, _timeOut=false, _game=1, BIS_functions=L 1-1-B:1, group=L 1-1-B"]

EDIT6: Ok this is weird. This RPT log does not show anything interesting, except that at 11:34 there is an attempt to connect to the database:

Info: 11:34:13 - Logging started in directory: C:\Users\Administrator\AppData\Local\Arma2NETMySQL/logs/
Info: 11:34:13 - Arma2NETMySQL Plugin Started.
Info: 11:34:13 - Version number: 0.1.0.0
Info: 11:34:13 - Loading databases...
Info: 11:34:13 - Databases.txt file loading in from: C:\Users\Administrator\AppData\Local\Arma2NETMySQL/Databases.txt
Info: 11:34:13 - Type: sqlite Database: weaponslite

There was no mission at that point, or I had a mission running for at least 8 minutes and the SQL started working, I can not remember and I was not so far able to reproduce the situation.

EDIT7:

Was able to reproduce the situation by typing into the arma2net explorer:

> Arma2NETMySQLCommand
throw "System.Reflection.TargetInvocationException"

Info: 14:15:54 - Logging started in directory: C:\Users\Administrator\AppData\Local\Arma2NETMySQL/logs/
Info: 14:15:54 - Arma2NETMySQL Plugin Started.
Info: 14:15:54 - Version number: 0.1.0.0
Info: 14:15:54 - Loading databases...
Info: 14:15:54 - Databases.txt file loading in from: C:\Users\Administrator\AppData\Local\Arma2NETMySQL/Databases.txt
Info: 14:15:54 - Type: sqlite Database: weaponslite

01/30/2013 14:15:54 Caught exception of type System.Reflection.TargetInvocationException
01/30/2013 14:15:54 System.Reflection.TargetInvocationException:
Exception has been thrown by the target of an invocation. ---> [u]System.IO.FileNotFoundException: 
Could not load file or assembly 'System.Data.SQLite,
Version=1.0.81.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139' or one of its dependencies.
Das System kann die angegebene Datei nicht finden.[/u]
  at Arma2NETMySQLPlugin.SQLite.OpenConnection(String databasename)
  at Arma2NETMySQLPlugin.DatabaseObject..ctor(String[] values)
  at Arma2NETMySQLPlugin.Databases..ctor()
  at Arma2NETMySQLPlugin.Startup.StartupConnection()
  at Arma2NETMySQLPlugin.Arma2NETMySQLPluginCommand.Invoke(String args, Int32 maxResultSize)
  at Arma2Net.Managed.AddInManager.DomainInvokeAddIn(AddInArguments args)
  --- End of inner exception stack trace ---
  at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
  at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
  at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
  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)
01/30/2013 14:15:54 function: Arma2NETMySQLCommand
01/30/2013 14:15:54 maxResultSize: 4095

Looks like some file is missing.

Edited by alleycat

Share this post


Link to post
Share on other sites

Yes, Arma2NET is required. I will try to make that more clear in the readme.

It looks like you are missing the SQLite DLL. Go in the readme towards the top. There is a program you have to install for SQLite in order to have it work (similar to the MySQL dependency you installed).

Share this post


Link to post
Share on other sites

I'm looking for a way to implement this to a life server, if any kind soul would be able to help me that would be greatly apprechiated!

Share this post


Link to post
Share on other sites
Yes, Arma2NET is required. I will try to make that more clear in the readme.

It looks like you are missing the SQLite DLL. Go in the readme towards the top. There is a program you have to install for SQLite in order to have it work (similar to the MySQL dependency you installed).

The precompiled binaries throw errors that point to a missing VS2010 install. Does it actually need VS2010 to run? The errors ends with AssemblyfoldersEx.

Some workarounds suggest fixing some reg keys but I do not want to mess with that so I ll install vs2010 and see if it works

Edited by alleycat

Share this post


Link to post
Share on other sites

Uh, no, VS 2010 should not be required. I think you mentioned you had the .NET framework installed right? That's definitely needed. Let me see if I can work on something here in the next couple days or over the weekend that would help with all the installation questions.

Share this post


Link to post
Share on other sites
Uh, no, VS 2010 should not be required. I think you mentioned you had the .NET framework installed right? That's definitely needed. Let me see if I can work on something here in the next couple days or over the weekend that would help with all the installation questions.

That'd be really appreciated as I think I'm doing something wrong with the installation aswell.

Share this post


Link to post
Share on other sites

Reinstalled the 4.0 NEZ framework, and rebooted. Still wont work.

http://stackoverflow.com/questions/9035977/system-data-sqlite-windows-x64-install-fails-could-not-load-file-or-assembly-or

this is the exact error I am having.

And this:

http://stackoverflow.com/questions/7164526/failed-to-read-key-hklm-software-microsoft-netframework-v4-0-30319-assemblyfold

http://system.data.sqlite.org/index.html/info/d8491abd0b

I am a bit scared of messing with regedit. The fixes they suggest, can they be safely applied without wrecking windows?

---------- Post added at 09:04 PM ---------- Previous post was at 08:18 PM ----------

On my server pc (winserver2008 R2 64bit) the key it is looking for "AppfoldersEx" resides in in Wow6432Node/.

---------- Post added at 09:27 PM ---------- Previous post was at 09:04 PM ----------

Tried using a normal SQL database, this time the error is relating to "MySql.Data", what dependencies are needed to fix that?

Edited by alleycat

Share this post


Link to post
Share on other sites

You need the MySQL connector installed. Again, see the Readme. I would not suggest regedit, that sounds dangerous.

Share this post


Link to post
Share on other sites

The Connector is already installed. The problem appears to be that the registry entries are in a different folder for x64 systems.

Could it be that newer versions of the programs needed broke something on the sql plugin? The connector version that it was tested for was 6.5.4, while the download available is 6.6.4. (and the oldest available on teh site is 6.6.5.)

The error message specifically looks for:

01/31/2013 03:47:07 System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.IO.FileNotFoundException: Die Datei oder Assembly "MySql.Data, Version=6.5.4.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.

Ill try to find a 6.5.4 installer and report back

EDIT------------------------------------------------------------------------------------------

---------- Post added at 04:27 AM ---------- Previous post was at 03:44 AM ----------

01/31/2013 04:15:50 Caught exception of type System.Reflection.TargetInvocationException
01/31/2013 04:15:50 System.Reflection.TargetInvocationException: [u]Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.ArgumentException: Der Wert liegt außerhalb des erwarteten Bereichs.[/u]
  bei Arma2NETMySQLPlugin.Arma2NETMySQLPlugin.Invoke(String args, Int32 maxResultSize)
  bei Arma2Net.Managed.AddInManager.DomainInvokeAddIn(AddInArguments args)
  --- Ende der internen Ausnahmestapelüberwachung ---
  bei System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
  bei System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
  bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
  bei System.Delegate.DynamicInvokeImpl(Object[] args)
  bei Arma2Net.Managed.AddInManager.DomainDoCallback()
  bei System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
  bei Arma2Net.Managed.AddInManager.DoCallbackImpl(AppDomain domain, Delegate func, Object arg)
  bei Arma2Net.Managed.AddInManager.DoCallbackWithResult[T,TResult](AppDomain domain, Func`2 func, T arg)
  bei Arma2Net.Managed.AddInManager.InvokeAddIn(String addInName, String arguments, Int32 maxResultSize)
  bei Arma2Net.Managed.Bridge.InvokeBuiltInOrAddIn(String function, Int32 maxResultSize)
  bei Arma2Net.Managed.Bridge.InvokeFunction(String function, Int32 maxResultSize)
01/31/2013 04:15:50 function: Arma2NETMySQL
01/31/2013 04:15:50 maxResultSize: 4095

Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.ArgumentException: Der Wert liegt außerhalb des erwarteten Bereichs.

This is german, translated it means: "Target has caused an exception error > Value out of expected range

Mysqlplugin log:

Error: 04:15:50 - The number and/or format of the arguments passed in doesn't match.

All of this happens when typing this into the arma2NET explorer:

> Arma2NETMySQL

throw "System.Reflection.TargetInvocationException"

The good news: After installing the old 6.5.4 connector and rebooting (and putting all the dlls into the 3 folders: OA root, the plugin dll directory and @arma2net) the missing dll error disappeared.

But now this value out of range stuff is happening. And the box with the loadout is still missing in the example mission

Edited by alleycat

Share this post


Link to post
Share on other sites

Hmm, interesting. Thank you for testing. I will try this latest version on my end this weekend as well.

Share this post


Link to post
Share on other sites

System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> System.IO.FileNotFoundException: Die Datei oder Assembly "System.Data.SQLite, Version=1.0.81.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" oder eine Abhängigkeit davon wurde nicht gefunden. Das System kann die angegebene Datei nicht finden.

Similar issue with SQLite, perhaps that different version number is causing the problem.

I made a test mission and added a custom new column to the database to see if that would work.

column name was testcol. default value was 5600.

Init.sqf

"Arma2Net.Unmanaged" callExtension "Arma2NETMySQLCommand";
player addAction ["testcol", "testcol.sqf"];

testcol.sqf

_selectTest = "Arma2Net.Unmanaged" callExtension "Arma2NETMySQLCommand ['weaponslite', 'SELECT testcol FROM users']";
hint format ["testcol is %1.", _selectTest];

This should return 5600 on a dabase with no entries? I am a SQL newb so I am not sure. But it never returns anything. Just nothing, no error ingame.

from what I understand the sql command I typed grabs the whole testcol column

the log:

Info: 02:09:43 - Logging started in directory: C:\Users\Administrator\AppData\Local\Arma2NETMySQL/logs/

Info: 02:09:43 - Arma2NETMySQL Plugin Started.

Info: 02:09:43 - Version number: 0.1.0.0

Info: 02:09:43 - Loading databases...

Info: 02:09:43 - Databases.txt file loading in from: C:\Users\Administrator\AppData\Local\Arma2NETMySQL/Databases.txt

Info: 02:09:43 - Type: mysql Database: arma2 IPAddress: 127.0.0.1 Port: 3306 Username: cat_arma2 Password: NotShownForSecurityReasons

Error: 02:09:43 - The number and/or format of the arguments passed in doesn't match.

In case I messed up SQL code, can you suggest a quick simple command that would grab data from a column? I basically do this test because I suspect something might have gone wrong when importing that .sql file in the example mission. That is why I would like to test the plugin setup by grabbing a variable in the most simple way to see if the connection works.

---------- Post added at 04:03 AM ---------- Previous post was at 02:14 AM ----------

Found the dlls used for SQlite and dropped them in the 3 folders. Now the error is narrowed down to:

Error: 03:53:11 - The number and/or format of the arguments passed in doesn't match.

Which is probably my messing up the SQL syntax in the custom mission I made.But that loadout mission still never even attempts to connect, not even an error.

What is the correct syntax to return the id from the first row?

Also, when installing the MSSQL binaries, all is needed is to run installer.exe with -confirm true?

Edited by alleycat

Share this post


Link to post
Share on other sites

Try using the Arma2NET explorer. If you look in the Readme there should be examples of queries that you can pass as well as the formatting that is required. This way you can skip running things through Arma2, it makes it easier to test.

Yes, running the installer for the MySQL connector should be all that is needed.

Share this post


Link to post
Share on other sites

I was using the explorer all the time next to the actual missions.

This is what I did in a custom mission:

> Arma2NETMySQLCommand ['weaponslite', 'SELECT var FROM testtable WHERE var=200']
throw "System.Reflection.TargetInvocationException"

var is a custom field in testtable with a value of 200 which I manually entered into the db.

02/01/2013 16:45:11 Caught exception of type System.Reflection.TargetInvocationException
02/01/2013 16:45:11 System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> [u]System.IO.FileLoadException: Die Datei oder Assembly "System.Data.SQLite, Version=1.0.81.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" oder eine Abhängigkeit davon wurde nicht gefunden. Die gefundene Manifestdefinition der Assembly stimmt nicht mit dem Assemblyverweis überein. (Ausnahme von HRESULT: 0x80131040)[/u]
  bei Arma2NETMySQLPlugin.SQLite.OpenConnection(String databasename)
  bei Arma2NETMySQLPlugin.DatabaseObject..ctor(String[] values)
  bei Arma2NETMySQLPlugin.Databases..ctor()
  bei Arma2NETMySQLPlugin.Startup.StartupConnection()
  bei Arma2NETMySQLPlugin.Arma2NETMySQLPluginCommand.Invoke(String args, Int32 maxResultSize)
  bei Arma2Net.Managed.AddInManager.DomainInvokeAddIn(AddInArguments args)
  --- Ende der internen Ausnahmestapelüberwachung ---
  bei System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
  bei System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
  bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
  bei System.Delegate.DynamicInvokeImpl(Object[] args)
  bei Arma2Net.Managed.AddInManager.DomainDoCallback()
  bei System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
  bei Arma2Net.Managed.AddInManager.DoCallbackImpl(AppDomain domain, Delegate func, Object arg)
  bei Arma2Net.Managed.AddInManager.DoCallbackWithResult[T,TResult](AppDomain domain, Func`2 func, T arg)
  bei Arma2Net.Managed.AddInManager.InvokeAddIn(String addInName, String arguments, Int32 maxResultSize)
  bei Arma2Net.Managed.Bridge.InvokeBuiltInOrAddIn(String function, Int32 maxResultSize)
  bei Arma2Net.Managed.Bridge.InvokeFunction(String function, Int32 maxResultSize)
02/01/2013 16:45:11 function: Arma2NETMySQLCommand ['weaponslite', 'SELECT var FROM habeeb WHERE var=200']
02/01/2013 16:45:11 maxResultSize: 4095

The only thing I can think of that might be a problem is the version of the dll files. The SQLite site does not list 1.0.81.0, I am running 84. Going to track down a 1.0.81.0 download and report back.

---------- Post added at 05:29 PM ---------- Previous post was at 04:57 PM ----------

Found a 081 dll and now it appears to work in the explorer but not ingame:

The db has a separate table which has 2 columns(var and var2). I gave the first row a value of (200/250).

Then I called in the explorer:

> Arma2NETMySQLCommand ['weaponslite', 'SELECT var2 FROM testtable WHERE var=200']

[[["250"]]]

Info: 17:08:51 - Received - Database: weaponslite SQL Query: SELECT var2 FROM habeeb WHERE var=200

Which is teh correct value.

However calling this from a scrip ingame:

Info: 17:15:05 - Logging started in directory: C:\Users\Administrator\AppData\Local\Arma2NETMySQL/logs/
Info: 17:15:05 - Arma2NETMySQL Plugin Started.
Info: 17:15:05 - Version number: 0.1.0.0
Info: 17:15:05 - Loading databases...
Info: 17:15:05 - Databases.txt file loading in from: C:\Users\Administrator\AppData\Local\Arma2NETMySQL/Databases.txt
Info: 17:15:05 - Type: sqlite Database: weaponslite
Info: 17:15:05 - SQLite folder location: C:\Users\Administrator\AppData\Local\Arma2NETMySQL/sqlite/
Error: 17:15:05 - The number and/or format of the arguments passed in doesn't match.

_selectTest = "Arma2Net.Unmanaged" callExtension "Arma2NETMySQLCommand ['weaponslite', 'SELECT var2 FROM testtable WHERE var=200']";
hint format ["habeeb is %1.", _selectTest];

Could formatting be an issue? Perhaps the 250 is coming in correctly but the formatting that should display it breaks it?

Edited by alleycat

Share this post


Link to post
Share on other sites

Thanks for testing the newer versions of the database connector dependencies. It sounds like that may be an issue since I compiled with older versions. I'm doing more testing and working on packaging all this up. It's getting there.

Share this post


Link to post
Share on other sites

Everything works great so far. But I encountered a small problem.

When I store a float variable

8059.2001953125

then retrieve it:

[[["8059.2001953125"]]]

Removing the array and turning it into a number works by using:

_var = call compile _var;
_var = _var select 0;
_var = _var select 0;
_var = _var select 0;

_var = parseNumber _var; 

This turns it into a workign number, but it stops after the .

8059

It appears when the string is returned rom the database the . is turned into a , and parsenumber does not recognize a comma as a dot.

Is there an solution for this? I could try to pre-multiply the data before storing it into the database and have it store ints but that does not seem practical. Is there a way to replace a comma inside a string?

---------- Post added at 07:25 AM ---------- Previous post was at 07:22 AM ----------

Actually I found a solution:

https://dev-heaven.net/docs/cba/files/strings/fnc_replace-sqf.html

This appears to fix it.

Share this post


Link to post
Share on other sites

So I hunted down the version of mysql connector required took a bit of Google searching but found it. But now whenever I execute the code it just crash's my the server. Not sure if this is related to the 2.3 version but don't know of what version fix's the dll dependency issues and where to place what dll's need to go into what folders if there is a dll dependancy issue within arma2net itself.

This is what I am getting :

Application: arma2oaserver.exe

Framework Version: v4.0.30319

Description: The process was terminated due to an unhandled exception.

Exception Info: System.IO.FileNotFoundException

Stack:

at <Module>.Arma2Net.Unmanaged.InvokeFunctionImpl(SByte*, Int32, SByte*)

at <Module>.Arma2Net.Unmanaged.InvokeFunction(SByte*, Int32, SByte*)

Code looks like the following :

_queryvalue = format ["[%1,%2]", _uid, _variable_value];

"Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQL ['arma2game', 'updateb', '%1']", _queryvalue];

I have also tried the following :

_result = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQL ['arma2game', 'updateb', '%1']", _queryvalue];

_result

I can call the stored procedure from the mysql cli without issues so I know it isn't example :

mysql> call updateb(1,300);

Query OK, 1 row affected (0.00 sec)

But I am not even getting that far as soon as the code is executed on the server side it causes a crash like above mentioned .

Thanks,

Nohau

Share this post


Link to post
Share on other sites
Everything works great so far. But I encountered a small problem.

When I store a float variable

8059.2001953125

then retrieve it:

[[["8059.2001953125"]]]

Removing the array and turning it into a number works by using:

_var = call compile _var;
_var = _var select 0;
_var = _var select 0;
_var = _var select 0;

_var = parseNumber _var; 

This turns it into a workign number, but it stops after the .

8059

It appears when the string is returned rom the database the . is turned into a , and parsenumber does not recognize a comma as a dot.

Is there an solution for this? I could try to pre-multiply the data before storing it into the database and have it store ints but that does not seem practical. Is there a way to replace a comma inside a string?

---------- Post added at 07:25 AM ---------- Previous post was at 07:22 AM ----------

Actually I found a solution:

https://dev-heaven.net/docs/cba/files/strings/fnc_replace-sqf.html

This appears to fix it.

Hey, I see that you've fixed your problems and would like to ask you : What exactly did you do to get rid of the error that you mentioned before?

This one :

throw "System.Reflection.TargetInvocationException"

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  

×