Jump to content

Recommended Posts

Great! Keep up the good work with Arma2Net :bounce3:

---------- Post added at 08:11 PM ---------- Previous post was at 07:41 PM ----------

Almost everything works fine so far. I am able to connect with an MySQL Database and use some Arma2Net Functions. But I have a problem with the string manipulation functions.

Examples:

1. Works fine:

_strGet = format ["[iD0Var=%1]", 4];

_result = "Arma2Net.Unmanaged" callExtension format["Arma2NETMySQL ['Databasename', 'ProcGetTestData', '%1']", _strGet];

hint format["Final value: %1",_result];

2. Works fine:

hint ("Arma2Net.Unmanaged" callExtension "DateTime ['now', 'HH:mm:ss dd/MM/yyyy']");

3. DOESN'T work:

_TestText = ("Arma2Net.Unmanaged" callExtension "Str ['get', 'hello', 2]");

hint _TestText;

I'm getting always the note: "Arma2Net.Managed.FunctionNotFoundException"

What could I do wrong using the "Str" Functions for string manipulation?

The LogFile looks like:

"06/25/2012 20:28:35 Error Caught exception

Arma2Net.Managed.FunctionNotFoundException: Unable to find the function Str.

bei Arma2Net.Managed.AddIns.AddInManager.ActivateAddIn(String addInName, Boolean disableSandboxing)

bei Arma2Net.Managed.AddIns.AddInManager.InvokeAddIn(String addInName, String addInArgs, Int32 maxResultSize)

bei Arma2Net.Managed.Bridge.InvokeFunction(String function, Int32 maxResultSize)"

Thanks for any help.

Edited by AAD10 Pete

Share this post


Link to post
Share on other sites

If I put the file to the folder @Arma2Net\AddIns\UtilitiesPlugin.dll --> the same error again

If I put the file to the folder @Arma2Net\AddIns\UtilitiesPlugin\UtilitiesPlugin.dll --> i get the new error:

"06/26/2012 21:24:52 Error Caught exception

System.IO.FileLoadException: Die Datei oder Assembly "file:///C:\Program Files\Bohemia Interactive\ArmA 2\@Arma2NET\AddIns\UtilitiesPlugin\UtilitiesPlugin.dll" oder eine Abhängigkeit davon wurde nicht gefunden. Der Vorgang wird nicht unterstützt. (Ausnahme von HRESULT: 0x80131515)

Dateiname: "file:///C:\Program Files\Bohemia Interactive\ArmA 2\@Arma2NET\AddIns\UtilitiesPlugin\UtilitiesPlugin.dll" ---> System.NotSupportedException: Es wurde versucht, eine Assembly von einer Netzwerkadresse zu laden, was in früheren Versionen von .NET Framework zum Ausführen der Assembly als Sandkastenassembly geführt hätte. In dieser Version von .NET Framework wird die CAS-Richtlinie standardmäßig nicht aktiviert, dieser Ladevorgang kann daher gefährlich sein. Wenn Sie nicht beabsichtigen, durch diesen Ladevorgang eine Sandkastenassembly zu erstellen, aktivieren Sie den loadFromRemoteSources-Schalter. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkId=155569".

bei System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

bei System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

bei System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)

bei System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)

bei System.Reflection.Assembly.LoadFrom(String assemblyFile)

bei System.AddIn.Hosting.ActivationWorker.Activate()

bei System.AddIn.Hosting.AddInActivator.ActivateInAppDomain[T](AddInToken pipeline, AppDomain domain, AddInControllerImpl controller, Boolean weOwn)

bei System.AddIn.Hosting.AddInActivator.Activate[T](AddInToken token, AppDomain target)

bei System.AddIn.Hosting.AddInToken.Activate[T](AppDomain target)

bei Arma2Net.Managed.AddIns.AddInManager.ActivateAddIn(AddInToken token, Boolean disableSandboxing)

bei Arma2Net.Managed.AddIns.AddInManager.ActivateAddIn(String addInName, Boolean disableSandboxing)

bei Arma2Net.Managed.AddIns.AddInManager.InvokeAddIn(String addInName, String addInArgs, Int32 maxResultSize)

bei Arma2Net.Managed.Bridge.InvokeFunction(String function, Int32 maxResultSize)"

...something with SandBoxAssembly and I should activate the loadFromRemoteSources trigger. --> http://go.microsoft.com/fwlink/?LinkId=155569.

...something with CAS-Guidelines not activated by default...

thx for further help

Share this post


Link to post
Share on other sites

Still the same error.

Logfile; So far so good:

"06/27/2012 18:54:49 Log: Unmanaged side loaded

06/27/2012 18:54:50 Info Successfully loaded into process arma2oa

06/27/2012 18:54:50 Info Arma2NET 1.11.1.0 initializing on CLR 4.0.30319.269

06/27/2012 18:54:50 Info Sandboxing is disabled

06/27/2012 18:54:50 Info Rebuilding addin store

06/27/2012 18:54:50 Info Finding addins

06/27/2012 18:54:50 Info Found addins: Arma2NETMySQL, Activate, IsFunction, Deactivate, _Empty, VersionOfAddIn, CompareVersion, ClrVersion, Version, Functions, CommandLine, DateTime, Dict, Str

06/27/2012 18:54:50 Info Activating base addins

06/27/2012 18:54:50 Info Activated Activate from BaseFunctionsPlugin.Activate, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/27/2012 18:54:50 Info Activated IsFunction from BaseFunctionsPlugin.IsFunction, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/27/2012 18:54:50 Info Activated Deactivate from BaseFunctionsPlugin.Deactivate, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/27/2012 18:54:50 Info Activated _Empty from BaseFunctionsPlugin._Empty, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/27/2012 18:54:50 Info Activated VersionOfAddIn from BaseFunctionsPlugin.VersionOfAddIn, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/27/2012 18:54:50 Info Activated CompareVersion from BaseFunctionsPlugin.CompareVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/27/2012 18:54:50 Info Activated ClrVersion from BaseFunctionsPlugin.ClrVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/27/2012 18:54:50 Info Activated Version from BaseFunctionsPlugin.Arma2NetVersion, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/27/2012 18:54:50 Info Activated Functions from BaseFunctionsPlugin.Functions, BaseFunctionsPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e (Sandboxed: False)

06/27/2012 18:54:50 Info Arma2NET initialized

06/27/2012 18:54:51 Info Activated Arma2NETMySQL from Arma2NETMySQLPlugin.Arma2NETMySQLPlugin, Arma2NETMySQLPlugin, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null (Sandboxed: False)"

Then the old error:

"06/27/2012 18:54:52 Error Caught exception

System.IO.FileLoadException: Die Datei oder Assembly "file:///C:\Program Files\Bohemia Interactive\ArmA 2\@Arma2NET\AddIns\UtilitiesPlugin\UtilitiesPlugin.dll" oder eine Abhängigkeit davon wurde nicht gefunden. Der Vorgang wird nicht unterstützt. (Ausnahme von HRESULT: 0x80131515)

Dateiname: "file:///C:\Program Files\Bohemia Interactive\ArmA 2\@Arma2NET\AddIns\UtilitiesPlugin\UtilitiesPlugin.dll" ---> System.NotSupportedException: Es wurde versucht, eine Assembly von einer Netzwerkadresse zu laden, was in früheren Versionen von .NET Framework zum Ausführen der Assembly als Sandkastenassembly geführt hätte. In dieser Version von .NET Framework wird die CAS-Richtlinie standardmäßig nicht aktiviert, dieser Ladevorgang kann daher gefährlich sein. Wenn Sie nicht beabsichtigen, durch diesen Ladevorgang eine Sandkastenassembly zu erstellen, aktivieren Sie den loadFromRemoteSources-Schalter. Weitere Informationen finden Sie unter "http://go.microsoft.com/fwlink/?LinkId=155569".

bei System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

bei System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)

bei System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)

bei System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)

bei System.Reflection.Assembly.LoadFrom(String assemblyFile)

bei System.AddIn.Hosting.ActivationWorker.Activate()

bei System.AddIn.Hosting.AddInActivator.ActivateInAppDomain[T](AddInToken pipeline, AppDomain domain, AddInControllerImpl controller, Boolean weOwn)

bei System.AddIn.Hosting.AddInActivator.Activate[T](AddInToken token, AppDomain target)

bei System.AddIn.Hosting.AddInToken.Activate[T](AppDomain target)

bei Arma2Net.Managed.AddIns.AddInManager.ActivateAddIn(AddInToken token, Boolean disableSandboxing)

bei Arma2Net.Managed.AddIns.AddInManager.ActivateAddIn(String addInName, Boolean disableSandboxing)

bei Arma2Net.Managed.AddIns.AddInManager.InvokeAddIn(String addInName, String addInArgs, Int32 maxResultSize)

bei Arma2Net.Managed.Bridge.InvokeFunction(String function, Int32 maxResultSize)"

Share this post


Link to post
Share on other sites

Are you able to compile C#? I wonder if compiling the plugin yourself will fix it - the error is talking about networking.

Share this post


Link to post
Share on other sites

I will try to figure that out. But I am not really familiar with C# compiling.

Thx for your help anyway

Share this post


Link to post
Share on other sites

What happens if you right click the DLL and go to Properties? Is there an unblock option?

Share this post


Link to post
Share on other sites

Using: Arma2Net.Managed.Format.ObjectAsSqf, this is how results are returned via the run() method. Right now, the result is an array. Is it possible to return an array of arrays? Does it depend on the initial .NET mapping of whatever type it is? Thanks.

Share this post


Link to post
Share on other sites

It is possible, just pass an array of arrays along to the method.

Share this post


Link to post
Share on other sites

Sorry for the delayed answer.

Thats it!

My Win7 blocked the DLL because the file is coming from a foreign computer. I had to unblock the DLL manually under "properties".

Now the DLL works fine.

thx

Share this post


Link to post
Share on other sites

New Doomi 2.63 supports this - but as i am starting the mission on the server i get a "the program cant start because MSVCR100.dll is missing".

I have installed netframe4 and i have veryfied that the MSVCR100.dll are located in my windows/system32 dir.

Any hints :)

Share this post


Link to post
Share on other sites

That's odd. system32 is a search directory for DLLs. If Windows can't find the DLL then that error occurs. Is the Microsoft Visual C++ 2010 Runtime installed correctly?

Share this post


Link to post
Share on other sites
Dorph;2185574']New Doomi 2.63 supports this - but as i am starting the mission on the server i get a "the program cant start because MSVCR100.dll is missing".

I have installed netframe4 and i have veryfied that the MSVCR100.dll are located in my windows/system32 dir.

Any hints :)

Same here... i`m using Win7 64bit.. DLL is located in sytem32 folder and NetFramework 4 is installed... =/

Share this post


Link to post
Share on other sites

If somebody is interested, I've made an Arma2NET plugin which uses csharp-sqlite for Domina which saves some player stats like times played on the server, time played, kills, etc.

Contrary to the MySQL solution it does not need a third party database like MySQL on the server but creates a SQLite database in %LocalAppData% automatically.

So basically the server admin just needs to add the DomDatabase plugin, the PublicKeyToken and start the server with @Arma2NET, that's all.

Download here: https://dev-heaven.net/attachments/download/18362/DOM265_94444plus.7z

(Be aware that it needs beta patch 94444 or better for both, server and client, as the mission makes use of some new beta patch features like publicVariableServer/publicVariableClient, etc).

Adding charp-sqlite to an Arma2NET plugin is really easy.

Xeno

Share this post


Link to post
Share on other sites

Arma2NET version 1.12 has been released with the following changes:

- Some public API changes and design improvements. The old API is now deprecated.

- Added code inclusion support to the scripting system, and environment variables are now expanded in //reference.

- Functions and IsFunction behaviour improved.

- Arma2NET Explorer Evaluator tab now emulates Arma2Net.Unmanaged.dll.

- Arma2NET Explorer Evaluator tab results are now selectable and copyable.

ZIP: https://bitbucket.org/Scott_NZ/arma2net/downloads/Arma2NET-1.12.zip

MSI: https://bitbucket.org/Scott_NZ/arma2net/downloads/Arma2NetInstaller-1.12.msi

People interested in this project and related projects (e.g. Persistent DB) are invited to join our Skype group: skype:?chat&blob=3kGy53oStpVFXiJdZUWGJO8Gc_rJyuh7qYejJejQazcJfkTfDpES869p-Asg684d7xA

Share this post


Link to post
Share on other sites

Arma2NET Explorer 1.12 was wrongly displaying an error box when an evaluator result returned null due to a small oversight/bug. Patched version here: https://bitbucket.org/Scott_NZ/arma2net/downloads/Arma2NetExplorer.exe

Thanks to ArMaTeC for reporting this.

I also updated the scripting engine wiki page to reflect the 1.12 changes (addition of //include): https://bitbucket.org/Scott_NZ/arma2net/wiki/Scripts

Share this post


Link to post
Share on other sites

Arma2NET 1.13 changelog:

- Explorer was wrongly displaying an error box when an evaluator result returned null.

- Improved the accessibility of Explorer - added the ability to cycle through the command history using the up/down arrow keys, and the command history is now persistent.

- Format class fixes - fixed some issues with TrySqfAsString.

- Improved stability and crash prevention - Arma2NET will no longer die if Settings.yaml can't be loaded or if NLog.dll.nlog can't be loaded.

ZIP: https://bitbucket.org/Scott_NZ/arma2net/downloads/Arma2NET-1.13.zip

MSI: https://bitbucket.org/Scott_NZ/arma2net/downloads/Arma2NetInstaller-1.13.msi

Share this post


Link to post
Share on other sites

I'd like to use arma2net to initialize a .net process that has access to modify server, and player data.

Is this something I could actually do or would something have to be written to use it like this.

Edited by onyxphase

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

×