These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

[EveLib] A .NET library for EveXML, CREST, EveCentral, and more

First post
Author
Dor Cadmon
New Artisian and Mercenary Association
#161 - 2015-03-16 15:11:45 UTC
thank you so much for helping me with my basic questions. Its easy but not necessarily straight forward the first time. Your contributions are greatly appreciated. I hope I may ask other questions after I've tried to find the answer myself.

ty m8.
Warren DeMartini
Blood Alcohol Content
T O P S H E L F
#162 - 2015-03-17 21:48:26 UTC
Not sure what the problem is. I set either the region or the system (but not both) in the first Select Case, and all the BuyOrders and SellOrders values in response.Result.Item(0) are zero. Here's the code if that will help:


Public Function GetPrice(mat As cMaterial) As Double

        Dim options As New EveCentralOptions() With {.HourLimit = HourLimit, .MinQuantity = MinQuantity}
        options.Items.Add(mat.TypeID) 'add the material's type id
        Dim EveCentral = New EveCentral()

        Select Case ItemType 'this is an enum value; value is property of this class

            Case eSystemType.REGION
                options.Regions.Add(ItemID)
            Case eSystemType.SOLARSYSTEM
                options.System = ItemID

        End Select


        Dim response As EveCentralModule.Models.MarketStatResponse = EveCentral.GetMarketStat(options)

        Select Case TypeTransaction ' this is an enum value; value is property of this class

            Case eTransaction.BUY

                Select Case TypePrice ' this is an enum value; value is property of this class

                    Case ePrice.AVG
                        Return response.Result.Item(0).BuyOrders.Average
                    Case ePrice.MAX
                        Return response.Result.Item(0).BuyOrders.Max
                    Case ePrice.MIN
                        Return response.Result.Item(0).BuyOrders.Min

                End Select

            Case eTransaction.SELL

                Select Case TypePrice

                    Case ePrice.AVG
                        Return response.Result.Item(0).SellOrders.Average
                    Case ePrice.MAX
                        Return response.Result.Item(0).SellOrders.Max
                    Case ePrice.MIN
                        Return response.Result.Item(0).SellOrders.Min

                End Select

        End Select
     
    End Function


Thanks,

--Warren
Icahmura Hasaki
Perkone
Caldari State
#163 - 2015-03-18 00:42:51 UTC
Try it without the HourLimit and MinQuantity. I am pretty sure the marketstat call should be working, unless something has changed recently or there is an issue specific to VB.

Developer of EveLib and EveAuthUtility

Warren DeMartini
Blood Alcohol Content
T O P S H E L F
#164 - 2015-03-23 01:34:58 UTC
Icahmura Hasaki wrote:
Try it without the HourLimit and MinQuantity. I am pretty sure the marketstat call should be working, unless something has changed recently or there is an issue specific to VB.


Yep - that did it. I was passing in 1 hour, 1 Quant. Limit by default. Thanks man!
Chizeru Nakamoto
Doomheim
#165 - 2015-03-25 22:55:46 UTC  |  Edited by: Chizeru Nakamoto
Hi, I had a couple of questions if you have the time. Never worked in C# before, so some of the questions might be, uh...stupid.

1) I'm getting exceptions when trying to retrieve market orders for a region. It seems to be related to how the MarketOrder class extends LinkedEntity{NotImplemented}. Is current market order support not yet implemented or am I just missing something?

2) Nevermind, figured it out.
Space Frenemy
State War Academy
Caldari State
#166 - 2015-04-02 02:18:37 UTC
Chizeru Nakamoto wrote:
Hi, I had a couple of questions if you have the time. Never worked in C# before, so some of the questions might be, uh...stupid.

1) I'm getting exceptions when trying to retrieve market orders for a region. It seems to be related to how the MarketOrder class extends LinkedEntity{NotImplemented}. Is current market order support not yet implemented or am I just missing something?

2) Nevermind, figured it out.

I had the same problem, couldn't figure out what was up. I'm not even sure due to lack of documentation on the CREST side of things whether the market orders are even active on crest-tq? Anyway, I tried repackaging the code myself and applying the appropriate MarketOrderCollection to the output (where it is currently LinkedEntity{NotImplemented}), but that didn't really help me either.

Any ideas, Icahmura?
Icahmura Hasaki
Perkone
Caldari State
#167 - 2015-04-02 13:29:56 UTC
Getting market orders for a region isn't working right now, as I haven't implemented a way to pass the required itemID href as a parameter. I've discussed some possible solutions with some others, and we're working on it. I haven't been spending much time on this lately, but I'll see if I can push some updates during eastern. Anyone is welcome to make improvements and request a pull :)

Developer of EveLib and EveAuthUtility

Rankenn Estemaire
The Scope
Gallente Federation
#168 - 2015-04-04 16:20:01 UTC
Icahmura Hasaki wrote:
Getting market orders for a region isn't working right now, as I haven't implemented a way to pass the required itemID href as a parameter. I've discussed some possible solutions with some others, and we're working on it. I haven't been spending much time on this lately, but I'll see if I can push some updates during eastern. Anyone is welcome to make improvements and request a pull :)


Could that explain why I'm getting weird Station IDs that are way to high?
The highest available station id is 60015151 but I'm getting id back that are in the 61000000 range
Clyde en Marland
White Fang Militia
Fraternity.
#169 - 2015-04-10 13:36:35 UTC
var api = new ZKillboard();
var options = new ZKillboardOptions();
options.Limit = 1;
options.WSpace = true;
try
{
ZkbResponse response = api.GetKills(options);
}
catch (Exception ex)
{
}

This always throws a Newtonsoft.Json.JsonSerializationException "Error converting value \"1\" to type 'System.Boolean'. Path '[0].attackers[0].finalBlow', line 1, position 642." I've dug into it, & it seems that the deserializer should be setting the property "FinalBlowString" of the "ZkbAttacker" object (which then sets the bool "FinalBlow", but something isn't mapping "finalBlow" in the Json to the DataMember "finalBlow" (which is attached to the property "FinalBlowString"). Does anyone else see this, or have any pointers?
Icahmura Hasaki
Perkone
Caldari State
#170 - 2015-04-12 15:34:14 UTC
Renkenn Estemaire: I have no idea whats causing invalid Station IDs.

Clyde en Marland: Should be an easy fix, I'll look at it tomorrow.

Developer of EveLib and EveAuthUtility

Kainar Detremov
The Force Kin
#171 - 2015-06-04 03:42:44 UTC
I'm having a similar issue to Clyde en Marland,

It occurs when calling api.GetKills - this is the stack trace.
Icahmura Hasaki
Perkone
Caldari State
#172 - 2015-06-04 15:47:33 UTC  |  Edited by: Icahmura Hasaki
I pushed a fix to github that hopefully resolves any issues with ZKillboard.

Does any of you have the possibility to test the changes before I push it to Nuget ?

Developer of EveLib and EveAuthUtility

Kainar Detremov
The Force Kin
#173 - 2015-06-05 07:48:16 UTC
Everything appears to be working wonderfully now. Thanks for your time and ongoing support and work on this library - it's fantastic!
Icahmura Hasaki
Perkone
Caldari State
#174 - 2015-06-06 14:42:53 UTC
Thanks for the appreciation! I've pushed this fix to nuget now, along with a fix for the AccountStatus/MultiCharacterTraining issue with EveXML.

Developer of EveLib and EveAuthUtility

Clyde en Marland
White Fang Militia
Fraternity.
#175 - 2015-06-09 07:34:45 UTC
I'm not sure whether you caught this one in your fix, so I'll note it anyway. zKillboard seem to have removed the "X-Bin-Request-Count" & "X-Bin-Max-Requests" headers which results in a problem in ZkbRequestHandler.RequestAsync (lines 76 & 77 by my IDE).

This is awesome work though Big smile
Icahmura Hasaki
Perkone
Caldari State
#176 - 2015-06-09 09:14:34 UTC  |  Edited by: Icahmura Hasaki
I noticed it seemed to be missing in some tests, and thought I fixed that in the latest version. If it's really gone I'll just remove the parts relating to it all together, but it should still be working in the newest version. Thanks for the heads up though :)

Developer of EveLib and EveAuthUtility

KillaGouge
Imperial Shipment
Amarr Empire
#177 - 2015-06-11 21:28:25 UTC
I have been learning C# and this is really fun to use. I am curious if there is a way to take the ItemId that is returned from the GetAssetList method and map that to an actual item name. Would I need a database internal to the project?

Thanks for the great library
Clyde en Marland
White Fang Militia
Fraternity.
#178 - 2015-06-12 10:50:52 UTC
Add a function like this to query the item:

private eZet.EveLib.StaticDataModule.Models.InvType GetItem(int id)
{
var asstObjAccess = new eZet.EveLib.StaticDataModule.EveStaticData();
var assetObj = asstObjAccess.GetInvType(id);

return assetObj;
}

Then do this to call it & have access to the info:

var assList = char1.GetAssetList().Result.Items;
var assetInfo = GetItem(assList.TypeId);
var assetName = assetInfo.Name;
Icahmura Hasaki
Perkone
Caldari State
#179 - 2015-06-12 12:34:13 UTC
Excellent answer Clyde :)

KillaGouge: The StaticDataModule uses element-43.com to retrieve data, each call to var assetObj = asstObjAccess.GetInvType(id); will do a http request, so it might not be suitable for a very large number of items.

I stopped development of that module some time ago in anticipation of CREST, but CREST and the way its been designed/implemented has really put me off, so maybe I'll finish this, or at least a few more endpoints.

Developer of EveLib and EveAuthUtility

KillaGouge
Imperial Shipment
Amarr Empire
#180 - 2015-06-12 13:10:29 UTC
Thank you both Clyde and Icahmura. I will look into the StaticDataModule. Last night while trying to brute force a solution I grabbed the invTypes.xls from fuzzwork and created a stupidly long dictionary and just passed the type ID into a TryGetValue. The performance wasn't nearly as bad as I thought it would be, but going forward I know that is a horrible way of doing things.

Icahmura, if you don't mind me asking what about CREST has put you off? For me, the way that auth CREST works, makes it very hard to develop using it, as I don't yet have a URL to redirect back to as I am just running the project in visual studio on my machine. I don't want to pay for Azure time while I am still learning and developing.

Thanks for all the help.