Skip to content

Commit

Permalink
Improve error messages of policy violations
Browse files Browse the repository at this point in the history
  • Loading branch information
micheljung committed Sep 6, 2018
1 parent cdf44be commit c8f4e19
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions server/lobbyconnection.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,22 +507,28 @@ async def check_policy_conformity(self, player_id, uid_hash, session):
if response.get('result', '') == 'vm':
self._logger.debug("Using VM: %d: %s", player_id, uid_hash)
self.sendJSON(dict(command="notice", style="error",
text="You need to link your account to Steam in order to use FAF in a Virtual Machine. "
"You can contact an admin on the forums."))
text="You need to link your account to Steam in order to use FAF in a virtual machine. "
"Please contact an admin or moderator on the forums if you feel this is a false positive."))
self.send_warning("Your computer seems to be a virtual machine.<br><br>In order to "
"log in from a VM, you have to link your account to Steam: <a href='" +
config.WWW_URL + "/account/link'>" +
config.WWW_URL + "/account/link</a>.<br>If you need an exception, please contact an "
"admin or moderator on the forums", fatal=True)

if response.get('result', '') == 'already_associated':
self._logger.warning("UID hit: %d: %s", player_id, uid_hash)
self.send_warning("Your computer is already associated with another FAF account.<br><br>In order to "
"log in with a new account, you have to link it to Steam: <a href='" +
"log in with an additional account, you have to link it to Steam: <a href='" +
config.WWW_URL + "/account/link'>" +
config.WWW_URL + "/account/link</a>.<br>If you need an exception, please contact an "
"admin on the forums", fatal=True)
"admin or moderator on the forums", fatal=True)
return False

if response.get('result', '') == 'fraudulent':
self._logger.info("Banning player %s for fraudulent looking login.", player_id)
self.send_warning("Fraudulent login attempt detected. As a precautionary measure, your account has been "
"banned permanently. Please contact a moderator if you feel this is a false positive.",
"banned permanently. Please contact an admin or moderator on the forums if you feel this is "
"a false positive.",
fatal=True)

with await db.db_pool as conn:
Expand Down

0 comments on commit c8f4e19

Please sign in to comment.