def register_user(self, username, password, ip, country):
		good, reason = self.check_ban(ip=ip)
		if not good: return False, 'Banned: %s' % reason
		
		if len(username) > 20: return False, 'Username too long'
		if self._root.censor:
			if not self._root.SayHooks._nasty_word_censor(username):
				return False, 'Name failed to pass profanity filter.'
		
		name = username.lower()
		lanadmin = self._root.lanadmin
		if name == lanadmin['username'].lower() or name in self.accounts:
			return False, 'Username already exists.'
		
		now = int(time.time())
		
		user = User(username, password, 0, False, 'agreement', None, now, ip, now, country, self.last_id+1)
		self.last_id += 1
		self.accounts[name] = user
		self.idToAccount[user.id] = user
		return True, 'Account registered successfully.'
dataset/ETHPy150Open lunixbochs/uberserver/tasserver/LegacyUsers.py/UsersHandler.register_user/original