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

ArmA2 Persistent Database Scripts - WIP

Recommended Posts

Jman,

Also trying to set this up. Getting an issue with accessing the DB

05/18/2012 02:00:52 Arma2Net.Managed.Bridge INFO 
05/18/2012 02:00:52 Arma2Net.Managed.Bridge INFO Arma2NET 1.8.0.0 (Developer mode: True), CLR 4.0.30319.269
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Rebuilding addins
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Finding addins
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Activated Activate from BaseFunctionsPlugin.Activate, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Activated IsFunction from BaseFunctionsPlugin.IsFunction, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Activated Deactivate from BaseFunctionsPlugin.Deactivate, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Activated _Empty from BaseFunctionsPlugin._Empty, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Activated VersionOfAddIn from BaseFunctionsPlugin.VersionOfAddIn, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Activated CompareVersion from BaseFunctionsPlugin.CompareVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Activated ClrVersion from BaseFunctionsPlugin.ClrVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Activated Version from BaseFunctionsPlugin.Arma2NetVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Activated Functions from BaseFunctionsPlugin.Functions, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Activated CommandLine from CommandLinePlugin.CommandLine, CommandLinePlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Activated DateTime from DateTimePlugin.DateTime, DateTimePlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Activated GetWeather from WeatherPlugin.Weather, WeatherPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Activated Dict from UtilitiesPlugin.DictionaryUtility, UtilitiesPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
05/18/2012 02:00:52 Arma2Net.Managed.AddIns.AddInManager INFO Activated Str from UtilitiesPlugin.StringUtility, UtilitiesPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
05/18/2012 02:00:52 Arma2Net.Managed.Bridge INFO Initialized
05/18/2012 02:00:52 Arma2Net.Managed.Bridge ERROR Caught exception
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.IO.FileNotFoundException: Could not load file or assembly 'MySql.Data, Version=6.4.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d' or one of its dependencies. The system cannot find the file specified.
  at Arma2NETMySQLPlugin.MySQL.OpenConnection(String connectionString)
  at Arma2NETMySQLPlugin.Databases..ctor()
  at Arma2NETMySQLPlugin.Arma2NETMySQLPlugin..ctor()

Edited by Tupolov

Share this post


Link to post
Share on other sites

The database file should contain the database connection string for example:

Database name, Database IP address, Database MYSQL Port, Database username, Database password

so for a localhost server it would be something like:

arma,127.0.0.1,3306,mydbUsername,mydbPassword

The database.txt file should be copied to the server's root Arma2 folder.

Have you created the database table structure and stored proceedures?

The scripts should create the mission name in the mysql missions table if it does not exist as per my rpt example.

As a test try manually creating the mission name in the missions table before running the mission. You'd only need to do this once.

The name needs to be the same as the pdb_fullmissionName set in the pdbSetup.php file.

On my server the scripts do insert the mission name into the missions table so I'm not sure why yours would be different. Do try manually inserting the missionname in the db and see if that fixes it.

If it does I'd like to see your missions db table. Check that field name na is field type VARCHAR, Size: 255, NOT NULL and default ''

Edited by [KH]Jman

Share this post


Link to post
Share on other sites

Just curious, can it find MySql.Data.dll if you place it in the @Arma2NET folder as opposed to the Arma 2 root folder or the plugin's folder? My method of assembly probing should allow for this.

Share this post


Link to post
Share on other sites

Tupolov, you seem to keep editing and changing your question after I reply. Please could you be clear about exactly what issues you are having now and what issues have now been resolved and how ;)

Share this post


Link to post
Share on other sites

Sorry Jman, I had incorrectly added the string in the databases.txt file. After doing this correctly I get the error submitted above.

I followed the steps you outlined here. I had some issues with the arma.sql script so have manually create the stored procedures using your code. I'm using MySQL Server 5.5. The routines run fine as I've tested them manually. I'll try manually adding the mission name. I've checked for the missing microsoft dll.

Scott - MySql.data.dll is currently residing in the .NET Connector folder. Should it be in the ARMA folder? I'm using ARMA2Net (with your addin - Arma2NETMySQLPlugin.dll) and the demo mission from Jman (non-ace). I have ARMA2Net running on server with the correct CBAs and -arma2netdev

Thanks for your help

Tup

Share this post


Link to post
Share on other sites

Yeah, Arma2NET won't be able to find dependencies if they are in arbitrary folders. Try putting it in the MySQL addin folder, in AddIns/Arma2NETMySQL. Also, make sure that you leave the other folders (AddInSideAdapters etc) intact, or things will break :)

Share this post


Link to post
Share on other sites

Scott, AWESOME! That worked.

Jman, suggest you update your outline to ensure people copy the MySQL.Data.Dll to the ARMA2, ARMA2Net and Arma2NETMySQLPlugin (to cover all bases!)

Got it up and running. Now gonna try to integrate with MSO.

Thanks guys this is very very cool.

Share this post


Link to post
Share on other sites

Yay!!! Well done Tupolov I'm very happy to see you've got it working. Feel free to fix any issues, add MSO support and make improvements to my code, I can add you to the Dev-heaven project if you like so so can create an MSO branch or whatever :) I've added point 15. to the install procedure here and 'un-aced' the steps :)

I've also just updated the readme.html to include the installation steps

https://dev-heaven.net/projects/a2-sql-persistent-db/repository/revisions/ccb347b5c5a7b241bb71f6d3deaba41ff1e952aa

Direct link to PDBReadme.html

Edited by [KH]Jman

Share this post


Link to post
Share on other sites

Jman,

I've got it working with MSO, i've not added anything to it yet, just slotted it into our framework so it initialises etc. But it works very well.

We have a "persistence" module in place already - but obviously doesn't write to DB. So our first step is to see how we can extend persistentDB to support storing more player data such as rank, lifestate, deaths etc. We also kick players if they exceed deaths in a time period - so would want to look at that.

The next things we need to consider are:

MSO schema and associated procedures etc

How our mission modules can be persisted between games - storing information about enemy locations, terror cells, IEDs etc once they have been initialised. Ensuring when a mission is reloaded that the modules initialise properly - probably quite a bit of work for us tbh.

We'd love to persist objects covered by R3F.

We're not worried about enemy AI as we spawn/delete based on player proximity anyway.

I think the only concern we have is that ultimately we'd want the persistence to be implementation independent so we could support other methods - but I think that's probably a future thing atm!

Would love to contribute, I'm on Dev-heaven so feel free to add me etc.

Thanks!

Tup

Share this post


Link to post
Share on other sites

Will do and thanks I don't have alot of time to spend on the project these days!.

Some of my scripts maybe a little long winded!

I'll try to get ArmA2MYSQL Dev-Heaven project (now legacy) ungrouped from https://dev-heaven.net/projects/a2-sql-persistent-db and move the repo here: https://dev-heaven.net/projects/a2-sql-persistent-db/repository to: https://dev-heaven.net/projects/persistent-db

Edited by [KH]Jman

Share this post


Link to post
Share on other sites

Jman and Scott_NZ Thanks for this addons!

but I have a problem...

Tupolov had something similar to this, but I have set the mysql.data.dll to all the folders.

file: mysql.data.dll version: 6.4.3.0 size: 361kb date:3.7.11

I have 2 folders there v2.0 and v4.0 I use v4

I can't connect to my DB.

I did everything as its explained in the PersistentDB ReadMe file...

Iam trying to load the NON ACE\Co18_PDB_ConvoyHell_v1-5-100.Takistan mission

it cant pass the "Server is loading persistent mission data please standby..." screen

I can shoot and run but this screen just stuck and I cant play...

Iam trying to solve this problem 5 days already! :( :confused:

Iam using Xampp to run the DB its MySQL 5.5

database created called arma, rows added, server runs the latest beta patch, I dont know how to check its version, but iam using

-arma2netdev -config=Server.cfg -mod=expansion\beta;expansion\beta\expansion;@CBA;@CBA_A2;@CBA_OA;@Arma2NET

runnig Dedicated serv then connecting to it.

@arma2net 1.10

server date and time sample mission works.

What to do??? what can cause this problem?

log:

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

btw how to download the a2-sql-persistent-db file from dev-heaven.net I cant find any link to it...

is there complete PersistentDBd or Arma2NET file with mysql.data.dll installed?

Thanks!

Edited by DooM4MR

Share this post


Link to post
Share on other sites

Can you PM me your server's rpt file? Thanks.

also did you try it with for Arma2NET 1.9? I've not tested it yet with Arma2NET 1.10 yet so I don't know if the addin still works with 1.10

Share this post


Link to post
Share on other sites

Arma2NETMySQLPlugin.dll updated in Dev-heaven repo and PersistentDB.7z

- updated Arma2NETMySQLPlugin.dll [firefly2442]

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).

Works with latest Arma2NET (1.10).

Working log: http://pastebin.com/bmTDCi7M

Edited by [KH]Jman

Share this post


Link to post
Share on other sites

Okay, Problem seems to be that arma2net / sql plugin is not running... Where should the logfile be stored?

Thx for help

Share this post


Link to post
Share on other sites

Arma2 server root /logs and be datestamped i.e: 06-14-2012_11-20-04.log

Share this post


Link to post
Share on other sites

Okay, still got no /log folder... I don't know where to search my failure... :(

Serverconfig

// Server Config Generated by Tophes Arma 2 Dedicated Server Tool

hostName = "Gruppe W";

password = "";

passwordAdmin = "**********";

maxPlayers = 32;

logFile = "server4_new.log";

voteThreshold = 0.33;

voteMissionPlayers = 1;

reportingIP = "arma2pc.master.gamespy.com";

timeStampFormat = "full";

motd[] = {};

motdInterval = 3;

vonCodecQuality = 3;

disableVoN = 1;

kickduplicate = 1;

verifySignatures = 1;

persistent = 0;

BattlEye = 0;

doubleIdDetected = "";

onUserConnected = "";

onUserDisconnected = "";

onHackedData = "";

onDifferentData = "";

onUnsignedData = "";

regularCheck = "";

class Missions

{

class Mission1

{

template = "Arma2NET_serverTest.utes";

difficulty="expert";

};

};

Server Start-Batch:

arma2oaserver.exe -port=2355 -cfg=servercfg\server5\server5_basic.cfg -config=servercfg\server5\server5_config.cfg -mod=expansion\beta;expansion\beta\expansion;@CBA;@CBA_A2;@CBA_OA;@Arma2NET -arma2netdev

called in /expansion/beta

run in "arma 2"

Server RPT

2012/06/14, 16:01:07 [37760,794.341,0,"XEH: PreInit Started. v1.0.0.179. MISSINIT: missionName=Arma2NET_serverTest, worldName=utes, isMultiplayer=true, isServer=true, isDedicated=true"]

2012/06/14, 16:01:10 Error in expression <} else {

_return = "JayArma2Extension" callExtension _call;

};

_return;

};

[] >

2012/06/14, 16:01:10 Error position: <callExtension _call;

};

_return;

};

[] >

2012/06/14, 16:01:10 Error Missing ;

2012/06/14, 16:01:10 File x\jayarma2lib\addons\common\XEH_preinit.sqf, line 31

2012/06/14, 16:01:10 Error in expression <} else {

_return = "JayArma2Extension" callExtension _call;

};

_return;

};

[] >

2012/06/14, 16:01:10 Error position: <callExtension _call;

};

_return;

};

[] >

2012/06/14, 16:01:10 Error Missing ;

2012/06/14, 16:01:10 File x\jayarma2lib\addons\common\XEH_preinit.sqf, line 31

2012/06/14, 16:01:10 [37760,796.963,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/14, 16:01:10 SetFace error: class CfgFaces.Man.Merc_Face9 not found

2012/06/14, 16:01:10 Error: Error during SetFace - class CfgFaces.Man.Merc_Face9 not found

2012/06/14, 16:01:10 Warning Message: No entry 'bin\config.bin/CfgGlasses.Barett'.

2012/06/14, 16:01:10 Warning Message: No entry '.model'.

2012/06/14, 16:01:10 Warning Message: '/' is not a value

2012/06/14, 16:01:10 SetFace error: class CfgFaces.Man.Merc_Face9 not found

2012/06/14, 16:01:10 Error: Error during SetFace - class CfgFaces.Man.Merc_Face9 not found

Any hints? ;-)

Edited by Noc1337
rpt added

Share this post


Link to post
Share on other sites

Serverconfig in irrelevent.

This may be a silly question but you have copied the Arma2NETMySQLPlugin folder containing the Arma2NETMySQLPlugin.dll into the @Arma2NET/Addins folder?

You don't need Jayarma2lib

Edited by [KH]Jman

Share this post


Link to post
Share on other sites

Yeah. is located in th addins folder... must be directly in addins or subfolders works also?

Share this post


Link to post
Share on other sites

You're not running a supported callExtension beta by the looks of your RPT pre-init errors. Download, install and RUN the latest beta.

Share this post


Link to post
Share on other sites

'Think is not 'are'. Please post you whole rpt (use pastebin or link to it, don't post it in this thread directly), it will give the server version at the beginning.

Edited by [KH]Jman

Share this post


Link to post
Share on other sites

I think it should be the Beta [93701] on the server. It isn't supported? Sorry for double post..

stupid slow internet @ work.. ;)

http://pastebin.com/mpqDPWBw

Edited by Noc1337

Share this post


Link to post
Share on other sites

You are running Version 1.60.87548 on the server. That is not a recent callExtension supported beta.

The latest beta should read: Version 1.60.93702

This is your problem below.

You are running the server exe from the root still:

D:\ArmA 2\arma2oaserver.exe

It needs to be:

D:\ArmA 2\Expansion\beta\arma2oaserver.exe

Also remove @W_JayArma2Lib you don't need it.

Edited by [KH]Jman

Share this post


Link to post
Share on other sites

Okay, got it.. Thanks... But where is the failure... i run the server from beta\expansions and added it in the startup-link.... :(

But thanks for help to get me to this point! ;)

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  

×