Jump to content
Sign in to follow this  
firefly2442

Arma2MySQL

Recommended Posts

I think it should show up in the log file. I didn't think it would be helpful on the Arma side.

Share this post


Link to post
Share on other sites

One question to you firefly. Why is the new addon returning multiple rows as a single array, this seems to be not intended and worked diffrently in previous versions. Is this a bug or just a design of the new addon (Why double arrays then?)?

Thanks for the addon anyway, great work!

Edited by guruabdul

Share this post


Link to post
Share on other sites

Are you referring to differences between the original application:

https://dev-heaven.net/projects/arma2-mysql

and the new one:

https://github.com/firefly2442/Arma2NETMySQLPlugin

? If so, then it relates to the processing that was required on the SQF scripting side in order to turn the string into an array of arrays. Now, it's returning the result through Arma2NET. I'm unaware if I can return an array of arrays in Arma2NET. I'll ask.

Share this post


Link to post
Share on other sites

I think I'm refering to the changes between the new one (I use the one from the Persistentdb package its 0.1.0.0? and Arma2NET 1.11 I think) and the previous one that was working on Arma2NET 1.9. If I do a SELECT and it returns multiple rows your addin used to return a string "[[row1],[row2],[row3]...[rown]]", which you could then compile and use in the sqf as an array of arrays, but now it returns data like this "[[row1,row2,row3...rown]]". So the way to access the columns for separate rows gets completly different as you have to iterate through the array of columns from each row [[r1column1,r1column2,r1column3,r2column1,r2column2,r2column3,....]]. If that's the new way of accessing the data then wouldnt it be better to just return "[row1,row2,...]", that's what makes me think it was unintentional. Hope I'm making some sense ;)

Edited by guruabdul

Share this post


Link to post
Share on other sites

Yep, makes sense. I'll take a look this weekend if I have some time.

Share this post


Link to post
Share on other sites

Implemented code for returning a two-dimensional array but I'm getting a runtime error. Haven't had time to look at it closely but it's coming along. :)

Share this post


Link to post
Share on other sites

Well, pushed the changes. Now it should return an array of arrays back to Arma. I haven't tested it much so if anybody wants to be awesome and find the bugs that would be great. Thanks! :)

Share this post


Link to post
Share on other sites

Well I'll try it out as soon as I download Visual Studio... or maybe is there some other way to compile your code?

Share this post


Link to post
Share on other sites

I'm running this and all it hints is <null>. No logs are created in /logs of the ArmA2NET AppData folder when this script is run. The script is obviously being called properly and is running. This is using the exact same installation as the one I ran the PDB on, PDB was able to read/write to the database and logs were created. What the hell is wrong? I'm begging you, please help, I will give you any information you need! I just want to get this working so I can keep making the mission! PLEASE!

player groupChat "Line Good1";

private ["_mysqltest"];

player groupChat "Line Good2";

_mysqltest = "Arma2Net.Unmanaged" callExtension "Arma2NETMySQLCommand ['teamspeak3', 'SELECT `client_lastconnected` FROM `clients` WHERE `client_id` = '2'']";

player groupChat "Line Good3";

_mysqltest = call compile _mysqltest;

player groupChat "Line Good4";

hintSilent format ["%1", _mysqltest];]

Share this post


Link to post
Share on other sites

The plugin now compiles against the latest version of Arma2NET version 2.0 Changes pushed.

Share this post


Link to post
Share on other sites

Are you using a prebuilt version or did you compile yourself? If you compiled yourself, try rebuilding now that you have the .NET stuff installed.

Share this post


Link to post
Share on other sites

I am using firefly2442-Arma2NETMySQLPlugin-1df7310 and it seems that the code in Arma2NETMySQLPlugin.cs has "using AddInView;" which is looking for the addinview.dll that seems to be missing from Arma2Net 2.0 to compile I had to use the dll in Arma2Net 1.3, else it would not compile. It seems to build with "//using AddInView;" commented out. Still getting the following:

07/22/2012 12:14:46 Log: Unmanaged side loaded

07/22/2012 12:14:47 Info Successfully loaded into process arma2oaserver

07/22/2012 12:14:47 Info Arma2NET 2.0.0.0 initializing on CLR 4.0.30319.1

07/22/2012 12:14:47 Info Loading addins

07/22/2012 12:14:47 Info Loaded Arma2NETMySQL 0.1.0.0 by firefly2442: Runs MySQL procedure commands.

07/22/2012 12:14:47 Info Loaded Arma2NETMySQLCommand 0.1.0.0 by firefly2442: Runs raw MySQL commands

07/22/2012 12:14:47 Info Loaded CompareVersion 2.0.0.0 by Scott_NZ: Compares two version strings and returns an integer indicating how they compare.

07/22/2012 12:14:47 Info Loaded ClrVersion 2.0.0.0 by Scott_NZ: Retrieves the version of the Common Language Runtime.

07/22/2012 12:14:47 Info Loaded Version 2.0.0.0 by Scott_NZ: Returns the version of Arma2NET.

07/22/2012 12:14:47 Info Loaded CommandLine 2.0.0.0 by Scott_NZ: Returns the command line used to start the application.

07/22/2012 12:14:47 Info Loaded DateTime 2.0.0.0 by Scott_NZ: Returns the current date and time.

07/22/2012 12:14:47 Info Arma2NET initialized in 00:00:00.6273071

07/22/2012 12:14:47 Error Caught exception of type System.IO.FileNotFoundException

System.IO.FileNotFoundException: Could not load file or assembly 'Arma2Net.Managed.dll' or one of its dependencies. The system cannot find the file specified.

File name: 'Arma2Net.Managed.dll' ---> System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

at System.Reflection.AssemblyName.nGetFileInformation(String s)

at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)

at Arma2Net.AddInProxy.Utils.get_Version()

at Arma2NETMySQLPlugin.Startup.StartupConnection()

at Arma2NETMySQLPlugin.Arma2NETMySQLPlugin.Invoke(String args, Int32 maxResultSize)

at Arma2Net.Managed.AddInManager.InvokeAddInImpl()

at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)

at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)

at Arma2Net.Managed.AddInManager.InvokeAddIn(String addInName, String args, Int32 maxResultSize)

at Arma2Net.Managed.Bridge.InvokeFunction(String function, Int32 maxResultSize)

thanks,

BB

Edited by bjbourn

Share this post


Link to post
Share on other sites

It's odd that it can't find the Managed.dll What if you copy "Arma2Net.Managed.dll" into the "@Arma2NET\AddIns\Arma2NETMySQLPlugin\" folder?

Share this post


Link to post
Share on other sites

I get the same error. From my testing it seems to be looking in my "Expansion\beta" folder where the armaoaserver.exe is being launched from, instead of the @Arma2Net folder. This is the same behavior that Arma2Net was showing before the 2.0 version. Anything else I should try?

thanks,

BB

edit: I just saw a new code commit. I will try that now.

Boooo, still no joy...

07/22/2012 15:46:48 Log: Unmanaged side loaded

07/22/2012 15:46:48 Info Successfully loaded into process arma2oaserver

07/22/2012 15:46:48 Info Arma2NET 2.0.0.0 initializing on CLR 4.0.30319.269

07/22/2012 15:46:48 Info Loading addins

07/22/2012 15:46:48 Info Loaded Arma2NETMySQL 0.1.0.0 by firefly2442: Runs MySQL procedure commands.

07/22/2012 15:46:48 Info Loaded Arma2NETMySQLCommand 0.1.0.0 by firefly2442: Runs raw MySQL commands

07/22/2012 15:46:48 Info Loaded CompareVersion 2.0.0.0 by Scott_NZ: Compares two version strings and returns an integer indicating how they compare.

07/22/2012 15:46:48 Info Loaded ClrVersion 2.0.0.0 by Scott_NZ: Retrieves the version of the Common Language Runtime.

07/22/2012 15:46:48 Info Loaded Version 2.0.0.0 by Scott_NZ: Returns the version of Arma2NET.

07/22/2012 15:46:48 Info Loaded CommandLine 2.0.0.0 by Scott_NZ: Returns the command line used to start the application.

07/22/2012 15:46:48 Info Loaded DateTime 2.0.0.0 by Scott_NZ: Returns the current date and time.

07/22/2012 15:46:48 Info Arma2NET initialized in 00:00:00.4973337

07/22/2012 15:46:48 Error Caught exception of type System.IO.FileNotFoundException

System.IO.FileNotFoundException: Could not load file or assembly 'Arma2Net.Managed.dll' or one of its dependencies. The system cannot find the file specified.

File name: 'Arma2Net.Managed.dll' ---> System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

at System.Reflection.AssemblyName.nGetFileInformation(String s)

at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)

at Arma2Net.AddInProxy.Utils.get_Version()

at Arma2NETMySQLPlugin.Startup.StartupConnection()

at Arma2NETMySQLPlugin.Arma2NETMySQLPlugin.Invoke(String args, Int32 maxResultSize)

at Arma2Net.Managed.AddInManager.InvokeAddInImpl()

at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)

at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)

at Arma2Net.Managed.AddInManager.InvokeAddIn(String addInName, String args, Int32 maxResultSize)

at Arma2Net.Managed.Bridge.InvokeFunction(String function, Int32 maxResultSize)

BB

Edited by bjbourn

Share this post


Link to post
Share on other sites

I misread the stack trace you posted in the Arma2NET thread. Reading it again with a refreshed mind, it looks like it might actually might be a bug with Arma2NET. Try commenting out any calls to Utils.Version, such as line 30 of Startup.cs.

Share this post


Link to post
Share on other sites

Are you running the Arma2 client or dedicated server? I haven't really tested this at all with the dedicated server, although I think it should work. The only thing I would suggest is when you set the references in your visual studio project and compile, make sure it's pointing to your root Arma2 folder and the @Arma2NET folder for all those DLL files.

Share this post


Link to post
Share on other sites

Is there somewhere I can get a compiled version just so I know it's not the specific version I have? It would be nice to be able to rule that out, would you be able to post a compiled version? I have the version posted in the PDB thread by Jman at the moment.

Edited by Polaris

Share this post


Link to post
Share on other sites

I am running the beta dedicated server, Version 1.62.95208

I tried adding "C:\Program Files\Bohemia Interactive\Arma 2\@Arma2NET" and "C:\Program Files\Bohemia Interactive\Arma 2" to the reference paths. Also I tried adding "Arma2Net.Managed.dll" and "Arma2Net.Unmanaged.dll" to the references list. Still getting the same error as last post.

thanks,

BB

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  

×