- Added .at_failed_login(session) to default Player typeclass.
- unloggedin.CmdUnconnectedConnect now calls the at_failed_login hook on player if a correct user is entered by an invalid password provided.
This commit is contained in:
parent
640439dcf5
commit
e0e382e0c6
2 changed files with 12 additions and 0 deletions
|
|
@ -166,6 +166,8 @@ class CmdUnconnectedConnect(MuxCommand):
|
||||||
session.msg(string)
|
session.msg(string)
|
||||||
# this just updates the throttle
|
# this just updates the throttle
|
||||||
_throttle(session, storage=_LATEST_FAILED_LOGINS)
|
_throttle(session, storage=_LATEST_FAILED_LOGINS)
|
||||||
|
# calls player hook for a failed login.
|
||||||
|
player.at_failed_login(session)
|
||||||
return
|
return
|
||||||
|
|
||||||
# Check IP and/or name bans
|
# Check IP and/or name bans
|
||||||
|
|
|
||||||
|
|
@ -677,6 +677,16 @@ class DefaultPlayer(PlayerDB):
|
||||||
# screen. We execute look on the player.
|
# screen. We execute look on the player.
|
||||||
self.execute_cmd("look", sessid=sessid)
|
self.execute_cmd("look", sessid=sessid)
|
||||||
|
|
||||||
|
def at_failed_login(self, session):
|
||||||
|
"""
|
||||||
|
Called by the login process if a user account is targeted correctly
|
||||||
|
but provided with an invalid password. By default it does nothing,
|
||||||
|
but exists to be overriden.
|
||||||
|
|
||||||
|
Args:
|
||||||
|
session (session): Session logging in.
|
||||||
|
"""
|
||||||
|
|
||||||
def at_disconnect(self, reason=None):
|
def at_disconnect(self, reason=None):
|
||||||
"""
|
"""
|
||||||
Called just before user is disconnected.
|
Called just before user is disconnected.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue