Diablo 3 Samples

Cache Settings Sample
D3ServiceClient.CacheSetting = CacheSetting.Default;
D3ServiceClient.CacheSetting = CacheSetting.AlwaysOn;
D3ServiceClient.CacheSetting = CacheSetting.AlwaysOff;
GetProfile
/// Create D3 Service Client
using (D3ServiceClient serviceClient = new D3ServiceClient(Regions.EU, Localizations.de_DE))
{
    /// Request a Profile
    Profile profile = serviceClient.GetProfile("Asesjix", 2766);
}
GetHero
/// Create D3 Service Client
using (D3ServiceClient serviceClient = new D3ServiceClient(Regions.EU, Localizations.de_DE))
{
    /// Request a Hero
    Hero hero = serviceClient.GetHero("Asesjix", 2766, 1655714);
}
GetItemInformation
/// Create D3 Service Client
using (D3ServiceClient serviceClient = new D3ServiceClient(Regions.EU, Localizations.de_DE))
{
    /// Request Item Information
    ItemInformation itemInformation = serviceClient.GetItemInformation("item/CkYI1aeu1wQSBwgEFclhQ7AdbUIXxB3Rw0esHdm8lSMdHxf-9x3_MsVqHee-mnEiCwgAFUhEAwAYJCAKMAk47ANAAFAQYO8DGO345PsJUAJYAA");
}
GetFollowerInformation
/// Create D3 Service Client
using (D3ServiceClient serviceClient = new D3ServiceClient(Regions.EU, Localizations.de_DE))
{
    /// Request Follower Information
    FollowerInformation followerInformation = serviceClient.GetFollowerInformation(FollowerTypes.enchantress);
}
GetArtisanInformation
/// Create D3 Service Client
using (D3ServiceClient serviceClient = new D3ServiceClient(Regions.EU, Localizations.de_DE))
{
    /// Request Artisan Information
    ArtisanInformation artisanInformation = serviceClient.GetArtisanInformation(ArtisanTypes.blacksmith);}
Complete Sample
/// Set Caching Mode
D3ServiceClient.CacheSetting = System.ServiceModel.CacheSetting.AlwaysOn;

/// Create D3 Service Client
using (D3ServiceClient serviceClient = new D3ServiceClient(Regions.EU, Localizations.de_DE))
{
    /// Request a Profile
    Profile profile = serviceClient.GetProfile("Asesjix", 2766);
    /// Request a Hero        
    Hero hero = serviceClient.GetHero("Asesjix", 2766, profile.Heroes[0].Id);
    /// Request Item Information
    ItemInformation itemInformation = serviceClient.GetItemInformation(hero.Items.MainHand.TooltipParams);
    /// Request Follower Information
    FollowerInformation followerInformation = serviceClient.GetFollowerInformation(FollowerTypes.enchantress);
    /// Request Artisan Information
    ArtisanInformation artisanInformation = serviceClient.GetArtisanInformation(ArtisanTypes.blacksmith);
}

Last edited Sep 9, 2012 at 4:27 PM by Asesjixx, version 4

Comments

No comments yet.