Arguments password are saved into "client.exe", or the player calls the server with the number to connect, and only server has the password ?
Thank you, I'm curious about how does the game work.
How does work /login ?
In the server's config, the passwords are defined in this manor
The code for the login command (located in commands.py) is
Hope this helps you understand it a bit better.
Code: Select all
They are arrays that can be modified to have as many passwords as you would like. "passwords" : {
"admin" : ["adminpass"],
"moderator" : ["modpass"],
"guard" : ["guardpass"],
"trusted" : ["trustedpass"]
},
The code for the login command (located in commands.py) is
Code: Select all
The passwords are stored on the server in the config. The command /login <password> checks if the password is in the config, and if it is, it will log you in, otherwise, it will decrees your attempt count until you hit 0 or the correct password. If you hit 0, you will be banned.def login(connection, password):
"""
Login as a user type
"""
if connection not in connection.protocol.players:
raise KeyError()
for user_type, passwords in connection.protocol.passwords.iteritems():
if password in passwords:
if user_type in connection.user_types:
return "You're already logged in as %s" % user_type
return connection.on_user_login(user_type, True)
if connection.login_retries is None:
connection.login_retries = connection.protocol.login_retries - 1
else:
connection.login_retries -= 1
if not connection.login_retries:
connection.kick('Ran out of login attempts')
return
return 'Invalid password - you have %s tries left' % (
connection.login_retries)
Hope this helps you understand it a bit better.
Who is online
Users browsing this forum: No registered users and 8 guests