naught 6 Posted October 8, 2013 (edited) Current Version:Windows 1.0.0.1 Alpha ReleaseLast Updated:10/7/2013Requirements:Arma 2 1.09 | Arma 2 OA 1.62 | Arma 3 1.00Community Based Addons 1.0.0Download:STABLE | DEVELOPMENT | MIRRORSOURCE | REPOSITORY About Naught.Net What is Naught.Net? Naught.Net is an extension-based (.dll) addon that extends the functionality of the Real Virtuality engine with multiple features accessed via an extensive API. What features does Naught.Net offer? Naught.Net offers many features, currently allowing for hashing (MD2, MD4, MD5, SHA1, and SHA256), regular expressions (regex-based matching, searching, and replacing), and file-downloading (this is handler-based and completely multi-threaded). How does file-downloading in Naught.Net work? Naught.Net uses handle-based multithreading to download files from local and remote networks. This works by requesting a file and downloading it asynchronously from the main Arma process while the SQF engine continually asks (per-frame) the extension if the download has finished. Once done, the extension will return the file (up to 1MB in size using truncating and chunking techniques; this is the limit due to security issues, so it may be increased later) as a [perfectly safe] string to the SQF engine which will then call the supplied handler code, passing the file as the primary _this variable. What if I want a function that isn't yet apart of Naught.Net? Request it here by posting a reply, and maybe it'll make its way into Naught.Net! Where can I report issues about Naught.Net? Post them up here as a reply to this thread, and I'll parse through them within 48 hours. What are some of the possibilities with Naught.Net? You can reference my post below for a brief overview on some ideas that I've had about this addon. Technical Specifications Multi-threaded handler-based support. Chunking and truncating for nearly unlimited inter-communication (Extension to Arma) bandwidth. Max concurrent threads: 10. Max Download bandwidth per thread: 1 MB, Max Upload bandwidth per thread: 512 KB. Download support for HTTP (POST & GET), HTTPS (POST & GET), FTP (untested), SSH (untested), and more. Naught.Net ReadMe File ===================================== Naught.Net Version: 1.0.0.1 Release date: 10/7/2013 Author(s): Naught Multiplayer compatible: Yes ===================================== An unofficial addon for the PC game "Arma" by Bohemia Interactive. ===================================== DESCRIPTION ===================================== An extension-based (.dll) addon that extends the functionality of the Real Virtuality engine with multiple features accessed via an extensive API detailed in the <FUNCTION INDEX> below. ===================================== REQUIREMENTS ===================================== Arma 2 - Version [1.09] - Bohemia Interactive Arma 2: Operation Arrowhead - Version [1.62] - Bohemia Interactive Arma 3 - Version [1.00] - Bohemia Interactive CBA - Version b190 - CBA Team ===================================== FUNCTION INDEX ===================================== NOTE: All extension returns of the return data-type [Return] consist of either a string of the return data [string] on success, an extension-internal handle [int] on multi-threaded applications (although by using the below functions this should not be returned), an error [boolean false] on an extension-internal error, or a null data-type [Nil] on a null (or empty) return. Data checks should be mandatory after a call to one of these functions. NOTICE: All tilde (~) characters sent to the extension WILL BE REPLACED by the minus (-) character prior to the transfer. ---------------- COMMON FUNCTIONS ---------------- NDT_fnc_getVersion Description: Get version of the Naught.Net extension (Naught.Net.dll). Parameters: None Return: Version [Return] (empty string if extension is unloaded). Example: _version = [] call NDT_fnc_getVersion; ---------------- STRING FUNCTIONS ---------------- NDT_fnc_hashString Description: Hash a string. Hash Types are: 0=MD2, 1=MD4, 2=MD5, 3=SHA1, 4=SHA256. Parameters: 0: Text [string], 1: Hash Type [integer] (Optional). Return: Hash [Return]. Example: _hash = ["hash this string", 3] call NDT_fnc_hashString; NDT_fnc_regexMatch Description: Check if text matches a given regular expression. Parameters: 0: Text [string], 1: Regex [string]. Return: Encapsulated Boolean [Return] (ie. "true"). Example: _encapBool = ["subject", "(sub)(.*)"] call NDT_fnc_regexMatch; NDT_fnc_regexSearch Description: Search text for characters matching a regular expression. Parameters: 0: Text [string], 1: Regex [string], 2: Max Iterations [int] (Optional). Return: Encapsulated Array [Return] (ie. "[['match1'], ['subMatch1', 'subMatch2']]"). Example: _encapArray = ["this subject, that submarine, every subsequence", "\\b(sub)([^ ]*)", 2] call NDT_fnc_regexSearch; NDT_fnc_regexReplace Description: Replace all characters matching a regular expression. Parameters: 0: Text [string], 1: Regex [string], 2: Replace With [string] (Reference http://www.cplusplus.com/reference/regex/match_replace/). Return: New Text [Return]. Example: _newText = ["there is a subsequence in the string", "\\b(sub)([^ ]*)", "sub-$2"] call NDT_fnc_regexReplace; ----------------- NETWORK FUNCTIONS ----------------- NDT_fnc_newDownloadHandler Description: Create a new download handler to download a file and call code. Parameters: 0: Address [string] ("protocol://address.domain:port"), 1: Handler Code [Curly-Braces] (Passes download return as _this [Return]), 2: TimeOut Seconds [int] (Optional), 3: Post Data [string] (Optional). Return: Handle to Asynchronous (Spawned) Code [script]. Example: _scriptHandle = ["https://www.google.com", {dl_data = _this;}, 30, "request=search"] call NDT_fnc_newDownloadHandler; ===================================== KNOWN ISSUES ===================================== None. ===================================== VERSION HISTORY ===================================== Version 1.0.0.1 - Initial Release ===================================== LICENSE ===================================== Copyright © 2013 Dylan Plecki <dylanplecki@gmail.com> All rights reserved. Naught.Net is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Naught.Net is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>. ===================================== CONTACT DETAILS ===================================== Dylan Plecki (Naught) can be contacted either through the UnitedOperations.Net forums as <Naught> or via email at <dylanplecki@gmail.com> Planned Features Get Real Time (with time zones). XML / YAML Parser. Database Support. 2-Way Encryption Support. Contact Naught: Naught at the United Operations Forums Naught at the Bohemia Interactive Forums Via email at dylanplecki@gmail.com Edited December 20, 2013 by Naught Share this post Link to post Share on other sites
.kju 3245 Posted October 10, 2013 sounds pretty cool Naught :) unfortunately both download links are 404 please also provide the source as extension/DLLs are a security risk on use Share this post Link to post Share on other sites
naught 6 Posted October 10, 2013 (edited) ;2531161']sounds pretty cool Naught :)unfortunately both download links are 404 please also provide the source as extension/DLLs are a security risk on use The broken links were an unfortunate effect of my meddling with directories, but they're fixed now. Also uploaded source and migrated to a faster host, links are updated in the original post :) Edited October 11, 2013 by Naught Share this post Link to post Share on other sites
Guest Posted October 11, 2013 Thanks for informing us about the release :cool: Release frontpaged on the Armaholic homepage. Naught.Net v1.0.0.1For usage in Arma 2 / Arma 2: Operation Arrowhead:Community Based AddonsFor usage in Arma 3:Community Based Addons A3 ================================================ We have also "connected" these pages to your account on Armaholic. This means in the future you will be able to maintain these pages yourself if you wish to do so. Once this new feature is ready we will contact you about it and explain how things work and what options you have. When you have any questions already feel free to PM or email me! Share this post Link to post Share on other sites
Harzach 2517 Posted October 11, 2013 For the benefit of us dummies, what would the practical applications of this add-on be? Share this post Link to post Share on other sites
tupolov 520 Posted October 11, 2013 Naught, Congrats on the release! Awesome to have some regex capability with this. What are you guys using it for? I'm assuming downloading of network based files... for config? I'm interested in what you are doing around parsing. Are you aware of the CBA_fnc_parseYAML already? I'm personally looking to do JSON parsing in SQF. I already have an HTTP addon and file reading/writing addon complete for my mod. I also have get real time, get server name, get ip address and lots more. I'm using Addins for Scott W's Arma2Net addon. Share this post Link to post Share on other sites
naught 6 Posted October 11, 2013 (edited) For the benefit of us dummies, what would the practical applications of this add-on be? Naught,Congrats on the release! Awesome to have some regex capability with this. What are you guys using it for? I'm assuming downloading of network based files... for config? I'm interested in what you are doing around parsing. Are you aware of the CBA_fnc_parseYAML already? I'm personally looking to do JSON parsing in SQF. I already have an HTTP addon and file reading/writing addon complete for my mod. I also have get real time, get server name, get ip address and lots more. I'm using Addins for Scott W's Arma2Net addon. I probably should have renamed the NDT_fnc_newDownloadHandler to NDT_fnc_newConnectionHandler to clarify what exactly it does. With this addon, you can request completely dynamic files from a web server (ie. PHP, ASP, Java, etc.) for completely dynamic data. You can interact with MySQL and SQL servers via this method, you can get and save data with the GET and POST methods, you can connect to remote programs via the PORT option, and much more. With this, you can enable inter-server communication (or even inter-game communication), you can store persistent data, you can connect Arma to web interfaces and stream data to it, and really you can do anything since it's connected to the web. I've had a few ideas myself, like blocking players from playing on the server until they've created an account on our forums, or logging kills and deaths to a web server for fully persistent records, or by linking our NotePad addon to a web server for saving. We've even considered connecting Arma and SB Pro (a tank-based game) so that all actions in one game will be reenacted in another. And for MSO's, you could stream to a web interface all data, or you could even make a real-time interactive web-based map of the area and stream player positions, names, health, etc. so people can see what's going on in the battlefield. This addon is the stepping stone for things that were never possible before. And also the hashing and regex features are more straight-forward so I'm not going to describe what they could do :) Also Tupolov, I was considering adding file reading/writing and downloading larger files to disk but that creates a HUGE security risk, which would've be feasible for an addon which I'm hoping will be accessible to all types of servers and communities. Instead I kept it limited to strings and I used chunking to allow for up to 1 MB of data to be transfered (hard-coded, but may be changed in the future). Edited October 11, 2013 by Naught Share this post Link to post Share on other sites
Harzach 2517 Posted October 11, 2013 Thanks for the explanation, Naught - sounds pretty amazing! It also sounds like something that will inspire yet more innovation. Can't wait to see what comes of it! Share this post Link to post Share on other sites
mcpxxl 2 Posted October 11, 2013 Hi please deliver demo missions this time it will help people if it is not so much abstract THX Share this post Link to post Share on other sites
jacob88 10 Posted October 11, 2013 Hi, just throwing my 2 cents in, but you could create a sub-mod with a larger download option without being restricted to strings, then we could use it to download mods when we connect to a server running those mods by automatically having the game restart running the mod just downloaded and connecting back to the same server. Share this post Link to post Share on other sites
naught 6 Posted October 12, 2013 Hi, just throwing my 2 cents in, but you could create a sub-mod with a larger download option without being restricted to strings, then we could use it to download mods when we connect to a server running those mods by automatically having the game restart running the mod just downloaded and connecting back to the same server. I'm working on configurable download options (ie. max concurrent threads, max download/upload sizes, etc.) and download_to_file could be an option, but I'd focus on that after the next beta release with (hopeful) YAML and XML support with configurable extension options via a config.yml/xml. But with the way Arma works, this process of downloading and restarting would have to be done in-game after the player joins, so they may take up a slot (and if the mods are too big this may take a long time). But personally I'd prefer to require a single mod which downloads script from a remote server, but I could still see the potential for dynamic images/sounds/music/configs/videos/etc. Share this post Link to post Share on other sites
mariojamie 1 Posted December 11, 2013 Im using Naught.Net to request a webpage that returns db rows in arma array format but naught.net doesnt seem to be chunking the data Share this post Link to post Share on other sites
McMick 10 Posted February 1, 2014 For dummies like me, could you explain what this is a bit more? What could I use this for, and what compelled you to create it? Is this only for advanced scripters, or is this something a novice could use as well? Share this post Link to post Share on other sites