Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def getPlayerInfo(self):
""" This is a simple function to return a bunch of common data about a player. """
JSON = self.JSON
playerInfo = {}
playerInfo['uuid'] = self.UUID
playerInfo['displayName'] = Player.getName(self)
playerInfo['rank'] = Player.getRank(self)
playerInfo['networkLevel'] = Player.getLevel(self)
JSONKeys = ['karma', 'firstLogin', 'lastLogin',
'mcVersionRp', 'networkExp', 'socialMedia', 'prefix']
for item in JSONKeys:
try:
playerInfo[item] = JSON[item]
except KeyError:
pass
return playerInfo