VERSION: 1.4.35
CURRENT OA BETA SUPPORT: 1.60 RC2
Current ArmA2 VERSION SUPPORT: 1.09 FINAL
UPDATED: 12.10.2011
PLEASE NOTE:
this is initial release for preview and peer review. The first final release, later will include: SQLite support, C/C++ extension support, and a full Addon for API access to allow for ease of Yoma/whatever updates.
Besides the above mentioned, however, all features mentioned in the README work as documented. Initial install is also documented. It is the simple copying of 2 DLL's into your ArmA2 directory.
SECOND NOTE:
The final release version will consist of 1(ONE) DLL in the ArmA2 Root that will *not* change, and 1(ONE) DLL in an addon folder, @JayArma2Lib. So please do not rely on this release structure for anything critical/special/whatever.
-------------------------------------------------------
INTRODUCTION
-------------------------------------------------------
JayArma2Lib is my creation to have access to either more efficient or extended functionality which the current ArmA2 engine lacks. This includes string functionality, data structure management, and named pipes access.
This can be considered the follow-up to the original 'armalib' by Kegetys. Sadly though, I was never able to get in touch with Kegetys, and therefore none of this work is based off of his except for the identification of the ArmA2 scripting function to replace.
In a nutshell, this library works by proxying the DirectSound library on any Windows system; DirectSound is dsound.dll. I then replace the KbAddTopic function. This function is the access point for all functionality within this library.
There are no requirements, except for using the latest version of ArmA2. Additionally, this library works BOTH server and client side.
-------------------------------------------------------
FEATURES
-------------------------------------------------------
- Named pipes access
- String manipulation functionality
- Hashtable (sorted list) functionality
- Logging to an external file
- Get local system time
- DLL Extension Support
- (Coming Soon!) SQL Support
-------------------------------------------------------
INSTALLATION
-------------------------------------------------------
You can follow an easy 1 step process for installation.
1. Extract all files to your ArmA2 Directory
2. Add @JayArma2Lib to your mod's path on your shortcut.
- Example Shortcut Path: "C:\Steam\steamapps\common\arma 2\arma2.exe" -mod=@JayArma2Lib
An addon for the functionality has also been provided. @JayArmA2Lib. Please add this folder to your mod's path.
This is to allow for easier updating of the core functionality via Yoma. You are *NOT* required to run this addon for JayArma2Lib to work; only if an Addon requires the use of it.
You can also add a line to your actual ArmA2 shortcut to disable this library.
Add -nojayarma2lib to your shorcut, and it will not load.
This library is also 100% BattlEye Compatible!
-------------------------------------------------------
UNINSTALL
-------------------------------------------------------
Delete dsound.dll and all associated JayArma2Lib Files.
-------------------------------------------------------
FUNCTION INDEX
-------------------------------------------------------
STRING FUNCTIONS
jayarma2lib_fnc_stringContains
Function:
BOOL ret = [String, StringToFind] call jayarma2lib_fnc_stringContains;
Description:
Checks to see if the first supplied string contains the second supplied string.
Example:
_ret = ["foobar", "foo"] call jayarma2lib_fnc_stringContains;
if(_ret == true) then {
...
};
jayarma2lib_fnc_stringIContains
Function:
BOOL ret = [String, StringToFind] call jayarma2lib_fnc_stringIContains;
Description:
Same as jay_string_contains, except case insensitive.
Example:
_ret = ["foobar", "foo"] call jayarma2lib_fnc_stringIContains;
if(_ret == true) then {
...
};
jayarma2lib_fnc_stringIndexOf
Function:
INT position = [String, StringToFind] call jayarma2lib_fnc_stringIndexOf;
Description:
Returns the 0-based index of the requested string to search for.
Example:
_pos = ["foobar", "bar"] call jayarma2lib_fnc_stringIndexOf;
// _pos will be 3
jayarma2lib_fnc_stringSubstr
Function:
STRING ret = [String, INT StartPosition, INT Length] call jayarma2lib_fnc_stringSubstr;
Description:
Returns the sub string from 0-based StartPosition, and length characters.
Example:
_sub = ["foobar", 3,3] call jayarma2lib_fnc_stringSubstr;
// _sub will be "bar"
jayarma2lib_fnc_stringTrim
Function:
STRING ret = [String] call jayarma2lib_fnc_stringTrim;
Description:
Removes all leading and trailing whitespaces from the provided string.
Example:
_clean = [" asdf "] call jayarma2lib_fnc_stringTrim;
// _clean will be "asdf"
NAMED PIPE FUNCTIONS
jayarma2lib_fnc_openPipe
Function:
HANDLE pipeHandle = [PipePath] call jayarma2lib_fnc_openPipe;
Description:
Attempts to open the specific pipe name. If fail, returns nil. Otherwise, it returns a handle to the pipe.
Example:
_pipeHandle = ["\\.\pipe\jay] call jayarma2lib_fnc_openPipe;
if(!isNil("_pipeHandle")) then {
....
};
jayarma2lib_fnc_closepipe
Function:
[HANDLE] call jayarma2lib_fnc_closepipe;
Description:
Attempts to close the provided pipe handle. fails silently; no return.
Example:
[_pipeHandle] call jayarma2lib_fnc_closepipe;
jayarma2lib_fnc_readopipe
Function:
STRING ret = [HANDLE] call jayarma2lib_fnc_readopipe;
Description:
Reads any data which may be waiting on the pipe. If no data, returns nil
Example:
_data = [_pipeHandle] call jayarma2lib_fnc_readopipe;
if(!isNil("_data")) then {
....
};
jayarma2lib_fnc_writepipe
Function:
[HANDLE, StringToSend] call jayarma2lib_fnc_writepipe;
Description:
Attempts to write the provided data to the specified pipe handle. returns false
on failure, true on success.
Example:
_ret = [_pipeHandle, "Hello World!"] call jayarma2lib_fnc_writepipe;
if(_ret == false) then {
player sidechat "Write Failed!";
};
HASHMAP FUNCTIONS
jayarma2lib_fnc_hashmapCreate
Function:
BOOL ret = [StringHashmapName] call jayarma2lib_fnc_hashmapCreate;
Description:
Creates a new internally stored, thread safe hash map with the specified name. returns FALSE on failure, true on success.
Example:
["MyHashTable"] call jayarma2lib_fnc_hashmapCreate;
jayarma2lib_fnc_hashmapDelete
Function:
BOOL ret = [StringHashmapName] call jayarma2lib_fnc_hashmapDelete;
Description:
Deletes and unallocates the specified hash map. returns FALSE on failure, TRUE on success.
Example:
["MyHashTable"] call jayarma2lib_fnc_hashmapDelete;
jayarma2lib_fnc_hashmapDeleteValue
Function:
BOOL ret = [StringHashmapName, StringKey] call jayarma2lib_fnc_hashmapDeleteValue;
Description:
Attempts to delete the specified key from the specified hash table. returns FALSE on failure, TRUE on success.
Example:
_ret = ["MyHashTable", "MyKey"] call jayarma2lib_fnc_hashmapDeleteValue;
if(_ret == false) then {
// that key didnt exist...
};
jayarma2lib_fnc_hashmapAddValue
Function:
BOOL ret = [StringHashmapName, StringKey, StringValue] call jayarma2lib_fnc_hashmapAddValue;
Description:
Attempts to add the provided key/value pair to the specified hash map. returns FALSE on failure, TRUE on success.
Example:
_ret = ["MyHashTable", "MyKey", "MyValue"] call jayarma2lib_fnc_hashmapAddValue;
if(_ret == false) then {
// that hash table didnt exist...
};
jayarma2lib_fnc_hashmapGetValue
Function:
STRING ret = [StringHashmapName, StringKey] call jayarma2lib_fnc_hashmapGetValue;
Description:
Attempts to get the value corrosponding to the provided key within the specified map. Returns the value on success, returns nil on failure.
Example:
_value = ["MyHashTable", "MyKey"] call jayarma2lib_fnc_hashmapGetValue;
if(!isNil("_value")) then {
....
};
MISC FUNCTIONS
jayarma2lib_fnc_writeLog
Function:
[StringToLog] call jayarma2lib_fnc_writeLog;
Description:
Writes to the local JayArma2Lib.log located in the ArmA2 Root.
Example:
["Hello log world!"] call jayarma2lib_fnc_writeLog;
jayarma2lib_fnc_getLocalTime
Function:
INT ret = [] call jayarma2lib_fnc_getLocalTime;
Description:
Gets the local time of the system in which the command is ran. The time is provided in 24-Hour Metric Time (12.5 = 12:30).
Example:
_time = [] call jayarma2lib_fnc_getLocalTime;
if(_time == 1.0) then {
// its 1AM...
};
-------------------------------------------------------
CREDITS
-------------------------------------------------------
- A2TS3 Team for helping with functionality requests
- Nou for addon help and getting me in touch with A2TS3
- Task Force Proteus @ TacticalGamer.com for being my
guinea pigs.
- TacticalGamer.Com Admin team for supporting me and
helping me with so much server side testing.
MySQL? Why? There is going to be a planned extensions support so adding your own wrapper DLL to MySQL wouldn't be hard, but that seems over kill. SQLite support is coming though.
Also I can almost 100% guarantee you will never, ever, see the source code to this.
We have also added this release to your personal author profile
If a release or contact information is missing, feel free to drop a PM, it will then be added.
And here is the BBCode if you want to add our Mirror to your release post : Spoiler: