From: <Blu...@us...> - 2009-12-19 20:59:46
|
Revision: 328 http://virtplayground.svn.sourceforge.net/virtplayground/?rev=328&view=rev Author: BlueWolf_ Date: 2009-12-19 20:59:37 +0000 (Sat, 19 Dec 2009) Log Message: ----------- Login-errors will go through "error" instead of "login". Added some other login-errors in the documentation Modified Paths: -------------- trunk/client/core/callback.py trunk/client/core/parser.py Modified: trunk/client/core/callback.py =================================================================== --- trunk/client/core/callback.py 2009-12-19 20:59:27 UTC (rev 327) +++ trunk/client/core/callback.py 2009-12-19 20:59:37 UTC (rev 328) @@ -135,6 +135,10 @@ reason: The reason why the user could not log in: * "bad login" - The username and/or password is wrong. + * "login not allowed" - You may not log in right now + * "bot limit reached" - There're to much bots logged + in for your account + * "login blocked" - You (or your IP) are blocked """ pass Modified: trunk/client/core/parser.py =================================================================== --- trunk/client/core/parser.py 2009-12-19 20:59:27 UTC (rev 327) +++ trunk/client/core/parser.py 2009-12-19 20:59:37 UTC (rev 328) @@ -62,23 +62,32 @@ def login(self, msg): """ - Called as answer for our login - * succeed - If we logged in - - if succeed is False: - * reason - Why we didn't log in - "bad login" - Username/password incorrect - - if succeed is True: + Called when we can log in * username - The username (with right caps) * cid - The server's connection-id """ - if msg['succeed'] == True: - self.client.username = msg['username'] - self.client.cid = msg['cid'] - - self.callback.logged_in(msg['username'], msg['cid']) + self.client.username = msg['username'] + self.client.cid = msg['cid'] - else: - self.callback.failed_logging_in(msg['reason']) + self.callback.logged_in(msg['username'], msg['cid']) + + def error(self, msg): + """ + Called when we did something wrong! + * reason - What we did wrong + "bad login" - Username/password wrong + "login not allowed" - User may not log in right now + "bot limit reached" - Too much bots logged in for this user + "login blocked" - The user (or IP) is blocked + """ + + if msg['reason'] == "bad login": + self.callback.failed_logging_in("bad login") + elif msg['reason'] == "login not allowed": + self.callback.failed_logging_in("login not allowed") + elif msg['reason'] == "bot limit reached": + self.callback.failed_logging_in("bot limit reached") + elif msg['reason'] == "login blocked": + self.callback.failed_logging_in("login blocked") + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |