Jump to content
Sign in to follow this  
firefly2442

Arma2MySQL

Recommended Posts

Perhaps callExtension support on Linux is something that they will add in the future if there is enough community support? I would love to see it as I am a big Linux fan. :)

Share this post


Link to post
Share on other sites
Perhaps callExtension support on Linux is something that they will add in the future if there is enough community support? I would love to see it as I am a big Linux fan. :)
Wishful thinking im afraid.

Of course there's always a Maybe, but it seems small chance here, considering they said themselves, and third class support of linux.

Share this post


Link to post
Share on other sites

Can anyone provide a simple to follow step by step guide to set this up and get the server to connect to the Database

Please

I keep getting this error in my server rpt file:

== C:\Program Files\Bohemia Interactive\ArmA 2\arma2oaserver.exe

== "C:\Program Files\Bohemia Interactive\ArmA 2\arma2oaserver.exe" -config=Server.cfg -mod=@CBA;@Arma2NET;@JayArma2Lib -arma2netdev

=====================================================================

Exe timestamp: 2011/12/23 09:44:32

Current time: 2012/05/12 14:36:11

Version 1.60.87548

14:36:11 ca\missions\MPScenarios\MP_Deathmatch.chernarus: string @str_mpdeathmatch_subname cannot be localized client-side - move to global stringtable

14:36:28 ca\missions\MPScenarios\MP_Deathmatch.chernarus: string @str_mpdeathmatch_subname cannot be localized client-side - move to global stringtable

14:36:34 Mission DBTest.Chernarus: Number of roles (1) is different from 'description.ext::Header::maxPlayer' (30)

14:37:24 [13184,273.603,0,"XEH: PreInit Started. v3.3.3. MISSINIT: missionName=DBTest, worldName=Chernarus, isMultiplayer=true, isServer=true, isDedicated=true"]

14:37:26 [13184,275.057,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"]

14:37:26 [13185,275.187,0,"XEH: PostInit Started"]

14:37:26 [13185,275.24,0,"CBA_VERSIONING: cba=0.8.3.175, "]

14:37:26 [13185,275.254,0,"XEH: PostInit Finished. State: _isClient=false, _isJip=false, _isDedClient=false, _isServer=true, _isDedServer=true, _playerCheckDone=true, _sp=false, _startInitDone=true, _postInitDone=true, _mpRespawn=true, _machineType=0, _sessionId=1, BIS_functions=L 1-1-A:1, group=L 1-1-A"]

14:37:26 ["PersistentDB: pdb settings loaded"]

14:37:26 "############################# Co30 ACE KH PDB Vicious Villains #############################"

14:37:48 Error in expression <ame];

_response = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQL ['%>

14:37:48 Error position: <callExtension format ["Arma2NETMySQL ['%>

14:37:48 Error Missing ;

14:37:48 File mpmissions\__cur_mp.Chernarus\persistentDB\initPlayerConnection.sqf, line 47

14:37:48 Error in expression <ame];

_response = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQL ['%>

14:37:48 Error position: <callExtension format ["Arma2NETMySQL ['%>

14:37:48 Error Missing ;

14:37:48 File mpmissions\__cur_mp.Chernarus\persistentDB\initPlayerConnection.sqf, line 47

14:37:48 Server: Object 3:2 not found (message 225)

14:37:48 Error in expression <ame];

_response = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQL ['%>

14:37:48 Error position: <callExtension format ["Arma2NETMySQL ['%>

14:37:48 Error Missing ;

14:37:48 File mpmissions\__cur_mp.Chernarus\persistentDB\initPlayerConnection.sqf, line 47

14:37:48 Error in expression <ame];

_response = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQL ['%>

14:37:48 Error position: <callExtension format ["Arma2NETMySQL ['%>

14:37:48 Error Missing ;

14:37:48 File mpmissions\__cur_mp.Chernarus\persistentDB\initPlayerConnection.sqf, line 47

Thanks in advance

Edited by Telson_VBAU

Share this post


Link to post
Share on other sites

You need to use the latest beta patch.

Share this post


Link to post
Share on other sites

Well I have just downloaded all the bits I thought I needed and tried.

Weather I got it right or wrong I have no idea.

Im prety sure its not the mission just the communication between Arma2 and the database.

A step by step idiots guite to set this up would be helpfull.

in the likes of:

downlodad this, put it here etc

run this, then this etc

Lets start from I have arma2 and a database thats it lol

Thanks

Edited by Telson_VBAU

Share this post


Link to post
Share on other sites

Ok lets start at the beginning.

1. Download the following archive: http://www.kellys-heroes.eu/files/PersistentDB.7z

2. Install Arma2 beta version 87640 or later and Arma2NET and .NET Framework 4 Client Profile on your server.

3 Install MYSQL and MYSQL Connector on your server.

4. Copy the @Arma2NET folder from the archive to your servers @Arma2NET directory. This contains Firefly's Arma2NET addin for MYSQL.

5. Extract the .sql files from the dbschema directory, pick one that you feel most comfortable with using to create the database tables and stored procedures.

6. Extract the database.txt file and write your server's MYSQL connection settings into it and copy it to your server's Arma2 ROOT folder.

7. Copy the Co18_PDB_ConvoyHell_v1-5-100.Takistan.pbo from the archive's example mpmission/NON ACE folder to your server's MPMissions folder.

8. Create a launch bat file or whatever you use on your server and add the following (you need to do this since at present the addin is not signed)

-arma2netdev

and

-mod=expansion\beta;expansion\beta\expansion;@CBA;@CBA_A2;@CBA_OA;@Arma2NET

9. Launch your server and connect to it with a client. The client does NOT need to run Arma2NET/CBA since all database calls are done by the server.

10. You do not need jayarma2lib on the server or client for this demo. You can turn PDB ACE support on/off by editing the pdbSetup.sqf: pdb_ace_enabled

11. The mission scripts folder in the archive contains the minimum you need to add to a vanilla MP Arma2 mission to make it PDB.

12. You can download updates from here but you'll need to register to access the git repository (you no longer need the Arma2MySQL folder in the repo since that is now legacy i.e old jayarmalib pipe connections) and you can ask questions regarding the demo here.

13. I've left out the www folder from the provided archive. You can grab it from the git archive it you want to. It's not required but contains the webbased php frontend to alter saved PDB data. I'm still developing it so it's pretty rough around the edges at the moment and does not support all features presently. You'll need to be PHP savvy to get it up and running. A tutorial will follow later in it's development.

14. I had an issue on my Windows server which was resolved here.

15. Copy the MySQL.Data.Dll to the ARMA2, ARMA2Net and Arma2NETMySQLPlugin (to cover all bases!)

Edited by [KH]Jman

Share this post


Link to post
Share on other sites

Well I still got the same error

I followed the guide to the letter.

Does anyone have a basic mission without all the ACE stuff that works?

Does the database need to on the server or can it be hosted elsewere?

Edited by Telson_VBAU

Share this post


Link to post
Share on other sites

Ace really has no bearing over whether PDB works or not. Can you be specific regarding the error that you are getting?

The mysql server can be hosted elsewhere providing that you have setup the database.txt file accordingly and the correct 3306 port is open on the database server for traffic.

Also may I suggest that you use that thread since this thread is pretty much defunct now since Arma2MySQL has now been superseded by Firefly's new Arma2NET addin.

Edited by [KH]Jman

Share this post


Link to post
Share on other sites

Sorry all. Been having major computer problems for the past week so I'll be down for another couple days while I get a new computer together. :/

Really maddening not having a computer so I can test this stuff. :)

Share this post


Link to post
Share on other sites

Hi JMan,

maybe you can help... I hope so... ;-)

RPT Message:

12/06/13, 15:33:08 Warning: looped for animation: ca\tracked\data\anim\t72_driver.rtm differs (looped now 1)! MoveName: t72_driver
2012/06/13, 15:33:11 [4862,133.031,0,"XEH: PreInit Started. v1.0.0.179. MISSINIT: missionName=Co30_ACE_KH_PDB_Batfields_2_12, worldName=Chernarus, isMultiplayer=true, isServer=true, isDedicated=true"]
2012/06/13, 15:33:14 Error in expression <} else {

_return = "JayArma2Extension" callExtension _call;
};
_return;
};

[] >
2012/06/13, 15:33:14   Error position: <callExtension _call;
};
_return;
};

[] >
2012/06/13, 15:33:14   Error Missing ;
2012/06/13, 15:33:14 File x\jayarma2lib\addons\common\XEH_preinit.sqf, line 31
2012/06/13, 15:33:14 Error in expression <} else {

_return = "JayArma2Extension" callExtension _call;
};
_return;
};

[] >
2012/06/13, 15:33:14   Error position: <callExtension _call;
};
_return;
};

[] >
2012/06/13, 15:33:14   Error Missing ;
2012/06/13, 15:33:14 File x\jayarma2lib\addons\common\XEH_preinit.sqf, line 31
2012/06/13, 15:33:27 [4862,149.971,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"]
2012/06/13, 15:33:29 ACE_T72BA_Base: HatchCommander - unknown animation source hatchCommander
2012/06/13, 15:33:29 2S6M_Tunguska: poklop_commander - unknown animation source hatchCommander
2012/06/13, 15:33:47 [4862,146.577,0,"x\ace\addons\sys_explosives\XEH_preInit.sqf:6","Initializing: ace_sys_explosives version: 1.13.0.558"]
2012/06/13, 15:33:47 [4862,148.457,0,"x\ace\addons\sys_wounds\XEH_preInit.sqf:8","WARNING: Enhanced Armor difficulty options enabled - this is not recommended in conjunction with ACE Wounds!"]
2012/06/13, 15:33:48 [4900,170.157,0,"XEH: PostInit Started"]
2012/06/13, 15:33:48 [4900,170.195,0,"CBA_VERSIONING: cba=1.0.0.183, cba_a2=1.0.0.8, cba_oa=1.0.0.6, ace=1.13.0.558, acex=1.13.0.363, acex_ru=1.13.0.69, acex_usnavy=1.13.0.71, "]
2012/06/13, 15:33:51 [4900,173.521,0,"XEH: PostInit Finished. State: _isClient=false, _isJip=false, _isDedClient=false, _isServer=true, _isDedServer=true, _playerCheckDone=true, _sp=false, _startInitDone=true, _postInitDone=true, _mpRespawn=true, _machineType=0, _sessionId=1, _level=0, _timeOut=false, _game=1, BIS_functions=L 1-1-I:1, group=L 1-1-I"]
2012/06/13, 15:33:51 ["PersistentDB: pdb settings loaded"]
2012/06/13, 15:33:51 "############################# Co30 ACE KH PDB Battlefields #############################"
2012/06/13, 15:33:51 ["CFG_enableCivilians: ",0]
2012/06/13, 15:33:51 ["CFG_enableAmbientAnimals: ",0]
2012/06/13, 15:33:51 ["CFG_enableAmbientVehicles: ",0]
2012/06/13, 15:33:54 ["DynamicWeather.sqf: Mixed, updating setOvercast:",0.32444]
2012/06/13, 15:33:54 ["DynamicWeather.sqf: Mixed, updating setFog:",0.113556]
2012/06/13, 15:34:49 Error in expression <ame];

_response = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQL ['%>
2012/06/13, 15:34:49   Error position: <callExtension format ["Arma2NETMySQL ['%>
2012/06/13, 15:34:49   Error Missing ;
2012/06/13, 15:34:49 File mpmissions\__cur_mp.Chernarus\persistentDB\initPlayerConnection.sqf, line 46
2012/06/13, 15:34:49 Error in expression <ame];

_response = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQL ['%>
2012/06/13, 15:34:49   Error position: <callExtension format ["Arma2NETMySQL ['%>
2012/06/13, 15:34:49   Error Missing ;
2012/06/13, 15:34:49 File mpmissions\__cur_mp.Chernarus\persistentDB\initPlayerConnection.sqf, line 46
2012/06/13, 15:34:49 Error in expression <ame];

_response = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQL ['%>
2012/06/13, 15:34:49   Error position: <callExtension format ["Arma2NETMySQL ['%>
2012/06/13, 15:34:49   Error Missing ;
2012/06/13, 15:34:49 File mpmissions\__cur_mp.Chernarus\persistentDB\initPlayerConnection.sqf, line 46
2012/06/13, 15:34:49 Error in expression <ame];

_response = "Arma2Net.Unmanaged" callExtension format ["Arma2NETMySQL ['%>
2012/06/13, 15:34:49   Error position: <callExtension format ["Arma2NETMySQL ['%>
2012/06/13, 15:34:49   Error Missing ;

Can you give me any hints for this problem?

Serverstart:

arma2oaserver.exe -port=2355 -cfg=servercfg\server4\server4_basic.cfg -config=servercfg\server4\server4_config.cfg beta=Expansion\beta;Expansion\beta\Expansion -arma2netdev -mod=@CBA;@CBA_A2;@CBA_OA;@ACE;@ACEX;@ACEX_RU;@ACEX_USNAVY;@W_JayArma2Lib;;@Arma2NET;@W_ACRE

jayarma2lib and acre are selfsigned because we want players to use same versions... just if you wondering about the w_ ... ;)

Share this post


Link to post
Share on other sites

https://github.com/firefly2442/Arma2NETMySQLPlugin

Updated. Shows version number of Arma2NET that it is compiled with. Fixed so it works with the latest version of the MySQL Connector (6.5.4). Also works with latest Arma2NET (1.10). I think there were some problems and bug fixes related in this Arma2NET release because I never could get it to work with Arma2NET 1.9

Share this post


Link to post
Share on other sites

Didn't know that was what you were after - Bridge.Version dynamically returns its version, not the version that you compiled against. I will have a look at adding this for the next version.

Share this post


Link to post
Share on other sites

Ahh ok, I guess I'm unsure how C# deals with libraries (whether they're statically linked in or dynamic).

Share this post


Link to post
Share on other sites

hi mate thought i should post this error on here for you

06/25/2012 09:32:43 Log: Unmanaged side loaded

06/25/2012 09:32:43 Info Successfully loaded into process arma2oa

06/25/2012 09:32:43 Info Arma2NET 1.11.0.0 initializing on CLR 4.0.30319.269

06/25/2012 09:32:43 Info Sandboxing is disabled

06/25/2012 09:32:43 Info Rebuilding addin store

06/25/2012 09:32:43 Info Finding addins

06/25/2012 09:32:43 Info Found addins: Arma2NETMySQL, Arma2NETMySQLCommand, Activate, IsFunction, Deactivate, _Empty, VersionOfAddIn, CompareVersion, ClrVersion, Version, Functions, CommandLine, DateTime

06/25/2012 09:32:43 Info Activating base addins

06/25/2012 09:32:43 Info Activated Activate from BaseFunctionsPlugin.Activate, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/25/2012 09:32:43 Info Activated IsFunction from BaseFunctionsPlugin.IsFunction, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/25/2012 09:32:43 Info Activated Deactivate from BaseFunctionsPlugin.Deactivate, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/25/2012 09:32:43 Info Activated _Empty from BaseFunctionsPlugin._Empty, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/25/2012 09:32:43 Info Activated VersionOfAddIn from BaseFunctionsPlugin.VersionOfAddIn, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/25/2012 09:32:43 Info Activated CompareVersion from BaseFunctionsPlugin.CompareVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/25/2012 09:32:43 Info Activated ClrVersion from BaseFunctionsPlugin.ClrVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/25/2012 09:32:43 Info Activated Version from BaseFunctionsPlugin.Arma2NetVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/25/2012 09:32:43 Info Activated Functions from BaseFunctionsPlugin.Functions, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/25/2012 09:32:43 Info Arma2NET initialized

06/25/2012 09:32:43 Info Activated Arma2NETMySQLCommand from Arma2NETMySQLPlugin.Arma2NETMySQLPluginCommand, Arma2NETMySQLPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null (Sandboxed: False)

06/25/2012 09:32:43 Error Caught exception

Arma2Net.Managed.FunctionNotFoundException: The function was not found. Check that the function is loaded.

at Arma2NETMySQLPlugin.Arma2NETMySQLPluginCommand.Run(String args)

at AddInAdapter.Arma2NetAddInAddInAdapter.Run(String args, Int32 maxResultSize)

at HostAdapter.Arma2NetAddInHostAdapter.Run(String args, Int32 maxResultSize)

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

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

Share this post


Link to post
Share on other sites

Should be all straightened out with the latest code. If you find something that breaks it, let me know. :)

Share this post


Link to post
Share on other sites

ok this works

_selectTest = "Arma2Net.Unmanaged" callExtension "Arma2NETMySQLCommand ['cl2_maindatabase','SELECT * FROM useraccounts']";

player sidechat format["done Return %1",_selectTest];

and this fails

_command = format["Arma2NETMySQLCommand ['cl2_maindatabase','INSERT INTO useraccounts VALUES ('',%1,%2,%3,%4,%5,%6,%7,%8,%9,%10,%11,%12,%13,%14,%15,%16,%17,%18,%19,%20)']",_myusername,_mypassword,_mycash,_mybank,_myjob,_inv,_mywork,_isadmin,_Location,_inventory,_playerid,_skills,_licenes,_role,_outfit,_holster,_Rholster,_jailtime,_playtime,_DOB];

_returned = "Arma2Net.Unmanaged" callExtension _command;

returns false

this might be a escape issue

it might be a good thing to add a 3rd array eliment to escape the values so it end up as follows when quotes are used within a quote or do you consider this an end user issue?

INSERT INTO useraccounts VALUES ('',"Biiskaps","22lcwzg7uggh","60","600","Unemployed","[]","[0,0,0,\"Unemployed\",[]]","False","[3617.32,14817.5,0.00146484]","[[],[]]","4297478","[0,0,0,0,0,0]","[0,0,0,0,0,0,0,0]","CIV","","[\"\",false,false]","","0","0","[19,12,1990]");

i have tried this manually and it still returns false

_selectTest = "Arma2Net.Unmanaged" callExtension "Arma2NETMySQLCommand ['cl2_maindatabase','INSERT INTO useraccounts VALUES ("""",""Biiskaps"",""22lcwzg7uggh"",""60"",""600"",""Unemployed"",""[]"",""[0,0,0,\""Unemployed\"",[]]"",""False"",""[3617.32,14817.5,0.00146484]"",""[[],[]]"",""4297478"",""[0,0,0,0,0,0]"",""[0,0,0,0,0,0,0,0]"",""CIV"","""",""[\""\"",false,false]"","""",""0"",""0"",""[19,12,1990]"");']";

player sidechat format["done Return %1",_selectTest];

it could be done with something like this

vb.net

Public Function realescape(ByVal data As String) As String

Dim ds As String = ""

Try

If data <> String.Empty Then

data = data.Replace(Chr(34), "\" & Chr(34))

Else

Return ""

End If

Return data

Catch ex As Exception

Return data

Finally

End Try

End Function

Share this post


Link to post
Share on other sites

Hmm, yeah quotes and stuff probably should be handled client/user side. Otherwise then it starts getting really hairy.

If it's returning false, I think that means there's a problem with the MySQL statement. If you can't run the straight command via phpmyadmin or via the commandline or something then you need to check it.

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  

×