def __makeAccountsData(self, accounts): result = [] isPlayerSpeaking = self.app.voiceChatManager.isPlayerSpeaking accounts = sorted(accounts, cmp=getPlayersComparator()) getUser = self.usersStorage.getUser for account in accounts: vContourIcon = '' vShortName = '' vLevel = '' dbID = account.dbID user = getUser(dbID) if account.isVehicleSpecified(): vehicle = account.getVehicle() vContourIcon = vehicle.iconContour vShortName = vehicle.shortUserName vLevel = int2roman(vehicle.level) result.append({'accID': account.accID, 'uid': account.dbID, 'userName': account.name, 'fullName': account.getFullName(), 'himself': account.isCurrentPlayer(), 'stateString': formatters.getPlayerStateString(account.state), 'icon': vContourIcon, 'vShortName': vShortName, 'vLevel': vLevel, 'chatRoster': user.getRoster() if user else 0, 'isPlayerSpeaking': bool(isPlayerSpeaking(account.dbID))}) return result
def _makeAccountsData(self, accounts): result = [] isPlayerSpeaking = self.app.voiceChatManager.isPlayerSpeaking getUser = self.usersStorage.getUser getColors = g_settings.getColorScheme('rosters').getColors accounts = sorted(accounts, cmp=info.getPlayersComparator()) for account in accounts: vContourIcon = '' vShortName = '' vLevel = '' vType = '' user = getUser(account.dbID) if user is not None: key = user.getGuiType() else: key = USER_GUI_TYPE.OTHER if account.isVehicleSpecified(): vehicle = account.getVehicle() vContourIcon = vehicle.iconContour vShortName = vehicle.shortUserName vLevel = int2roman(vehicle.level) vType = vehicle.type result.append({'accID': account.accID, 'uid': account.dbID, 'userName': account.name, 'fullName': account.getFullName(), 'time': account.time, 'himself': account.isCurrentPlayer(), 'isCreator': account.isCreator, 'state': account.state, 'icon': vContourIcon, 'vShortName': vShortName, 'vLevel': vLevel, 'vType': vType, 'chatRoster': user.getRoster() if user else 0, 'isPlayerSpeaking': isPlayerSpeaking(account.dbID), 'colors': getColors(key)}) return result