-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwrite-api.js
80 lines (63 loc) · 949 Bytes
/
write-api.js
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
// Create League
createLeague({
name: 'ChiHackNight',
start: timestamp,
end: timestamp,
users: ['userid0001', 'userid0021']
})
{
success: true,
leagueid: 'leagueid0008'
}
// Offer Trade
offerTrade({
leagueid: 'leagueid0008',
send: {
userid: 'userid0001',
playerid: 'playerid0032'
},
swap: {
userid: 'userid0021',
playerid: 'playerid0007'
}
})
{
success: true,
tradeid: 'tradeid0005'
}
// Cancel Trade
cancelTrade({
leagueid: 'leagueid0008',
tradeid: 'tradeid0005'
})
{
success: true
}
// Accept Trade
acceptTrade({
leagueid: 'leagueid0008',
tradeid: 'tradeid0005'
})
{
success: true
}
// Move Player (Sit/Start)
movePlayer({
leagueid: 'leagueid0008',
userid: 'userid0021',
sit: 'playerid0032',
start: 'playerid0070'
});
{
success: true
}
// Acquire Player (Add/Drop)
acquirePlayer({
leagueid: 'leagueid0008',
userid: 'userid0021',
add: 'playerid1700',
drop: 'playerid0032'
});
{
success: true
}