Skip to content
Boreeas edited this page Aug 15, 2014 · 2 revisions

The login queue is the first step in the authentication process for a server, by using the authkey returned by the queue.

The simplest way to get your key is to invoke the waitInQueueBlocking(username, password) method of LoginQueue:

LoginQueue queue = new LoginQueue(Shard.EUW);
String authToken = queue.waitInQueueBlocking("Username", "password");

If you prefer async calls, waitInQueue(username, password) returns an (already running) QueueTimer, which polls the login queue until you are finished. QueueTimer.isFinished() tells you whether you are through the queue, QueueTimer.getPosition() returns your current position in the queue, and QueueTimer.await() blocks until you are through the queue and then returns the auth token.

QueueTimer timer = queue.waitInQueue("Username", "password");
// some other stuff comes first
String authToken = timer.await();

All of this boils down to use of LoginQueue.getAuthToken(username, password), which will return an AuthResult, telling you whether you are in queue or give you the auth token. If the login fails (for example due to a wrong password), a RequestException will be thrown.

Clone this wiki locally