Jump to content
Sign in to follow this  
[kh]jman

ArmA2 Persistent Database Scripts - WIP

Recommended Posts

If you rename the database for lifeprojectrpg, you also need to modify the armaphpymadin.sql script as well so that it fits with your new database name.

Let me work on the example mission a little more and get that in better shape and then you can try that unmodified and see what you get. From the previous log files you've posted, the actual plugin portion seems to be working fine and it's connecting to the database. It just looks like perhaps you're missing something in the mission.

Try this. Run some of the stored procedures on the database without Arma2 or the plugin, just straight commands and make sure those work.

Share this post


Link to post
Share on other sites

Yes I know, PDB wouldn't be able to read/write if I hadn't done that :p.

That's exactly what I thought which is why I was asking if anything else was required in the mission for it to run. The plugin/arma2net must be working if PDB is able to read/write and successfully connect to the database. The fact that NO logs are created for either ArmA2Net or the plugin itself says to me that the command isn't actually able to even get past ArmA2Net or even call it otherwise there would be a log created for ArmA2Net.

Surely the stored procedures must be working if PDB works (excluding the create mission issue and the broken arma.sql)? And surely is the stored procedures weren't working then log files would still be created?

I just don't understand what's different between the way PDB calls the plugin and my/your mission does...

Does the small script you posted work on your server exactly as you posted it if you just stick it in a new mission by itself? My installation is merged vanilla and OA, with all three CBAs, ArmA2Net, your plugin put inside ArmA2Net and databases.txt in the root and using the latest beta. MySQL connector net is installed. The databases.txt file contains the correct info. Anything i've missed?

I've got Arma2NETMySQLPlugin.dll and MySql.Data.dll in @Arma2NET\AddIns\Arma2NETMySQLPlugin

"C:\Game Server\Expansion\beta\arma2oaserver.exe" -arma2netdev -name=ServerConfig -config=ServerConfig\server.cfg -cfg=ServerConfig\basic.cfg -profiles=ServerConfig -mod=expansion;ca;expansion\beta;expansion\beta\expansion;@CBA;@CBA_A2;@CBA_OA;@Arma2NET

Edit: I've really just run completely out of ideas. PDB works, the plugin works, ArmA2Net works...my beyond simply script doesn't. I can't do anything till I get this nonsense working and it's getting really boring, I've spent like a week trying to get this working now!

Edited by Polaris

Share this post


Link to post
Share on other sites

I just spent an hour setting up everything on my desktop and I had exactly the same issue as I'm having on the server. I'm trying to figure out what the PDB mission does that my mission is not doing but I can't see anything.

Edited by Polaris

Share this post


Link to post
Share on other sites

Hi Jman,

I have been getting some help from Firefly2442 with regards some issues ive been having getting Arma2Net and the MySQL Plugin working on my dedicated server. I am no longer getting errors with the Arma2Net stuff but I am still unable to get the PersistentDB demo mission working. I am a novice when it comes to Database stuff but I have got a couple of years experience in the scripting of Arma. The mission loads, once it gets to the connecting to DB screen I hear a 'hint' sound and it just sits there dumb and happy. I see it attempting to write to the database but ive checked and nothing is being written. I can jump onto TS and make myself available to get some help with this, I just really want to get it going.

Essentially I am trying to get this working to get an understanding on just what is possible with this add-on. I have not found any Tutorials on how to get this working. If I can work out exactly what I need to do to get it working I am more than happy to write the tutorial up.(with Pictures or a Video)

Unfortunately I have been trying for several weeks with no joy. I do have some log info here if you would like to look them over.

I am not sure where the problem lies, I think the database has been built, I am seeing tables after executing the .sql script.

Any help getting this operational would be HUGELY appreciated.

Things I would like help with.

1. How can I verify my database is allowing connections with the connection string I am using.

2. If that can be verified then it must be my config. I am only running the addon's you require for this to work. Namely, CBA and Arma2Net on the server.

3. Is there a less complex mission that can actually output some debug information that is readable ingame.

Regards,

OzDM

Share this post


Link to post
Share on other sites

There's another mission here but it's not even close to being finished. You can create new loadouts, that's about it...

https://github.com/firefly2442/Arma2NetMySQLPlugin-ExampleMission

Regarding your questions: If you have a "logs" folder and the plugin is writing files there and there are no errors, your database stuff is working fine. When the plugin loads, it makes a connection to the database(s) so it would show up right away.

@JMan, I did change the format through which it returns the result, perhaps that's the issue that folks are having? Now it's an array of arrays.

JMan is pretty busy lately I think so I can try the PDB mission this weekend if I have time.

Share this post


Link to post
Share on other sites

How exactly is the result returned now firefly? In what format?

Share this post


Link to post
Share on other sites

Before it was returning an array[], but now it's returning array[][]. So it's an array of arrays.

Share this post


Link to post
Share on other sites

Ok that's a little confusing :p. I've been playing around with it for a couple of days now and I just can't seem to call anything that I can actually use within the SQL script. I can write to the DB easily though, that's not a problem, it's just 'converting' the format of the read data.

Share this post


Link to post
Share on other sites

I admire everyone's tenacity for helping test this and I'm sorry some of you are having problems. However, you have to understand we're making changes to this often daily so that means things break and it's definitely still in development. No where near stable. But testing is good, because then you find things for us to fix! :D

Share this post


Link to post
Share on other sites

Yes the current PDB scripts are expecting the old array[] format return value format so please use the Arma2NETMySQLPlugin.dll addin plugin included with the PDB files and Arma2NET 1.11.1.0 or PDB will not work.

We are working on a big update for PDB but it takes time to build and most importantly to test so please be patient.

Please also be aware that the current available version of PDB is suffering for the following issue https://dev-heaven.net/issues/35827 which has just recently appeared in beta and 1.62 final. We are working on a fix and or pushing for BI to look into it.

Edited by [KH]Jman

Share this post


Link to post
Share on other sites

How good are the chances (in your opinion) that the persistent database script will run on Arma3 too?

Share this post


Link to post
Share on other sites

That depends on the callExtension method and whether it's available in Arma3. I would suspect it will be.

Share this post


Link to post
Share on other sites

anyway, would be great to use Arma2Net and the persDB on Arma3! Or I have to write my own Database system on java...

keep up the good work!

Share this post


Link to post
Share on other sites

hi guys, i hope somebody could help me.

i didn´t get the database running.

everytime i stuck at loading with "server is loading persistent mission data".

here my logs:

A2NET

 08/09/2012 18:28:32 Arma2Net.Managed.Bridge INFO Arma2NET 1.10.0.0 initializing on CLR 4.0.30319.269
08/09/2012 18:28:32 Arma2Net.Managed.Bridge INFO Sandboxing is enabled
08/09/2012 18:28:32 Arma2Net.Managed.AddIns.AddInManager INFO Rebuilding addin store
08/09/2012 18:28:32 Arma2Net.Managed.AddIns.AddInManager INFO Finding addins
08/09/2012 18:28:32 Arma2Net.Managed.AddIns.AddInManager INFO Activating base addins
08/09/2012 18:28:32 Arma2Net.Managed.AddIns.AddInManager INFO Activated Activate from BaseFunctionsPlugin.Activate, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
08/09/2012 18:28:32 Arma2Net.Managed.AddIns.AddInManager INFO Activated IsFunction from BaseFunctionsPlugin.IsFunction, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
08/09/2012 18:28:32 Arma2Net.Managed.AddIns.AddInManager INFO Activated Deactivate from BaseFunctionsPlugin.Deactivate, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
08/09/2012 18:28:32 Arma2Net.Managed.AddIns.AddInManager INFO Activated _Empty from BaseFunctionsPlugin._Empty, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
08/09/2012 18:28:32 Arma2Net.Managed.AddIns.AddInManager INFO Activated VersionOfAddIn from BaseFunctionsPlugin.VersionOfAddIn, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
08/09/2012 18:28:32 Arma2Net.Managed.AddIns.AddInManager INFO Activated CompareVersion from BaseFunctionsPlugin.CompareVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
08/09/2012 18:28:32 Arma2Net.Managed.AddIns.AddInManager INFO Activated ClrVersion from BaseFunctionsPlugin.ClrVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
08/09/2012 18:28:32 Arma2Net.Managed.AddIns.AddInManager INFO Activated Version from BaseFunctionsPlugin.Arma2NetVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
08/09/2012 18:28:32 Arma2Net.Managed.AddIns.AddInManager INFO Activated Functions from BaseFunctionsPlugin.Functions, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
08/09/2012 18:28:32 Arma2Net.Managed.Bridge INFO Initialized
08/09/2012 18:28:32 Arma2Net.Managed.AddIns.AddInManager INFO Activated Arma2NETMySQL from Arma2NETMySQLPlugin.Arma2NETMySQLPlugin, Arma2NETMySQLPlugin, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null (Sandboxed: False)

Server-rpt

=====================================================================
== E:\Steam\SteamApps\common\arma 2 operation arrowhead\Expansion\beta\arma2oaserver.exe
== Expansion\beta\arma2oaserver.exe  -arma2netdev -mod=expansion\beta;expansion\beta\expansion;@CBA;@CBA_OA;@CBA_A2;@Arma2NET;@ACE;@ACEX;@ACEX_RU;@ACEX_SM;@ACEX_USNavy -profiles=cfgace -config=cfgace\server.cfg -cfg=cfgace\arma2.cfg
=====================================================================
Exe timestamp: 2012/07/28 13:39:34
Current time:  2012/08/09 18:23:08

Version 1.62.95417
Item STR_ACE_IDN_LAUNCHAUTHORIZATION_RU listed twice
Updating base class RscIGUIListBox->RscListBox, by x\cba\addons\ui_helper\config.bin/RscDisplayMultiplayer/Controls/CA_ValueSessions/
18:23:43 Warning Message: No challenge value was received from the master server.
18:23:43 GameSpy QR2 error: 5, No challenge value was received from the master server.
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:46 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:47 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:47 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:47 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:47 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:47 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:47 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:47 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:25:47 Server error: Player without identity StUfz.OLLI (id 1372275392)
18:27:25 Warning: looped for animation: ca\anims\characters\data\anim\sdr\mov\erc\wlk\non\non\amovpercmwlksnonwnondf.rtm differs (looped now 0)! MoveName: amovpercmstpsnonwnondnon_amovpercmstpsraswpstdnon
18:27:25 Warning: looped for animation: ca\anims\characters\data\anim\sdr\mov\erc\wlk\non\non\amovpercmwlksnonwnondf.rtm differs (looped now 1)! MoveName: amovpercmrunsnonwbindf_rfl
18:27:37 [11616,292.911,0,"XEH: PreInit Started. v1.0.0.187. MISSINIT: missionName=Co30_ACE_KH_PDB_Batfields_2_12, worldName=Chernarus, isMultiplayer=true, isServer=true, isDedicated=true"]
18:27:41 [11616,296.424,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"]
18:28:05 [11616,295.564,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!"]
18:28:05 [11630,321.032,0,"XEH: PostInit Started"]
18:28:05 [11630,321.041,0,"CBA_VERSIONING: cba=1.0.0.187, cba_a2=1.0.0.8, cba_oa=1.0.0.6, ace=1.13.0.567, acex=1.13.0.365, acex_ru=1.13.0.71, acex_usnavy=1.13.0.72, "]
18:28:06 [11630,321.603,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"]
18:28:06 ["PersistentDB: pdb settings loaded"]
18:28:06 "############################# Co30 ACE KH PDB Battlefields #############################"
18:28:06 ["CFG_enableCivilians: ",0]
18:28:06 ["CFG_enableAmbientAnimals: ",0]
18:28:06 ["CFG_enableAmbientVehicles: ",0]
18:28:07 ["DynamicWeather.sqf: Mixed, updating setOvercast:",0.814404]
18:28:07 ["DynamicWeather.sqf: Mixed, updating setFog:",0.567737]
18:28:31 "SERVER MSG: count MISSIONDATA, 0"
18:28:32 Error in expression <select 0;    


}; 


if (_missionArray select 1 == pdb_fullmissionName) then { >
18:28:32   Error position: <select 1 == pdb_fullmissionName) then { >
18:28:32   Error Nullteiler
18:28:32 File mpmissions\Co30_ACE_KH_PDB_Batfields_2_12.Chernarus\persistentDB\initPlayerConnection.sqf, line 82
18:28:34 WARNING: Function 'name' - Andrey Lermontov is dead
18:28:34 WARNING: Function 'name' - Alyosha Putin is dead
18:28:34 WARNING: Function 'name' - Vasili Potapenko is dead
18:28:34 WARNING: Function 'name' - Aleksei Vasilyev is dead
18:28:34 WARNING: Function 'name' - Leonid Produnov is dead
18:28:34 WARNING: Function 'name' - Yevgeniy Pushkin is dead
18:28:34 WARNING: Function 'name' - Stepan Yakushkin is dead
18:28:35 WARNING: Function 'name' - Dimitri Smirnov is dead
18:29:19 WARNING: Function 'name' - Konstantin Gusakov is dead
18:30:29 WARNING: Function 'name' - German Pashinin is dead
18:31:20 WARNING: Function 'name' - Konstantin Turchinsky is dead
18:37:07 ["DynamicWeather.sqf: CLAY_Weather Mixed, updating setOvercast:",0.0796109]
18:37:07 ["DynamicWeather.sqf: CLAY_Weather Mixed, updating setFog:",0.0996028]

mysql log

Info: 18:28:32 - Arma2NETMySQL Plugin Started.
Info: 18:28:32 - Version number: 0.1.0.0
Info: 18:28:32 - Compiled with Arma2NET Version: 1.10.0.0
Info: 18:28:32 - Loading databases...
Info: 18:28:32 - Database: arma IPAddress: 127.0.0.1 Port: 3306 Username: arma Password: NotShownForSecurityReasons
Info: 18:28:32 - Received - Database: arma Procedure: GetMissionByName Parameters: tna=Co30 ACE KH PDB Battlefields
Info: 18:28:32 - Parsing parameters...

i also checked the auto increment funktion of the mission table.

Share this post


Link to post
Share on other sites

Hang tight, I'll be releasing a new beta version tomorrow.

Share this post


Link to post
Share on other sites

PersistentDB updated Dev-heaven repo and PersistentDB.7z

- PersistentDB Core rewrite

- New MYSQL DB Schema

- New example missions

- Arma2NETMySQL.dll compiled against Arma2Net 2.11.1

- Arma2NETMySQL.dll logs now save to AppData/Local/Arma2NETMySQL

Thank you to Scott (ArmA2NET), Firefly (addin dll's) and Tupolov with rest of the MSO development team for extending PersistentDB and rewriting some of the core elements.

This is still work in progress so there will be bugs/issues.

Warning. This version uses a totally new MYSQL DB Schema so if you have the old DB you will need to drop it and use the new one.

Edited by [KH]Jman

Share this post


Link to post
Share on other sites

thx for updating you script, but i still have problems with it.

1. your example mission work currectly

2. but if i add you scriptfiles to my own mission, everytime i stuck at "Please wait setting up client"

i copied all files in my mission folder and edit the pdbSetup.sqf, change the mission name

i edited the init and drescription file, to add you scripts.

in the logs are no error located.

so what did i wrong ?

Share this post


Link to post
Share on other sites

@gtasaoli. Apologies for now getting back to you sooner, I've been a little busy.

I downloaded your mission and tested it. You need to move the pdb init to the bottom of the init.sqf file and it will work just fine.

init.sqf

diag_log [diag_frameno, diag_ticktime, time, "Dom init.sqf processed"];

// ====================================================================================
// init persistentDB
  execNow "core\init.sqf";
// ====================================================================================

Share this post


Link to post
Share on other sites

thx for your help. now it works fine.

but i have now an other problem. the main mission are aviable, but the no sidemission will be activated, if i have your script activated.

an other question: is it possible to save the mission targets ? so if the server restart, the target that i have cleared at my domimation map, are cleared again ?

EDIT//

i figured out, that none script from domination mission are running, if i enable you script

Edited by gtasaolli
update

Share this post


Link to post
Share on other sites

Hi all,

I am trying to setup Persistant DB for one of my mission/server. I'm really really new to MySQL and Arma2NET.

I am getting this in the log:

Info: 16:03:26 - Arma2NETMySQL Plugin Started.
Info: 16:03:26 - Version number: 0.1.0.0
Info: 16:03:26 - Loading databases...
Info: 16:03:26 - Database: arma IPAddress: 127.0.0.1 Port: 3306 Username: arma Password: NotShownForSecurityReasons
Info: 16:03:27 - Unable to open connection to database, trying again in 10 seconds.MySql.Data.MySqlClient.MySqlException (0x80004005): Unknown database 'arma'
  at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
  at MySql.Data.MySqlClient.NativeDriver.AuthenticateNew(Boolean reset)
  at MySql.Data.MySqlClient.NativeDriver.Authenticate(Boolean reset)
  at MySql.Data.MySqlClient.NativeDriver.Open()
  at MySql.Data.MySqlClient.Driver.Open()
  at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
  at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
  at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
  at MySql.Data.MySqlClient.MySqlPool.GetConnection()
  at MySql.Data.MySqlClient.MySqlConnection.Open()
  at Arma2NETMySQLPlugin.MySQL.OpenConnection(String connectionString)
Info: 16:03:37 - Unable to open connection to database, trying again in 10 seconds.MySql.Data.MySqlClient.MySqlException (0x80004005): Unknown database 'arma'
  at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
  at MySql.Data.MySqlClient.NativeDriver.AuthenticateNew(Boolean reset)
  at MySql.Data.MySqlClient.NativeDriver.Authenticate(Boolean reset)
  at MySql.Data.MySqlClient.NativeDriver.Open()
  at MySql.Data.MySqlClient.Driver.Open()
  at MySql.Data.MySqlClient.Driver.Create(MySqlConnectionStringBuilder settings)
  at MySql.Data.MySqlClient.MySqlPool.GetPooledConnection()
  at MySql.Data.MySqlClient.MySqlPool.TryToGetDriver()
  at MySql.Data.MySqlClient.MySqlPool.GetConnection()
  at MySql.Data.MySqlClient.MySqlConnection.Open()

It seems it is having troubles getting into the database. I am positive I followed the right directions on creating the database. Can anyone give me some advice on changing any settings in MySQL to allow proper connection please.

I have done all steps on this. I read a lot of threads to the point my head is about to explode.

Thank you for your time!!

Share this post


Link to post
Share on other sites

So, you need to connect to the database and run that .sql file. If you are new to MySQL, you may want to think about trying sqlite. There's not as much setup and it makes it easier. If you're dead-set on MySQL, I would suggest using a program to make it easier to manage such as phpmyadmin (web-based) or perhaps this one: https://dev.mysql.com/downloads/workbench/. I've never used it but apparently it's decent. Or you can go old-school and just use the commandline under Windows. If you want to try sqlite, you'll need to build the plugin. I haven't released any binaries yet because it's still in testing. But... we're getting very close.

Share this post


Link to post
Share on other sites

Thanks for the reply.

Woops, forgot to mention I'm using MySQL Workbench 5.5

Is the EER Model the same as database? Because I used "Create EER Model from SQL Script" in Workbench.

I also used the MSO PDB wiki.

Share this post


Link to post
Share on other sites

I'm not sure, sorry. I've never used that tool. I have an external MySQL database that I use for testing. Try searching for "mysql workbench import sql", perhaps that will provide some answers? Essentially, the .sql file has the database structure and all the setup that you need on the database side for the stored procedures and such.

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  

×