Setting Up Your Application

Once you have included LibWowAPI in your project, you need to setup a few things in your application before you begin. All of these are optional, but can give your application added benefits or functionality.

Internationalization

LibWowAPI defaults to using the US region and US English as the language. You can change this in your initialization routine. For instance, here's how you would set it in a console application.
C#
using roncliProductions.LibWowAPI;
using roncliProductions.LibWowAPI.Internationalization;

class ConsoleApplication {
    void Main() {
        WowAPIData.Region = Region.Europe;
        WowAPIData.Language = Language.Français;
    }
}
VB.Net
Imports roncliProductions.LibWowAPI
Imports roncliProductions.LibWowAPI.Internationalization

Module ConsoleApplication
    Sub Main()
        WowAPIData.Region = Region.Europe
        WowAPIData.Language = Language.Français
    End Sub
End Module

Authentication

If Blizzard has provided you with a public-private key pair, you can also include this in your initialization routine.

C#
using roncliProductions.LibWowAPI;

class ConsoleApplication {
    void Main() {
        WowAPIData.PublicKey = "ABCDEFGHIJKL";
        WowAPIData.PrivateKey = "MNOPQRSTUVWX";
    }
}
VB.Net
Imports roncliProductions.LibWowAPI

Module ConsoleApplication
    Sub Main()
        WowAPIData.PublicKey = "ABCDEFGHIJKL"
        WowAPIData.PrivateKey = "MNOPQRSTUVWX"
    End Sub
End Module

Metadata

LibWowAPI provides a way to identify your HTTP request using headers. This, too, is added in your initialization routine.
C#
using roncliProductions.LibWowAPI;

class ConsoleApplication {
    void Main() {
        WowAPIData.Application = "My WoW Application";
        WowAPIData.ApplicationURL = "http://www.mywowapplication.com";
    }
}
VB.Net
Imports roncliProductions.LibWowAPI

Module ConsoleApplication
    Sub Main()
        WowAPIData.Application = "My WoW Application"
        WowAPIData.ApplicationURL = "http://www.mywowapplication.com"
    End Sub
End Module

Last edited Aug 23, 2011 at 4:34 PM by roncli, version 1

Comments

No comments yet.