Page 1 of 75 123451151 ... LastLast
Results 1 to 10 of 746

  Click here to go to the first Developer post in this thread.  

Thread: Arma2MySQL

  1. #1

    Arma2MySQL

    This program acts as an intermediary between Arma2/Arma3 and a MySQL or SQLite database. It uses the
    Arma2NET wrapper system. It is written in C#. The program has to be run on the same system as your Arma2/Arma3 server, however, the MySQL database can be either local or remote. The SQLite database runs on the local machine.

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

    You can download compiled versions of the plugin here (the current version is v0.1.0.0-stable):

    https://www.dropbox.com/sh/ngix8aunt...ZHt1agEeM0?lst

    The beta testing version is: Arma2NETMySQLPlugin_v0.2.0.0-beta1.zip. This uses the new (under development) version of Arma2NET and is Windows only (at this time). There are some interface changes so you will need to make adjustments to existing missions that use the current stable 0.1 version. There is updated documentation in the zip folder itself. You should not need to install the MySQL or SQLite dependencies as they are already provided. There are also some minor security improvements and the example mission is updated to reflect this. I'm working on a Linux port but have been quite busy lately so it might be awhile. As always, testing is most appreciated.

    There is also a tutorial video available for download in the above link. It is slightly old and only shows Arma 2 instructions, but the instructions and setup for Arma 3 are essentially the same.

    Arma 2 Example Mission (currently deprecated, see the Arma 3 example instead):
    https://github.com/firefly2442/Arma2...ExampleMission

    Arma 3 Example Mission:
    https://github.com/firefly2442/Arma2...ExampleMission

    History:

    This program has had a long history. Initially, the program used JayArma2Lib because DLL injections were the only way to
    pass information between Arma2 and the outside. Eventually, BIS added callExtension
    which allowed for a more structured (non-hacky) way to pass information. JayArma2Lib switched to this and things continued. Development
    was done here and an example mission was
    here. Technically, all that code should still work but the bad
    part was all the formatting and ugly stuff that had to be done in game via the SQF scripting in order to get the data into a reasonable
    format. It involved iterating through strings and creating arrays and generally was still pretty hacky. Then,
    Arma2NET came along and things got better. This wrapper system allowed us to
    return nice results back to Arma2 and not have to deal with all the formatting nonsense. I ended up just copying the bits and pieces
    that were needed from the past project and creating a new application. Development is all done via the Github pages. In addition,
    the Persistent Database Scripts
    system as created by [KH]JMan currently uses builds of this program
    for saving data.

    Development initially started over at AlphaSquad (thanks guys, you rock!).

    http://www.alphasquad.net/forum/view...hp?f=71&t=3039

    Please read the documentation to get started. The plugin and each mission have a readme file. There is a lot of information in the readme and it should have everything you need to get started. If something is confusing or you don't understand the readme, please let me know.


    Translations of the readme to other languages has started.

    If you have questions of problems related to this program specifically, please post here. All problems related to missions or mods that use this program should be posted in their appropriate threads. Thanks!
    Last edited by firefly2442; Aug 15 2014 at 00:05.

  2. #2
    The main problem I see with persistent data systems in ArmA is that anyone can change the data. (Even if you disallow certain queries, someone with a script hack can still modify the data of other players.)

    Other than that, this looks like a cool project, at least if it's used on private/passworded servers.

    For a safer persistence system, has anyone looked into using sendUDPMessage and setting up a separate stat save system? You could then enforce certain rules on data modification (i.e. cross-reference with BE RCon and only allow users to modify their own data). Data retrieval could be done using the same methods (clipboard, JA2L, etc.).

  3. #3
    So all .sqf connections and calls have to be done on the server side. So the average Joe player isn't able to make a connection. It is also protected by the mysql stored procedures. If the query doesn't exist, it doesn't run. Now that still leaves the possibility of sql-injections and such but my main concern at the time was just getting this thing running.

    I hadn't heard of this UDPMessage command, that looks promising as well.

  4. #4
    Quote Originally Posted by firefly2442 View Post
    So all .sqf connections and calls have to be done on the server side. So the average Joe player isn't able to make a connection. It is also protected by the mysql stored procedures.
    Even if you have a changeScore PVEH (for example), don't you still have to pass on an identifier (player ID or unit name) for the player whose score you want to change? If so, what I mentioned would still be possible.

    Assuming you are using a PVEH to trigger the update, I don't believe there's a way to determine which client sent the PV update. I may be wrong on this, however. (The wiki shows two arguments for the PVEH: variable name and new value.)

    The ideal solution would be for BIS to add an "updater" argument for PVEHs.

  5. #5
    Perhaps look at security holes later .... for now open the possibilities of function right up!

  6. #6
    I am saying - If this get working, I am going to dance and it will make most of my ideas happen!

    EDIT: Question mains still, will I able to create a function "UCP" aka you can purchase weapons/set your gear from the website and it saves in the DB and then when you go in game - It will retrieve data about your user and see if it fits your username and give you the set gear that u have given in the site
    Last edited by brightness; Dec 26 2011 at 17:46.

  7. #7
    Absolutely, that's the idea. While I didn't write an online interface, it would be relatively simple to have something where you could just manipulate the database and pick/edit your gear. The idea is to be able to modify it both in-game and outside.

    I should stress that this is just an example. The application is generic enough so that you can create your own databases and stored procedures and really store whatever information you want. It's up to the person making the missions on how to use it.

  8. #8
    Perfect, I will take my time sir and make a UCP When it comes out in full version ^^ And hand a example to people out there if its necessarily.

    EDIT: I think I am going to boost of my VB studio CD and fresh up my C# coding and get this going ^^ If I want something to happen, I have to get my boot on it!

    Also - Linux support possibility? (Idea)

    ISSUE: I found out when I dled the GIT that I am missing mysqldata, is it a plugin you have or you scripted it?
    DOH Found out I need mysql connector ^^ My fault :P
    Last edited by brightness; Dec 27 2011 at 17:06.

  9. #9
    Yes, so Linux support might be possible with Mono:

    http://www.mono-project.com/Main_Page

    I never tried it but the C# code itself is pretty simple. I bet it might work.

  10. #10
    I will try that on the new dedi server we will get in next day or I will try on VWare but at moment I have a issue when I "build" the C# code, I get 3 errors:

    Error 2 'MySql.Data.MySqlClient.MySqlCommand' does not contain a definition for 'Clone' and no extension method 'Clone' accepting a first argument of type 'MySql.Data.MySqlClient.MySqlCommand' could be found (are you missing a using directive or an assembly reference?) C:\msysgit\msysgit\arma2-mysql\Arma2SQL.MySQLProvider\MySQLProvider.cs 130 51 Arma2SQL.MySQLProvider
    Error 3 'MySql.Data.MySqlClient.MySqlCommand' does not contain a definition for 'Clone' and no extension method 'Clone' accepting a first argument of type 'MySql.Data.MySqlClient.MySqlCommand' could be found (are you missing a using directive or an assembly reference?) C:\msysgit\msysgit\arma2-mysql\Arma2SQL.MySQLProvider\MySQLProvider.cs 142 53 Arma2SQL.MySQLProvider

    I haven't looked into it as I had to go but when I look at the code it looks fine, I am un sure if its because of my .NET(4.0 & 1.1) or mysql connector version(1.10)

    EDIT: Fixed all this - Looked into it and I am not hitting in any issues right now except what JMAN reported in but he gave me a fix for it.

    I am still trying to find the "Variables" for the class because I am trying to set the gear he choose from the loadout ^^

    And right now I find 0 explanation of each variable
    Last edited by brightness; Dec 27 2011 at 23:44.

Page 1 of 75 123451151 ... LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •