Jump to content

Recommended Posts

I've read through your tutorials, but was unsure if i could write something that didn't require that i pass it the data first.

lets mock up a quick idea hear. I want the plugin always have the most up to date list of all active players objects.

would i have to have the scripting language pass it to the .net object, or would i be able to grab player from the .net plugin?

Share this post


Link to post
Share on other sites

Unfortunately you'd have to pass the player along to Arma2NET. It does not have access to anything within the game.

Share this post


Link to post
Share on other sites

Many thanks for the work on Arma2Net!

I have been fighting with an issue that I have been unable to resolve... I have narrowed it down to something wrong with Arma2Net perhaps but I thought I would post here to see if anyone else has had and resolved this issue. It seems that the server cannot find dll files related to Arma2Net when a client logs in to the server. I have tried running this on 3 different machines with and without all windows updates for the .Net 4 client profile. I suspect that I am doing something wrong but I cannot seem to isolate it. Any help would be greatly appreciated I am getting the following:

Arma2Net.log:

07/19/2012 11:03:54 Log: Unmanaged side loaded

07/19/2012 11:03:56 Log: Fatal unhandled exception

Log: System.IO.FileNotFoundException: Could not load file or assembly 'Arma2Net.Managed, Version=1.7.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e' or one of its dependencies. The system cannot find the file specified.

File name: 'Arma2Net.Managed, Version=1.7.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e'

at Arma2Net.Unmanaged.InvokeFunctionImpl(SByte* output, Int32 outputSize, SByte* function)

at Arma2Net.Unmanaged.InvokeFunction(SByte* output, Int32 outputSize, SByte* function)

=== Pre-bind state information ===

LOG: DisplayName = Arma2Net.Managed, Version=1.7.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e

(Fully-specified)

LOG: Appbase = file:///C:/Program Files/Bohemia Interactive/ArmA 2/Expansion/beta/

LOG: Initial PrivatePath = NULL

Calling assembly : (Unknown).

===

LOG: This bind starts in default load context.

LOG: No application configuration file found.

LOG: Using host configuration file:

LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.

LOG: Post-policy reference: Arma2Net.Managed, Version=1.7.0.0, Culture=neutral, PublicKeyToken=8762987cc8e6095e

LOG: Attempting download of new URL file:///C:/Program Files/Bohemia Interactive/ArmA 2/Expansion/beta/Arma2Net.Managed.DLL.

LOG: Attempting download of new URL file:///C:/Program Files/Bohemia Interactive/ArmA 2/Expansion/beta/Arma2Net.Managed/Arma2Net.Managed.DLL.

LOG: Attempting download of new URL file:///C:/Program Files/Bohemia Interactive/ArmA 2/Expansion/beta/Arma2Net.Managed.EXE.

LOG: Attempting download of new URL file:///C:/Program Files/Bohemia Interactive/ArmA 2/Expansion/beta/Arma2Net.Managed/Arma2Net.Managed.EXE.

thanks,

BB

Share this post


Link to post
Share on other sites

Thanks for assisting with the issue :)

I am not sure, I have verified that I have the MSVCR100.dll in windows/system32. Any other thoughts? Any ideas why Arma2Net is looking in the wrong place for 'Arma2Net.Managed'?

LOG: Attempting download of new URL file:///C:/Program Files/Bohemia Interactive/ArmA 2/Expansion/beta/Arma2Net.Managed.DLL?

BB

Share this post


Link to post
Share on other sites

Is everything in C:/Program Files/Bohemia Interactive/ArmA 2/@Arma2NET?

Share this post


Link to post
Share on other sites

Shouldn't you be pointing there for the DLLs when you compile it? You see it's pointing to your beta folder and not the root Arma2 folder. Perhaps that's the issue?

Share this post


Link to post
Share on other sites

bjbourn, your problem seems to be because of an event used to find the rest of Arma2NET is not being subscribed to properly, probably because of a bug within Arma2NET. Which version of Arma2NET are you using? I will be releasing Arma2NET 2.0 soon with a lot of awesome fixes and enhancements, which I would like you to try.

Share this post


Link to post
Share on other sites

Arma2NET has been updated to version 2.0 with the following changes:

- Performance boost, including an improvement in startup time.

- Removed sandboxing because people just override it with -arma2netdev anyway, defeating the purpose of having it.

- Plugins can now be updated and reloaded at runtime with the new custom plugin system. This should also work with .NET 4.5 RC.

- Removed scripting system for now because of issues with resolving external references.

- Removed Settings.yaml and files and folders which are no longer needed.

- Fixed culture issues - Format.ObjectAsSqf was not using the invariant culture properly.

- PythonPlugin now targets IronPython 2.7.3, from 2.7.2.

- These are breaking changes - all plugins will need to retarget Arma2NET.

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

MSI: https://bitbucket.org/Scott_NZ/arma2net/downloads/Arma2NET-2.0.msi

Updated PythonPlugin: https://bitbucket.org/Scott_NZ/arma2net/downloads/PythonPlugin-2.0.zip

The biggest (and riskiest) update yet. As said above, these are breaking changes and all plugins will need to be changed slightly to target Arma2NET 2.0. The wiki has been updated accordingly which should help you with this.

Code examples:

using System;
using Arma2Net.AddInProxy;

namespace BaseFunctionsPlugin
{
   [AddIn("ClrVersion")]
   public class ClrVersion : AddIn
   {
       public override string Invoke(string args, int maxResultSize)
       {
           return Format.ObjectAsSqf(Environment.Version);
       }
   }
}

hint ("Arma2Net.Unmanaged" callExtension "ClrVersion")

using Arma2Net.AddInProxy;

namespace MyPlugin
{
   [AddIn("MyPlugin")]
   public class MyPlugin : MethodAddIn
   {
       public string Hello()
       {
           return "Hello world!";
       }
   }
}

hint ("Arma2Net.Unmanaged" callExtension "MyPlugin [Hello]")

Main observations:

- Arma2NetAddIn has been renamed to AddIn, and so on.

- The Run() method has been renamed to Invoke().

- The Deactivate() method has been renamed to Unload(). This method will always be called just before the plugin is unloaded and can be used for cleanup.

- All plugins are to refer to Arma2Net.AddInProxy.dll instead of Arma2Net.Managed.dll and System.AddIn.dll. The Format class can be found in there for SQF formatting, as well as the base classes that your plugins can derive from.

- Arma2NetLongOutputAddIn has been removed, since maxResultSize is now part of the default Invoke() signature.

There are also some new builtin functions:

- Load will load (or reload if already loaded) all plugins found in ArmA 2/@Arma2Net/AddIns. Place each plugin inside its own subfolder, like previously. Loading will not lock the plugins, so you can delete, replace etc the plugins at runtime and then call Load again to reload them.

- Unload will unload all plugins.

- AddIns will return a list of loaded plugins.

Share this post


Link to post
Share on other sites

Wow, impressive changelog, improvements and fixes, congrats!

Share this post


Link to post
Share on other sites

Thanks for the heads up, I think that did it for me, I am now getting a differnt crash error, but it appears that Arma2Net is now happy, here is the Arma2Net.log

07/21/2012 15:07:55 Log: Unmanaged side loaded

07/21/2012 15:07:55 Info Successfully loaded into process arma2oaserver

07/21/2012 15:07:55 Info Arma2NET 2.0.0.0 initializing on CLR 4.0.30319.269

07/21/2012 15:07:55 Info Loading addins

The crash message I am getting now is this, but I don't know what it is related to yet:

Problem signature:

Problem Event Name: CLR20r3

Problem Signature 01: arma2oaserver.exe

Problem Signature 02: 1.62.95.208

Problem Signature 03: 50097a12

Problem Signature 04: mscorlib

Problem Signature 05: 4.0.0.0

Problem Signature 06: 4ee9af8e

Problem Signature 07: 2603

Problem Signature 08: 0

Problem Signature 09: System.IO.FileNotFoundException

OS Version: 6.1.7600.2.0.0.272.7

Locale ID: 1033

Additional Information 1: 0a9e

Additional Information 2: 0a9e372d3b4ad19135b953a78882e789

Additional Information 3: 0a9e

Additional Information 4: 0a9e372d3b4ad19135b953a78882e789

Again thanks for looking into my issue,

BB

Share this post


Link to post
Share on other sites

How are you calling Arma2NET from SQF? Are there any logs in AppData/Local/Arma2NET or any Fusion logs? Are you using an old plugin that doesn't target 2.0?

Share this post


Link to post
Share on other sites

At least the arma2oaserver.exe is no longer crashing now YAY!!!. I rebuilt the Arma2mysql plugin that was updated.

I think something is still out of wack with the plugin though, it is looking for AddInView.dll which seems to have been removed from 2.0 of Arma2Net.

Anyway here is what I am seeing now:

07/21/2012 23:42:01 Log: Unmanaged side loaded

07/21/2012 23:42:02 Info Successfully loaded into process arma2oaserver

07/21/2012 23:42:02 Info Arma2NET 2.0.0.0 initializing on CLR 4.0.30319.269

07/21/2012 23:42:02 Info Loading addins

07/21/2012 23:42:02 Info Loaded Arma2NETMySQL 0.1.0.0 by firefly2442: Runs MySQL procedure commands.

07/21/2012 23:42:02 Info Loaded Arma2NETMySQLCommand 0.1.0.0 by firefly2442: Runs raw MySQL commands

07/21/2012 23:42:02 Info Loaded CompareVersion 2.0.0.0 by Scott_NZ: Compares two version strings and returns an integer indicating how they compare.

07/21/2012 23:42:02 Info Loaded ClrVersion 2.0.0.0 by Scott_NZ: Retrieves the version of the Common Language Runtime.

07/21/2012 23:42:02 Info Loaded Version 2.0.0.0 by Scott_NZ: Returns the version of Arma2NET.

07/21/2012 23:42:02 Info Loaded CommandLine 2.0.0.0 by Scott_NZ: Returns the command line used to start the application.

07/21/2012 23:42:02 Info Loaded DateTime 2.0.0.0 by Scott_NZ: Returns the current date and time.

07/21/2012 23:42:02 Info Arma2NET initialized in 00:00:00.6424168

07/21/2012 23:42:02 Error Caught exception of type System.IO.FileNotFoundException

System.IO.FileNotFoundException: Could not load file or assembly 'Arma2Net.Managed.dll' or one of its dependencies. The system cannot find the file specified.

File name: 'Arma2Net.Managed.dll' ---> System.IO.FileNotFoundException: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)

at System.Reflection.AssemblyName.nGetFileInformation(String s)

at System.Reflection.AssemblyName.GetAssemblyName(String assemblyFile)

at Arma2Net.AddInProxy.Utils.get_Version()

at Arma2NETMySQLPlugin.Startup.StartupConnection()

at Arma2NETMySQLPlugin.Arma2NETMySQLPlugin.Invoke(String args, Int32 maxResultSize)

at Arma2Net.Managed.AddInManager.InvokeAddInImpl()

at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)

at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)

at Arma2Net.Managed.AddInManager.InvokeAddIn(String addInName, String args, Int32 maxResultSize)

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

many thanks again,

BB

Share this post


Link to post
Share on other sites

Might be good to continue the discussion here:

http://forums.bistudio.com/showthread.php?128795-Arma2MySQL

That way this thread doesn't get cluttered with other things.

.

With regard to your issue, I made some changes today. What's the Git hash for the version you tried? Make sure to pull and try the latest if there is a newer one.

Share this post


Link to post
Share on other sites

I will move to the arma2mysql thread.

thanks,

BB

Edited by bjbourn

Share this post


Link to post
Share on other sites

Arma2NET 2.1 changelog:

- Fixed an issue where addin dependencies were not loading correctly.

- Fixed a non-fatal error sometimes caused when retrieving the list of loaded addins.

- Improved the appearance of Arma2NET Explorer, and added a "Run History" feature.

- Improved the log files - addin details are now in a nice table.

- Added XML documentation file for use with IntelliSense, to make addin development easier.

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

MSI installer: https://bitbucket.org/Scott_NZ/arma2net/downloads/Arma2NET-2.1.msi

Share this post


Link to post
Share on other sites

Hi Scott.

Getting an ARMA 2 crash when running MyPlugin using your example for "Unmanaged", beta 95417. Also, why did you chose to use parenthesis, it's syntactically incorrect and hurts Squint (2). Ported my save system to a library, using arma2net as a dependency, but trying provided example failed horribly. Could you try a current beta against your example? Trying to get away from JayARMA2Lib, making me waste time.. (C# program sends correct strings, ARMA adds garbage to the end, and the handler management totally blows)

Compiled "MyPlugin" with VS2010 (Stock settings / .NET 4) copied into "\addins\myplugin".

MyPlugin.cs:

using System.AddIn;
using AddInView;

namespace MyPlugin
{
   [AddIn("MyPlugin")]
   public class MyPlugin : Arma2NetMethodAddIn
   {
       public string Hello()
       {
           return "Hello world!";
       }
   }
}

Had to add System.Addin manually to the project (Win7 x64) and the modules references in the project (@arma2net\addinview.dll)

_result = call compile ("Arma2Net.Unmanaged" callExtension "MyPlugin [Hello]");
hint _result;

Anything different now?

(PS): Happens on 2.1 too. Stock ARMA (No beta) crashes immediately trying to load ARMA2Net.

Thanks!

Edited by sparcdr
Compiled with VS10, sorry. Meant check your example with testing.

Share this post


Link to post
Share on other sites

I believe that's an old example. AFAIK, System.AddIn has been replaced by the AddInProxy:

using Arma2Net.AddInProxy;

Share this post


Link to post
Share on other sites

firefly2442 is right, the code you borrowed targets an old version. Arma2NET is currently in a transition to a new addin framework I'm writing because System.AddIn was kind of unwieldy.

I've kept the same addin folder structure as before.

Just make sure you have a reference to Arma2Net.AddInProxy.dll. You can remove the reference(s) to Arma2Net.Managed.dll/System.AddIn.dll/AddInView.dll.

The code then becomes:

using Arma2Net.AddInProxy;

namespace MyPlugin
{
   [AddIn("MyPlugin")]
   public class MyPlugin : MethodAddIn
   {
       public string Hello()
       {
           return "Hello world!";
       }
   }
}

Edited by Scott_NZ

Share this post


Link to post
Share on other sites
firefly2442 is right, the code you borrowed targets an old version. Arma2NET is currently in a transition to a new addin framework I'm writing because System.AddIn was kind of unwieldy.

Just make sure you have a reference to Arma2Net.AddInProxy.dll. You can remove the reference(s) to Arma2Net.Managed.dll/System.AddIn.dll/AddInView.dll.

Thanks to both of you, will try when I get off work.

Share this post


Link to post
Share on other sites

Still crashes fwiw, with new addinproxy, references removed.

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

×