rconService.getUsers() will get and parse the userdata

PlayerInfo displays Info and provide a link to steam profile
Dropdown in the Playerlist offers more options the selected Player
This commit is contained in:
alexfriesen
2016-05-18 14:10:03 +02:00
parent 7a6a1e13fc
commit 172ee95216
5 changed files with 107 additions and 10 deletions
+32
View File
@@ -4,4 +4,36 @@ app.controller( 'PlayerInfoController', PlayerInfoController );
function PlayerInfoController( $scope, rconService, $routeParams )
{
$scope.userid = $routeParams.userid;
$scope.info = null;
$scope.refresh = function ()
{
rconService.getUsers($scope, function(users) {
for(var i in users) {
if(users[i].SteamID === $scope.userid){
// set player data
$scope.info = users[i];
return;
}
}
// info not found
$scope.info = null;
});
}
$scope.getUsername = function ()
{
if($scope.info && $scope.info.DisplayName) {
return $scope.info.DisplayName;
}
return $scope.userid;
}
rconService.InstallService( $scope, $scope.refresh )
}