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

ArmA2 Persistent Database Scripts - WIP

Recommended Posts

So, sorry to just stop by and ask this, but in the future do you also plan to release "example" apps for the databases or are you just focusing the development for this so that more experienced DBA's and programmers can utilize it?

For example, I have a need for the utilities, but have no experience making tha database or programs to keep track of the information that is pertinent to my missions.

Share this post


Link to post
Share on other sites

Thank you for this, it's proving extremely uself! :). However a few more comments in the scripts would be nice :p.

Share this post


Link to post
Share on other sites
But do you know how to solve the

"server is loading persistent mission data please stand by"

as this has been happeneing with the example mission that came with persistebt and has nothing to do with dayz as thats my next goal when i get this persitent database working

I'm having this issue with the sample mission as well.

Error in expression <le _response;
_missionArray = _response select 0;    


if (isNil "_missionArray>
 Error position: <select 0;    


if (isNil "_missionArray>
 Error select: Type Bool, expected Array,Config entry
File mpmissions\__cur_mp.Takistan\persistentDB\initPlayerConnection.sqf, line 50

Edited by Polaris

Share this post


Link to post
Share on other sites

Polaris. Those errors mean that there in no communication between Arma2 and the MYSQL DB. Please verify that Arma2NET and the MYSQL addon dll are loaded (check the Arma2NET log file, if none exists then Arma2NET has not loaded) and that the database.txt file is defined.

Share this post


Link to post
Share on other sites

The readme should help a little:

https://github.com/firefly2442/Arma2NETMySQLPlugin/blob/master/ReadMe.html

First check the Arma2NET log files, if the plugin isn't loading. You may not be starting Arma correctly or you may not be running the latest beta. If the plugin is loading, then check the "logs" folder in your root Arma directory. When the plugin loads up and connects to the database, you should see it there.

Let us know if this doesn't fix it.

Share this post


Link to post
Share on other sites

Info: 15:13:55 - Arma2NETMySQL Plugin Started.
Info: 15:13:55 - Version number: 0.1.0.0
Info: 15:13:55 - Compiled with Arma2NET Version: 1.12.0
Info: 15:13:55 - Loading databases...
Info: 15:13:55 - Database: test IPAddress: 127.0.0.1 Port: 3306 Username: test Password: NotShownForSecurityReasons
Info: 15:13:57 - Received - Database: test Procedure: GetMissionByName Parameters: tna=Co18 PDB Convoy Hell
Info: 15:13:57 - Parsing parameters...
Warning: 15:13:57 - MySQL error. MySql.Data.MySqlClient.MySqlException (0x80004005): PROCEDURE test.GetMissionByName does not exist
  at MySql.Data.MySqlClient.MySqlStream.ReadPacket()
  at MySql.Data.MySqlClient.NativeDriver.GetResult(Int32& affectedRow, Int32& insertedId)
  at MySql.Data.MySqlClient.Driver.GetResult(Int32 statementId, Int32& affectedRows, Int32& insertedId)
  at MySql.Data.MySqlClient.Driver.NextResult(Int32 statementId, Boolean force)
  at MySql.Data.MySqlClient.MySqlDataReader.NextResult()
  at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior)
  at MySql.Data.MySqlClient.MySqlCommand.ExecuteReader()
  at Arma2NETMySQLPlugin.MySQL.RunOnDatabase(MySqlCommand command, Int32 maxResultSize)

=====================================================================
== C:\test\Expansion\beta\arma2oaserver.exe
== "C:\test\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
=====================================================================
Exe timestamp: 2012/07/16 05:51:16
Current time:  2012/07/16 15:12:29

Version 1.61.94878
NAT Negotiation completed
[5017,30.239,0,"XEH: PreInit Started. v1.0.0.184. MISSINIT: missionName=pdbtest, worldName=Takistan, isMultiplayer=true, isServer=true, isDedicated=true"]
[5017,30.865,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"]
Client: Nonnetwork object 1ae8e040.
Client: Nonnetwork object 228b8040.
[5185,38.906,0,"XEH: PostInit Started"]
[5185,38.914,0,"CBA_VERSIONING: cba=1.0.0.185, cba_a2=1.0.0.8, cba_oa=1.0.0.6, "]
[5185,39.191,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-B:1, group=L 1-1-B"]
Unit not created: Subgroup 0:0 not found
Cannot create object 3:1
["PersistentDB: pdb settings loaded"]
"############################# Co18 PDB Convoy Hell #############################"
"--------------------------------"
"UPSMON started"
Server: Object 2:973 not found (message 221)
Server: Object 2:974 not found (message 221)
Server: Object 2:989 not found (message 221)
Server: Object 2:990 not found (message 221)
Server: Object 2:991 not found (message 221)
Server: Object 2:1006 not found (message 221)
Server: Object 2:1007 not found (message 221)
Server: Object 2:1211 not found (message 132)
Server: Object 2:1213 not found (message 132)
"SERVER MSG: count MISSIONDATA, 0"
0:01:46.008 (0:00:00.601) versioning - cba_main - Not running! (Machine: S1 (Polaris))

07/16/2012 15:13:55 Log: Unmanaged side loaded
07/16/2012 15:13:55 Info Successfully loaded into process arma2oaserver
07/16/2012 15:13:55 Info Arma2NET 1.12.0 initializing on CLR 4.0.30319.269
07/16/2012 15:13:55 Info Sandboxing is disabled
07/16/2012 15:13:55 Info Rebuilding addin store
07/16/2012 15:13:55 Info Finding addins
07/16/2012 15:13:55 Info Found addins: Activate, IsFunction, Deactivate, _Empty, VersionOfAddIn, CompareVersion, ClrVersion, Version, Functions, CommandLine, DateTime, Arma2NETMySQL, Arma2NETMySQLCommand
07/16/2012 15:13:55 Info Activating base addins
07/16/2012 15:13:55 Info Activated Activate from BaseFunctionsPlugin.Activate, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/16/2012 15:13:55 Info Activated IsFunction from BaseFunctionsPlugin.IsFunction, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/16/2012 15:13:55 Info Activated Deactivate from BaseFunctionsPlugin.Deactivate, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/16/2012 15:13:55 Info Activated _Empty from BaseFunctionsPlugin._Empty, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/16/2012 15:13:55 Info Activated VersionOfAddIn from BaseFunctionsPlugin.VersionOfAddIn, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/16/2012 15:13:55 Info Activated CompareVersion from BaseFunctionsPlugin.CompareVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/16/2012 15:13:55 Info Activated ClrVersion from BaseFunctionsPlugin.ClrVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/16/2012 15:13:55 Info Activated Version from BaseFunctionsPlugin.Arma2NetVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/16/2012 15:13:55 Info Activated Functions from BaseFunctionsPlugin.Functions, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/16/2012 15:13:55 Info Arma2NET initialized
07/16/2012 15:13:55 Info Activated Arma2NETMySQL from Arma2NETMySQLPlugin.Arma2NETMySQLPlugin, Arma2NETMySQLPlugin, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null (Sandboxed: False)

Edited by Polaris

Share this post


Link to post
Share on other sites

OK, so based on the error, it says that the stored procedure doesn't exist. Check to make sure you initialised the database and the stored procedures under the correct user. As far as I know, stored procedures are per database so make sure you initialised the stored procedures under that database and not globally as root or something. It looks like you're not using the root user so that's a good thing.

Share this post


Link to post
Share on other sites

I'v tried deleting the database and recreating it with arma.sql however I'm getting this error now while executing the sql

0 15:41:00 CREATE DEFINER = 'test'@'localhost' PROCEDURE `CountLandVehicleIDsByMission`(IN tmid INTEGER(11)) NOT DETERMINISTIC CONTAINS SQL SQL SECURITY DEFINER COMMENT '' BEGIN SELECT COUNT(*) FROM landvehicles WHERE mid=tmid Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 7 

Share this post


Link to post
Share on other sites

Hmm, try changing the single quotes to backticks there where the test@localhost is listed. Perhaps it's getting hung-up on that?

Share this post


Link to post
Share on other sites

I replaced them all with `arma`@`localhost` and received this error:

0	05:23:09	CREATE DEFINER = `arma`@`localhost` PROCEDURE `CountLandVehicleIDsByMission`(IN tmid INTEGER(11))     NOT DETERMINISTIC     CONTAINS SQL     SQL SECURITY DEFINER     COMMENT '' BEGIN   SELECT COUNT(*) FROM landvehicles WHERE mid=tmid	Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 7

Share this post


Link to post
Share on other sites

Having an issue getting Arma2Net to even run it seems. I don't really see why so I'll just post the server logs. Used the provided startup options for CBA as well, but have tried with just the main CBA folder. Installed everything as per the readme in the OP. I have no arma2net log and no log folder in my arma2oa directory, so clearly I've missed something.

@arma2NET contains all of the 1.13 version and the arma2NetMySql plugin as well. It is in the arma2oa directory under steam.

with all CBA activated

http://pastebin.com/yY5zrsk8

with just CBA activated

http://pastebin.com/QMDL7gLF

MySql server is setup and I imported the arma.sql, but it threw and error. I'll look into that later as the process isn't even to the point of trying to connect and I didn't note the error.

Share this post


Link to post
Share on other sites

Looks like you aren't starting the beta patch properly - use the beta server exe as supplied with the beta patches instead of the main one.

Share this post


Link to post
Share on other sites
Looks like you aren't starting the beta patch properly - use the beta server exe as supplied with the beta patches instead of the main one.

Yup, that was it.

Thanks for the quick response!

Edit: Got the error I am getting from executing the arma.sql script. I don't know SQL so I don't know what syntax is broken here.

0	02:02:27	CREATE DEFINER = 'arma'@'localhost' PROCEDURE `CountLandVehicleIDsByMission`(IN tmid INTEGER(11))     NOT DETERMINISTIC     CONTAINS SQL     SQL SECURITY DEFINER     COMMENT '' BEGIN   SELECT COUNT(*) FROM landvehicles WHERE mid=tmid	Error Code: 1064. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 7

Edited by bondematt

Share this post


Link to post
Share on other sites

arma.sql is broken, to put it quite simply. armaphpmyadmin.sql will work however the example mission then throws up more DB errors with the procedures when you run it so it won't work.

Share this post


Link to post
Share on other sites

Hmm, yeah JMan is the guru for the database on this one. I can try to fiddle with it this weekend. In the meantime, you could try creating your own database and running a query on it. Just look at the readme file.

https://github.com/firefly2442/Arma2NETMySQLPlugin

You don't need to use stored procedures but you do need to know a little SQL.

Share this post


Link to post
Share on other sites

Info: 02:30:30 - Arma2NETMySQL Plugin Started.
Info: 02:30:30 - Version number: 0.1.0.0
Info: 02:30:30 - Compiled with Arma2NET Version: 1.12.0
Info: 02:30:30 - Loading databases...
Info: 02:30:30 - Database: lifeprojectrpg IPAddress: 127.0.0.1 Port: 3306 Username: lifeprojectrpg Password: NotShownForSecurityReasons
Info: 02:30:30 - Database: lifeprojectrpgvb IPAddress: 184.168.74.58 Port: 3306 Username: lifeprojectrpgvb Password: NotShownForSecurityReasons
Info: 02:30:31 - Database: teamspeak3 IPAddress: 127.0.0.1 Port: 3306 Username: teamspeak3 Password: NotShownForSecurityReasons
Info: 02:30:31 - Received - Database: lifeprojectrpg Procedure: GetMissionByName Parameters: tna=Co18 PDB Convoy Hell
Info: 02:30:31 - Parsing parameters...
Info: 02:31:17 - Received - Database: lifeprojectrpg Procedure: UpdatePlayer Parameters: tsc=0,tpos=8037.08|1939.45|1.35808,tdam=0,tdhe=0,tdbo=0,tdha=0,tdle=0,tdir=9.41442,tsta=Stand,tsid=,tveh=,tsea=,tpid=1911238,tna=PolarisPolaris,tmid=<null>
Info: 02:31:17 - Parsing parameters...
Info: 02:31:17 - Received - Database: lifeprojectrpg Procedure: UpdatePlayerWeapons Parameters: twea="SCAR_L_STD_HOLO"|"NVGoggles"|"ItemMap"|"ItemCompass"|"ItemWatch"|"ItemRadio",tmag="30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"HandGrenade_West"|"HandGrenade_West"|"HandGrenade_West"|"HandGrenade_West",tpid=1911238,tna=Polaris,tmid=<null>
Info: 02:31:17 - Parsing parameters...
Info: 02:33:33 - Received - Database: lifeprojectrpg Procedure: UpdatePlayer Parameters: tsc=0,tpos=8033.37|1926.61|1.46866,tdam=0,tdhe=0,tdbo=0,tdha=0,tdle=0,tdir=5.73776,tsta=Stand,tsid=,tveh=,tsea=,tpid=1911238,tna=Polaris,tmid=<null>
Info: 02:33:33 - Parsing parameters...
Info: 02:33:33 - Received - Database: lifeprojectrpg Procedure: UpdatePlayerWeapons Parameters: twea="SCAR_L_CQC_Holo"|"NVGoggles"|"ItemMap"|"ItemCompass"|"ItemWatch"|"ItemRadio"|"M136",tmag="30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"HandGrenade_West"|"HandGrenade_West"|"M136",tpid=1911238,tna=Polaris,tmid=<null>
Info: 02:33:33 - Parsing parameters...

I joined at 2:30 and then it get stuck on 'server is loading persistent mission data please stand by' and so restarted my game and joined again at 2:31, it got stuck on 'server is loading persistent mission data please stand by' again and so I restarted once more at 2:33 and it got stuck again. I'm not sure what's going on? There don't seem to be any errors but it won't get past the 'server is loading persistent mission data please stand by' screen. I had errors before with "Incorrect integer value: '<null>' for column 'tmid' at row 1" but I solved that by disabling mysql strict mode. I would appreciate some help, thank you.

=====================================================================
== C:\Game Server\Expansion\beta\arma2oaserver.exe
== "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
=====================================================================
Exe timestamp: 2012/07/16 05:51:16
Current time:  2012/07/20 02:29:54

Version 1.61.94878
Server error: Player without identity Polaris (id 1025983563)
[9119,141.631,0,"XEH: PreInit Started. v1.0.0.184. MISSINIT: missionName=mysqltest, worldName=chernarus, isMultiplayer=true, isServer=true, isDedicated=true"]
[9119,142.242,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"]
Client: Nonnetwork object 23a5e040.
Client: Nonnetwork object 237b8040.
[9284,149.488,0,"XEH: PostInit Started"]
[9284,149.495,0,"CBA_VERSIONING: cba=1.0.0.185, cba_a2=1.0.0.8, cba_oa=1.0.0.6, "]
[9284,149.767,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-B:1, group=L 1-1-B"]
["PersistentDB: pdb settings loaded"]
"############################# Co18 PDB Convoy Hell #############################"
"--------------------------------"
"UPSMON started"
Server: Object 2:973 not found (message 221)
Server: Object 2:974 not found (message 221)
Server: Object 2:989 not found (message 221)
Server: Object 2:990 not found (message 221)
Server: Object 2:991 not found (message 221)
Server: Object 2:1006 not found (message 221)
Server: Object 2:1007 not found (message 221)
"SERVER MSG: count MISSIONDATA, 0"
Error in expression <select 0;    


}; 


if (_missionArray select 1 == pdb_fullmissionName) then { >
 Error position: <select 1 == pdb_fullmissionName) then { >
 Error Zero divisor
File mpmissions\__cur_mp.chernarus\persistentDB\initPlayerConnection.sqf, line 82
"SERVER MSG: Player Polaris, is leaving the server, frame Number: 11938, Tick: 209.415, Time: 42.726"
"SERVER MSG: Loop. 1911238"
"SERVER MSG: Loop break. 1911238"
["_loadedPlayerScore: ",<null>,string]
["_globalPlayerScore: ",<null>,string]
["_pscore: ",scalar,string]
["player is standing"]
["pdb_ace_enabled:",false,"BOOL"]
"SERVER MSG: SQL output: [tsc=0,tpos=8037.08|1939.45|1.35808,tdam=0,tdhe=0,tdbo=0,tdha=0,tdle=0,tdir=9.41442,tsta=Stand,tsid=,tveh=,tsea=,tpid=1911238,tna=Polaris,tmid=<null>]"
"SERVER MSG: SQL output: [twea="SCAR_L_STD_HOLO"|"NVGoggles"|"ItemMap"|"ItemCompass"|"ItemWatch"|"ItemRadio",tmag="30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"HandGrenade_West"|"HandGrenade_West"|"HandGrenade_West"|"HandGrenade_West",tpid=1911238,tna=Polaris,tmid=<null>]"
Client: Remote object 2:1114 not found
Client: Remote object 2:1115 not found
Client: Remote object 2:1116 not found
WARNING: Function 'name' - S4 has no unit
- network id 2:297
- person Joshua Wilson
- dead
"SERVER MSG: Player Polaris, is leaving the server, frame Number: 18705, Tick: 345.402, Time: 178.713"
"SERVER MSG: Loop. 1911238"
"SERVER MSG: Loop break. 1911238"
["_loadedPlayerScore: ",<null>,string]
["_globalPlayerScore: ",<null>,string]
["_pscore: ",scalar,string]
["player is standing"]
["pdb_ace_enabled:",false,"BOOL"]
"SERVER MSG: SQL output: [tsc=0,tpos=8033.37|1926.61|1.46866,tdam=0,tdhe=0,tdbo=0,tdha=0,tdle=0,tdir=5.73776,tsta=Stand,tsid=,tveh=,tsea=,tpid=1911238,tna=Polaris,tmid=<null>]"
"SERVER MSG: SQL output: [twea="SCAR_L_CQC_Holo"|"NVGoggles"|"ItemMap"|"ItemCompass"|"ItemWatch"|"ItemRadio"|"M136",tmag="30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"30Rnd_556x45_Stanag"|"HandGrenade_West"|"HandGrenade_West"|"M136",tpid=1911238,tna=Polaris,tmid=<null>]"
Client: Remote object 2:2063 not found
Client: Remote object 2:2064 not found
Client: Remote object 2:2065 not found
Client: Remote object 4:0 not found

07/20/2012 02:30:30 Log: Unmanaged side loaded
07/20/2012 02:30:30 Info Successfully loaded into process arma2oaserver
07/20/2012 02:30:30 Info Arma2NET 1.12.0 initializing on CLR 4.0.30319.269
07/20/2012 02:30:30 Info Sandboxing is disabled
07/20/2012 02:30:30 Info Rebuilding addin store
07/20/2012 02:30:30 Info Finding addins
07/20/2012 02:30:30 Info Found addins: Activate, IsFunction, Deactivate, _Empty, VersionOfAddIn, CompareVersion, ClrVersion, Version, Functions, CommandLine, DateTime, Arma2NETMySQL, Arma2NETMySQLCommand
07/20/2012 02:30:30 Info Activating base addins
07/20/2012 02:30:30 Info Activated Activate from BaseFunctionsPlugin.Activate, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/20/2012 02:30:30 Info Activated IsFunction from BaseFunctionsPlugin.IsFunction, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/20/2012 02:30:30 Info Activated Deactivate from BaseFunctionsPlugin.Deactivate, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/20/2012 02:30:30 Info Activated _Empty from BaseFunctionsPlugin._Empty, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/20/2012 02:30:30 Info Activated VersionOfAddIn from BaseFunctionsPlugin.VersionOfAddIn, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/20/2012 02:30:30 Info Activated CompareVersion from BaseFunctionsPlugin.CompareVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/20/2012 02:30:30 Info Activated ClrVersion from BaseFunctionsPlugin.ClrVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/20/2012 02:30:30 Info Activated Version from BaseFunctionsPlugin.Arma2NetVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/20/2012 02:30:30 Info Activated Functions from BaseFunctionsPlugin.Functions, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)
07/20/2012 02:30:30 Info Arma2NET initialized
07/20/2012 02:30:30 Info Activated Arma2NETMySQL from Arma2NETMySQLPlugin.Arma2NETMySQLPlugin, Arma2NETMySQLPlugin, Version=0.1.0.0, Culture=neutral, PublicKeyToken=null (Sandboxed: False)

---------- Post added at 03:59 ---------- Previous post was at 03:57 ----------

I also tried a stupidly simple script called by a menu action:

_select2345 = "Arma2Net.Unmanaged" callExtension "Arma2NETMySQLCommand ['teamspeak3', 'SELECT `client_unique_id` FROM `clients` WHERE `client_id` = '2'']";
_select2345 = call compile _select2345;
hint _select2345;

Oddly nothing happens in-game and no log/arma2net log is created when I try and run the action. The databases information is correct and the installation is the same one used for the above testing where the DB is successfully called and so is the plugin. So I'm a little lost.

Edited by Polaris

Share this post


Link to post
Share on other sites

The issue I see is that it's not creating a row in the missions table.

MySQL stored procedure log:

Info: 02:30:31 - Received - Database: lifeprojectrpg Procedure: GetMissionByName Parameters: tna=Co18 PDB Convoy Hell

Result log:

tmid=<null>

The sqf will create a row for the mission if it does not exist.

Check that the id column in the missions table is set to auto increment.

As a test you could manually add the column but if your db is setup correctly you should not need to.

Share this post


Link to post
Share on other sites

Jman, I used the armaphpmyadmin.sql to create the database because the arma one was throwing up errors. Maybe that's why? All of the id columns seem to be AI, that's what mysql is saying anyway. If I add a new row in workbench with ace=1 for example and apply the changes the id automatically increases by 1 so I assume it is working. I tried to create a row manually with all the mission info and it has worked. So what the hell is wrong? It DID add a player row to the table with all the correct info as far as I can tell though and the auto increment worked perfectly for that. I created a new DB without the added mission info and I found this in my rtp...

"SERVER MSG: count MISSIONDATA, 0"
Error in expression <select 0;    


}; 


if (_missionArray select 1 == pdb_fullmissionName) then { >
 Error position: <select 1 == pdb_fullmissionName) then { >
 Error Zero divisor
File mpmissions\__cur_mp.chernarus\persistentDB\initPlayerConnection.sqf, line 82

Edited by Polaris

Share this post


Link to post
Share on other sites

The Arma2NET log files only pertain to Arma2NET and the plugin system. All database queries and information are in the "logs" folder in your root Arma2 directory. For that example mission (not PDB mission) I suggested, if I run this:

_selectTest = "Arma2Net.Unmanaged" callExtension "Arma2NETMySQLCommand ['weapons', 'SELECT * FROM users LIMIT 3']";
TRACE_1("Result: ",_selectTest);

It works just fine. If you can't get this to work, you did something wrong. If you skipped any step or modified anything along the way, it probably won't work. I'll work on adding a readme for that example mission.

Share this post


Link to post
Share on other sites

Yes I realise that. Logs are created in both when PDB is ran but when I run an individual line like the one you've posted above no logs are created and nothing is returned in game. Surely if anything was wrong with the plugin/ArmA2NET then PDB wouldn't be able to query the database but it can and it has written data to it.

This is an example script that I wrote which doesn't call anything, the hint returns 'any' and no logs are created when the mission is run.

player groupChat "Line Good1";

private ["_mysqltest","_compiled","_result"];

player groupChat "Line Good2";

_mysqltest = ("Arma2Net.Unmanaged" callExtension "Arma2NETMySQLCommand ['teamspeak3', 'SELECT 'client_lastconnected' FROM 'clients' WHERE 'client_id' = '2'']");

player groupChat "Line Good3";

_compiled = call compile _mysqltest;

player groupChat "Line Good4";

_result = _compiled select 0;

player groupChat "Line Good5";

hintSilent format ["%1", _result];

I'll try and get the example mission working however I'm just really confused as to how PDB can work perfectly (plugin wise) and this script wont, PDB working means that the plugin and ArmA2Net MUST work.

Edited by Polaris

Share this post


Link to post
Share on other sites

I've got your example mission running now, I didn't have @ACEX installed so it was throwing up missing weapons errors.

Your mission is running but it's NOT accessing the database! There are no logs created when I run this mission and I can't seem to create a new loadout in the menu or anything. I have created the weapons database and have added it to the .txt in the root.

I get a script error with that exact one you posted. All the CBAs are running on the server and client.

Edit:

I added

#define DEBUG_MODE_FULL
#include "script_component.hpp

to the lines you posted and now I get an error and the game crashes when I run the command that calls the script with that content...

Include file mpmissions\_CUR_MP.Cherenarus\script_component.hpp

_selectTest = not found.

Edited by Polaris

Share this post


Link to post
Share on other sites

The database I use for PDB is called lifeprojectrpg and it was created using his armaphpmyadmin.sql. The weapons database was created using your sql. Teamspeak3 database has the structure of a normal TS3 database?

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  

×