DPr00f / steam-api-node

Steam Web Api Integration
MIT License
33 stars 16 forks source link

GetPlayerBans do not return full Steam_Web_API Object #10

Open Mediumwater opened 7 years ago

Mediumwater commented 7 years ago

The Method GetPlayerBans should return:

SteamId (string) CommunityBanned (bool) VACBanned (bool) NumberOfVACBans (int) DaysSinceLastBan (int) NumberOfGameBans (int) EconomyBan (string) like in: https://developer.valvesoftware.com/wiki/Steam_Web_API#GetPlayerBans_.28v1.29

Your Method just returnes: steamId: '', communityBanned: , VACBanned: , numberOfVACBans: , daysSinceLastBan: , economyBan: ''

So without NumberOfGameBans it is not Possible to find out if the Player is banned since today, cause then it says 0 daysSinceLastBan.

Mediumwater commented 7 years ago

Actually solved it:

go into: node_modules/steam-api/steam/containers/player/Bans.js ( steam-api-node/steam/containers/player/Bans.js )

Update the Object like: function Bans(player) { this.steamId = player.SteamId; this.communityBanned = player.CommunityBanned; this.VACBanned = player.VACBanned; this.numberOfVACBans = player.NumberOfVACBans; this.daysSinceLastBan = player.DaysSinceLastBan; this.economyBan = player.EconomyBan; this.numberOfGameBans = player.NumberOfGameBans
}

Now the returned Object by the Method GetPlayerBans containes the value.

var User = new SteamApi.User('steam_api_key'); User.GetPlayerBans(steam_id).done(function(result){ console.log(result); }

willowTank commented 6 years ago

Hello. I would get last 20 vac ban list using Steam API. Please assist me. Thanks