Problems with .Net wrapper
I've been beating my head against the wall for hours trying to figure out how to use the wrapper. Some things work fine, and others inexplicably crash. I used the examples in the svn to figure out how to use Me(), and can read my name, get basic info, etc using Me. But I crash every time when trying to change anything with it. Me.StackAllHangarItems(), for example, or Me.OpenCorpHangar(), or ClearMarketOrderCache(); all of these I've been using as basic tests, and they crash every time, no matter how I declare Me, where I declare it, whatever. Even the sample from the SVN repository crashes upon trying to undock.
Here's a sample of a test script I've been trying:
I know it's a mess, I'm assigning values to Me in like six different spots. I've tried so many different things trying to get it to work that it's all over the place, and I'm losing track of what goes where. But most of the various ways I've tried to define Me should work the same, I've tried each of them individually, and they all have the same result:
I've been beating my head against the wall for hours trying to figure out how to use the wrapper. Some things work fine, and others inexplicably crash. I used the examples in the svn to figure out how to use Me(), and can read my name, get basic info, etc using Me. But I crash every time when trying to change anything with it. Me.StackAllHangarItems(), for example, or Me.OpenCorpHangar(), or ClearMarketOrderCache(); all of these I've been using as basic tests, and they crash every time, no matter how I declare Me, where I declare it, whatever. Even the sample from the SVN repository crashes upon trying to undock.
Here's a sample of a test script I've been trying:
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;
using System.IO;
using System.Threading;
using DirectEve;
using EVE.ISXEVE;
using LavishVMAPI;
using InnerSpaceAPI;
using LavishScriptAPI;
namespace MarketWrapper
{
public class MarketInfo
{
public Extension Extension { get; private set; }
public Character Me { get; private set; }
public EVE.ISXEVE.EVE Eve { get; private set; }
public List<MyOrder> GetMyMarketOrders()
{
//LavishScript.Events.AttachEventTarget((LavishScript.Events.RegisterEvent("ISXEVE_onFrame")), OnFrame);
LavishScript.Events.AttachEventTarget("ISXEVE_onFrame", OnFrame);
using (new FrameLock(true))
{
//Extension = new Extension();
//Me = Extension.Me;
//Eve = Extension.EVE();
Me = new Character();
Me.UpdateMyOrders();
Thread.Sleep(100);
List<MyOrder> myOrders = Me.GetMyOrders();
Globals.Instance.Me.StackAllHangarItems();
return myOrders;
}
}
void OnFrame(object sender, LSEventArgs e)
{
// update the reference each frame
Me = new Me();
}
}
public sealed class Globals
{
public static readonly Globals Instance = new Globals();
public EVE.ISXEVE.Extension Ext = new EVE.ISXEVE.Extension();
public EVE.ISXEVE.Me Me = new EVE.ISXEVE.Me();
public EVE.ISXEVE.EVE Eve = new EVE.ISXEVE.EVE();
private Globals() { }
}
}
What am I doing wrong?Software: Inner Space Kernel 1.11 Build 5395 (Sun Mar 06 13:35:49 2011)
Crash: 0x1E0B1CE7: Exception 0xc00000fd in module python27.dll
Additional information: .NET PersistentExecuteMethod StackAllHangarItems
Last edited: