mirror of
https://github.com/DoctorMcKay/node-steamcommunity.git
synced 2024-12-29 08:00:12 +08:00
Added public static CSteamUser.getAvatarURL method
This commit is contained in:
parent
e01d05c140
commit
1aa42b89f7
@ -91,11 +91,11 @@ function CSteamUser(community, userData, customurl) {
|
||||
}
|
||||
}
|
||||
|
||||
CSteamUser.prototype.getAvatarURL = function(size, protocol) {
|
||||
CSteamUser.getAvatarURL = function(hash, size, protocol) {
|
||||
size = size || '';
|
||||
protocol = protocol || 'http://';
|
||||
|
||||
var url = protocol + "steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/" + this.avatarHash.substring(0, 2) + "/" + this.avatarHash;
|
||||
var url = protocol + "steamcdn-a.akamaihd.net/steamcommunity/public/images/avatars/" + hash.substring(0, 2) + "/" + hash;
|
||||
if(size == 'full' || size == 'medium') {
|
||||
return url + "_" + size + ".jpg";
|
||||
} else {
|
||||
@ -103,6 +103,10 @@ CSteamUser.prototype.getAvatarURL = function(size, protocol) {
|
||||
}
|
||||
};
|
||||
|
||||
CSteamUser.prototype.getAvatarURL = function(size, protocol) {
|
||||
return CSteamUser.getAvatarURL(this.avatarHash, size, protocol);
|
||||
};
|
||||
|
||||
CSteamUser.prototype.addFriend = function(callback) {
|
||||
this._community.request.post('https://steamcommunity.com/actions/AddFriendAjax', {"form": {"accept_invite": 0, "sessionID": this._community.getSessionID(), "steamid": this.steamID.toString()}}, function(err, response, body) {
|
||||
if(!callback) {
|
||||
|
Loading…
Reference in New Issue
Block a user