mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-05-14 08:20:43 -05:00
Optimize bandwidth usage of updateChallenges
This commit is contained in:
parent
70ea1533a4
commit
d5b528dbcc
11
users.js
11
users.js
|
|
@ -1142,9 +1142,16 @@ var User = (function () {
|
|||
}
|
||||
};
|
||||
User.prototype.updateChallenges = function() {
|
||||
var challengeTo = this.challengeTo;
|
||||
if (challengeTo) {
|
||||
challengeTo = {
|
||||
to: challengeTo.to,
|
||||
format: challengeTo.format
|
||||
}
|
||||
}
|
||||
this.send('|updatechallenges|'+JSON.stringify({
|
||||
challengesFrom: this.challengesFrom,
|
||||
challengeTo: this.challengeTo
|
||||
challengesFrom: Object.map(this.challengesFrom, 'format'),
|
||||
challengeTo: challengeTo
|
||||
}));
|
||||
};
|
||||
User.prototype.makeChallenge = function(user, format/*, isPrivate*/) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user