-
Notifications
You must be signed in to change notification settings - Fork 0
/
loginqueue.txt
95 lines (69 loc) · 2.81 KB
/
loginqueue.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
{ "node": 757,
"vcap": 20000,
"rate": 80,
"tickers": [{
"id": 504808,
"node": 755,
"champ": "Katarina",
"current": 504803},
{"id": 502681,
"node": 755,
"champ": "Katarina",
"current": 502680},
{"id": 495640,
"node": 754,
"champ": "Katarina",
"current": 495}
]}
Handler for login queue is wrong
* Mistakes !token as 'no response', but actually is 'in queue'
* It should display that it is in queue, continually retry and update information about the queue
node = login queue ID
champ = Name of login queue
rate = Number of tickets being processed every update
delay = How often the queue updates
id = Our ticket in line
current = Current ticket being processed
So
id - current = Our spot "in line"
Continually send response and check, sleep time = delay, update the ticker
Then continue login process like normal once we retrive a login token.
String champ = result.getString("champ"); // The name of our login queue
int rate = result.getInt("rate"); // How many tickets are processed every queue update
int delay = result.getInt("delay"); // How often the queue status updates
int id = 0;
int cur = 0;
Object[] tickers = result.getArray("tickers");
for (Object o : tickers)
{
TypedObject to = (TypedObject)o;
// Find our queue
int tnode = to.getInt("node");
if (tnode != node)
continue;
id = to.getInt("id"); // Our ticket in line
cur = to.getInt("current"); // The current ticket being processed
// FIXING TIMEOUT (Code from https://github.com/achimala/leaguelib/blob/master/src/com/gvaneyck/rtmp/LoLRTMPSClient.java#L291 )
body = wrapBody(new Object[] { new TypedObject() }, "messagingDestination", 0);
body.type = "flex.messaging.messages.CommandMessage";
headers.put("DSSubtopic", "bc");
body.put("clientId", "bc-" + accountID);
id = invoke(body);
result = getResult(id); // Read result and discard
// cn
headers.put("DSSubtopic", "cn-" + accountID);
body.put("clientId", "cn-" + accountID);
id = invoke(body);
result = getResult(id); // Read result and discard
// gn
headers.put("DSSubtopic", "gn-" + accountID);
body.put("clientId", "gn-" + accountID);
id = invoke(body);
result = getResult(id); // Read result and discard
We must subscribe to these, for it to properly work, we must grab our accountID (maybe grab own accountID, and then subscribe as the last step?)
The entire login process for LoL:
1) Go through LoL's HTTPS api for requesting a queue token. If not processed, you are put into a queue for a queue token.
2) Connect using RTMPS.
3) Once connected, send login packet using the queue token from Step 1 and retrieve an authentication token.
4) Send authentication packet with authentication token
5) Subscribe to BC, CN, GN (I have no idea what these mean, but we need to do it?) to complete the whole process.