Jump to content
Sign in to follow this  
firefly2442

Arma2MySQL

Recommended Posts

See the readme. There is a new async call and changes that need to be done on the sqf side. Good luck. Thanks for testing.

Share this post


Link to post
Share on other sites
See the readme. There is a new async call and changes that need to be done on the sqf side. Good luck. Thanks for testing.

So is asynchronous only good for loading several peoples stats or how would I go about looping the insert / update? Also is it only needed the loop when querying the server several times for your stats not just once? Sorry I'm just beginning this mysql stuff :)

Edited by Infection

Share this post


Link to post
Share on other sites

You still need to limit the server to running one command at a time. So you can't run multiple commands at once. However, the performance should be better now because it won't block the callExtension method. You can see here for an example:

https://github.com/firefly2442/Arma2NetMySQLPlugin-Arma3-ExampleMission/blob/async-development/as_loadouts/server_events.sqf

There is a while loop that wlll constantly call the plugin until the result is returned. It's similar to what we had before but a little different in that the logic for checking this is on the SQF side.

Share this post


Link to post
Share on other sites
You still need to limit the server to running one command at a time. So you can't run multiple commands at once. However, the performance should be better now because it won't block the callExtension method. You can see here for an example:

https://github.com/firefly2442/Arma2NetMySQLPlugin-Arma3-ExampleMission/blob/async-development/as_loadouts/server_events.sqf

There is a while loop that wlll constantly call the plugin until the result is returned. It's similar to what we had before but a little different in that the logic for checking this is on the SQF side.

I get this error in arma2net

07/17/2013 21:22:52 function: Arma2NETMySQLCommandAsync ['life', 'SELECT uid, name, bank, inventory, license, streetrep, vehicle FROM users WHERE uid = '####' AND name = 'Infection' AND side = 'CIV'']

07/17/2013 21:22:52 maxResultSize: 4095

07/17/2013 21:22:57 Caught exception of type Arma2Net.Managed.FunctionNotFoundException

07/17/2013 21:22:57 Arma2Net.Managed.FunctionNotFoundException: The specified add-in was not found: Arma2NETMySQLCommandAsync

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)

The addin shows up in arma2net explorer even.

however the normal functions work. (I did compile the async version I made sure of that! :p)

Edited by Infection

Share this post


Link to post
Share on other sites

Did you copy the DLL from the plugin to the right spot? It doesn't seem to be able to find it. I'm assuming you checked out the appropriate branch and so on. It sounds like you did. :)

Share this post


Link to post
Share on other sites

Aha I forgot I keep my addins folder in the actual arma 2 directory else it can't find it, thanks! Silly mistake!

Share this post


Link to post
Share on other sites

Sorry for not posting my results! Been busy, however it was working great with 32 people on the server, loading and saving. No major lag so far. I just gotta figure out a more reliable wait system for the client instead of a sleep to wait for him to recieve his stats.

Share this post


Link to post
Share on other sites

I have an issue with this addon..

I'm sure it's working because connection to db are ok, and so on but i can't find anywhere the mysqlconnector 6.6.5.0 it doesn't exist anymore.. how can i do ?

ok i found it maybe this will help others..

http://dev.mysql.com/downloads/connector/odbc/5.0.html

Edited by Mariodu62
found

Share this post


Link to post
Share on other sites

Glad you found it, all the download links for these things are in the readme file if anyone else has the same issue.

Share this post


Link to post
Share on other sites

For some reason I cant get this to work.

This is my Arma2NET log-file

http://pastebin.com/A5c1pphV

And this is my Arma2NETMySQL log-file

Info: 00:26:10 - Logging started in directory: C:\Users\Adam\AppData\Local\Arma2NETMySQL/logs/
Info: 00:26:10 - Arma2NETMySQL Plugin Started.
Info: 00:26:10 - Version number: 0.1.0.0
Info: 00:26:10 - Loading databases...
Info: 00:26:10 - Databases.txt file loading in from: D:\Steam\steamapps\common\Arma 3\Databases.txt
Info: 00:26:10 - Type: mysql Database: arma3 IPAddress: 127.0.0.1 Port: 3306 Username: arma Password: NotShownForSecurityReasons

I downloaded the Arma2NET MySQL plugin from the link supplied on the first page (https://www.dropbox.com/sh/ngix8aunt9nnwj7/ZHt1agEeM0)

I have tried on both my computer and my server, with the same result.

Both my computer and my server are running .NET Framework 4.5

This is where the files are located within my Arma 3 directory.

7f1057b2b449f56fddb81bc2f85d5ce7.png

And as you see the Databases.txt is located in the Arma 3 directory and is found by the extension.

Would be awesome if any of you guys could help me figure this out.

// Qzen

Share this post


Link to post
Share on other sites

Don't worry, this is the same issue that tons of people have had. I don't know how to fix it. It has something to do with where it looks for DLLs and specific versions of the DLL files. It's incredibly frustrating.

Try copying the System.Data.SQLite.dll and MySQL.Data.dll to the @Arma2NET root folder. Based on the error, it can't load in the SQLite dll. Also, make sure you have version 1.0.85.0 installed of the SQLite dependency (it might be slightly old now).

Share this post


Link to post
Share on other sites

I moved both System.Data.SQLite.dll and MySQL.Data.dll out to the @Arma2NET directory and now I can read from the database.

Thanks so much for the help. <3

// Qzen

Share this post


Link to post
Share on other sites

Well, this is weird.

It works on my computer but on the server it doesn't.

It gets stuck at "Reading mission..." and the log just stops there but the process isn't saying "Not responding".

So is it possible that the server might be missing any of the dependencies? In that case what dependencies might it be?

As I said before, the server is running .NET Framework 4.5, MySQL Connector 6.6.5.0 and the latest MySQL server.

What else do I need?

Edited by Qzen
Added MySQL Connector to the installed apps on the server.

Share this post


Link to post
Share on other sites

Well, I cant find the old version of the SQLite dependencies thats linked in the readme.

And I dont know what to do with the dll files in the new versions.

Do I put them in the Arma2NET directory?

Share this post


Link to post
Share on other sites

You could try, although it may not work. I'll try to remember to update the compiled version and put it on dropbox this weekend. Frankly, this is all kind of a pain because every time there is a minor DLL change in either of the dependencies, everything has to be recompiled and reuploaded. It's just kinda hard for me to keep up.

Share this post


Link to post
Share on other sites

I still have the same problem with the mission getting stuck at "Reading mission...".

I have no idea what I might be missing on the server.

All the MySQL, SQLite, .NET Framework and VC++ Redist is matching what I have installed on my computer.

And as of now the folder layout is the same as on my computer.

The addons are copied over the same way as they are on my computer to the server.

//Qzen

Share this post


Link to post
Share on other sites

After recompileing the Arma2NETMySQL on the server it seems to work.

I am now running your test mission on Stratis and it saves the loadouts as supposed to.

Well, thanks for the help. Now I need to get started on making my own mission...

//Qzen

Share this post


Link to post
Share on other sites

Yes - Im a noob when it comes to arma 2 scripting, but i am catching on quick.

So when I run a local server (Not Dedicated) everything works great. Then When I get the SAME mission file running on a dedicated it stops working....

The lines of .SQF Code:

_SRP_uid = format ["%1", getPlayerUID player ];
_SRP_table = "saveddata";

(format ['server globalChat "_SRP_uid = %1";', _SRP_uid]) call broadcast; //DEBUG MESSAGE 1

(format ['server globalChat "GetPlayerUID = %1";', getPlayerUID player]) call broadcast; //DEBUG MESSAGE 2

_selectTest = "Arma2Net.Unmanaged" callExtension format["Arma2NETMySQLCommand ['arma', 'SELECT * FROM %1 WHERE uid='%2'']",_SRP_table, getPlayerUID player ];

On BOTH servers I get both debug messages and they both say my UID......

Ive also tried changing it to:


_selectTest = "Arma2Net.Unmanaged" callExtension format["Arma2NETMySQLCommand ['arma', 'SELECT * FROM %1 WHERE uid='%2'']",_SRP_table, _SRP_uid ];

MY LOGS

DEDICATED SERVER:

Info: 10:40:15 - Received - Database: arma SQL Query: SELECT * FROM saveddata WHERE uid='
Warning: 10:40:15 - MySQL error. MySql.Data.MySqlClient.MySqlException (0x80004005): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''' at line 1

LOCAL SERVER:

Info: 11:24:13 - Received - Database: arma SQL Query: SELECT * FROM saveddata WHERE uid='1354*****'

(*I ADDED **** FOR SECURITY)

SO....Why is it sending my UID on local and not deticated?? ..and Why does it show up in my debug messages and then not get passed to the query?!?!

From my extensive experience at a programmer - this makes no f-ing sense...

Edited by Reefer420

Share this post


Link to post
Share on other sites

After Testing some more - I found that if I connect to the server with @Arma2Net activated from another computer...it works perfect!

So do all players have to have @Arma2Net installed or what?

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  

×