Jump to content
Sign in to follow this  
firefly2442

Arma2MySQL

Recommended Posts

Hi,

I haven't done any extensive testing with the plugin since I don't have that many people to test things. However, it's quite possible there could be an issue. For one, the database connection is kept open once it starts. A few questions:

1) What build of the plugin are you using? (What Git hash?)

2) How big is your database?

3) How many queries are run for each client when they connect?

4) Does restarting the mission fix the problem or restarting the server? If you have to restart the server which reloads the plugins, then it's quite probable that there's an issue with the plugin. If you just have to restart the mission, then it might be something else.

Share this post


Link to post
Share on other sites

Hi Firefly,

thanks for your reply! Regarding your questions:

1. Commit hash 09eb6495f763c323672227f6381fa294f87a41a8

2. Not really big, around 1-2MB, the biggest table has ~3500 lines. But each player only has online line where data is read/written for him

3. 1-5 queries on connection

4. Only restarting the server fixes it.

To be more specific - I am talking about the dayz sanctuary files originally published by guru abdul and now continued by ayan4m1.

Share this post


Link to post
Share on other sites

How are you passing data between the server and the clients in the sqf code? Depending on how that is setup (and cleaned up) you could be bogging down the server over time.

Share this post


Link to post
Share on other sites

The example mission code is coming along. Been making good progress with the masterful help of Riouken. :)

Share this post


Link to post
Share on other sites

Pushed an important fix for people using MySQL. The socket connection would stay open once started. This caused problems (aka crashing). Now, it will close down the connection after 30 minutes of inactivity. Let me know if it doesn't work.

Share this post


Link to post
Share on other sites

is it possible to set this up without any sql knowledge? i mean can i just install some files and it will work as long as i run the example mission? all i want is save people's weapons, position and health when they log off and load it when they log in. does the example mission already do that or do i have to set up an sql database myself?

and does this work when i host from my PC or do i need a dedicated server?

Share this post


Link to post
Share on other sites

Bad Benson,

You will need to have a small amount of knowlage or be able to follow some sql setup guides.

It can be ran on your local computer. If that's what your after I recomend:

http://www.apachefriends.org/en/xampp-windows.html

Xampp is what I use to test our dev locally before we push it to the dedi.

It has mysql and phpadmin.

The example mission is for weapon loadouts, it does not save your gear and then reload it when you connect. Its for users to make diffrent loadouts and they are saved to the database. They can then select and use them from the interface.

You should take a look at the mso Jman linked too above it has a lot of the features your talking about. This is more of the base tool, for mission makers to build off of and provide persistiance in there missions.

Share this post


Link to post
Share on other sites

It also works with SQLite which requires no setup at all. You do need to know some SQL though. The example mission doesn't currently support SQLite but we're working on adding support for it. It works when you launch it both just as a straight client and as a dedicated server.

Share this post


Link to post
Share on other sites

Work is continuing on the example mission. Recent beta improvements of the callExtension plugin are promising because they increase the limit of the string that can be passed.

Share this post


Link to post
Share on other sites

firefly do you think you can release compiled versions as well as the source code for those of us that prefer to use your releases as they come? :p. Please :).

Share this post


Link to post
Share on other sites

Sure. I guess I was going to wait til a final "stable" release but if that's something that is helpful for people, I can add compiled binaries.

Share this post


Link to post
Share on other sites

I added a note about potential SQL injection attacks in the readme. I also added support for loading in databases and other relevant files from the Arma2 root directory (as requested because some people use rental servers that are limited and cannot use AppData). I also added a compiled download. Let me know if it works.

https://github.com/firefly2442/Arma2NETMySQLPlugin/downloads

This link is now deprecated. Sorry.

Edited by firefly2442
Github downloads is now gone.

Share this post


Link to post
Share on other sites

Thank you very much firefly, I appreciate it! Also I'm having an issue with trying to write commas into the database, literally anything with a comma in it fails with "throw "System.IndexOutOfRangeException""? Any ideas?

Share this post


Link to post
Share on other sites

@Polaris:

Oh dear... I knew this day would come. So, the system uses commas to separate out the different groupings. Essentially, I need some character in order to split stuff out and I picked the comma. Thus, you can't really store stuff with commas in the database. If you look at the example mission here:

https://github.com/firefly2442/Arma2NetMySQLPlugin-ExampleMission/blob/master/as_loadouts/getAllWeapons.sqf

You can see that the various weapons and items are split up using "`". Then they're stored in the database this way. When we get them back, we just iterate through them as usual and then save that loadout to the player.

I guess I could look into some way of escaping commas in the data... I'm honestly not sure if this would be the best solution or not... Let me think on it a bit. If anyone else has any technical suggestions for this, I'm all ears. :)

Share this post


Link to post
Share on other sites

Ah, alright firefly, I thought it would be something like that! It's no problem, we'll use another symbol for the moment :). I have to say I'm really impressed with how the plugin has progressed, you're doing a great job, thank you!

By the way, when using the .dll you uploaded I get this error throw "System.IO.FileNotFoundException", I have no idea why :(.

Edit: /Local/Arma2NETMySQL is now /Local/Arma2MySQL, that's why, it's working now :).

Edited by Polaris

Share this post


Link to post
Share on other sites
Ah, alright firefly, I thought it would be something like that! It's no problem, we'll use another symbol for the moment :). I have to say I'm really impressed with how the plugin has progressed, you're doing a great job, thank you!

By the way, when using the .dll you uploaded I get this error throw "System.IO.FileNotFoundException", I have no idea why :(.

Edit: /Local/Arma2NETMySQL is now /Local/Arma2MySQL, that's why, it's working now :).

? Is there a typo in my code somewhere? I'm confused, what did you have to change?

Share this post


Link to post
Share on other sites

So using the back tick (`), you would use the information it grabs from mysql and select data using SELECT as if the back ticks were commas?

---------- Post added at 09:42 AM ---------- Previous post was at 09:21 AM ----------

Ahh, nevermind. I found the CBA_fnc_split commands in selectLoadout.sqf.

Share this post


Link to post
Share on other sites
? Is there a typo in my code somewhere? I'm confused, what did you have to change?

Before the database.txt and logs were in Arma2NETMySQL but in the version you uploaded they are in Arma2MySQL so I just changed the database.txt to the new directory.

Share this post


Link to post
Share on other sites

I pushed some minor updates to the Readme with clarifications as well as changed the folder name to match program name. The folder is now "Arma2NETMySQL".

Share this post


Link to post
Share on other sites

I fixed an issue where upon returning a NULL result in the column via MySQL, the plugin would crash. The example mission now supports both SQLite and MySQL (all previously used stored procedures were replaced with straight SQL queries). The Github downloads page is now deprecated so you'll have to go back to compiling it on your own. Sorry. We're getting close to an actual release though so at that point hopefully people can host the files.

Next is creating tutorial videos and further testing.

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  

×