Package marauroa.server.game.dbcommand
Class LoginCommand
java.lang.Object
marauroa.server.db.command.AbstractDBCommand
marauroa.server.game.dbcommand.DBCommandWithCallback
marauroa.server.game.dbcommand.LoginCommand
- All Implemented Interfaces:
DBCommand
verifies the login using the database
-
Field Summary
Fields inherited from class marauroa.server.game.dbcommand.DBCommandWithCallback
callback -
Constructor Summary
ConstructorsConstructorDescriptionLoginCommand(SecuredLoginInfo info)creates a new LoginCommandLoginCommand(SecuredLoginInfo info, DelayedEventHandler callback, int clientid, Channel channel, int protocolVersion)creates a new LoginCommand. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanaccountStatusCheck(DBTransaction transaction)protected booleanblockCheck(DBTransaction transaction)protected booleancredentialsCheck(DBTransaction transaction)voidexecute(DBTransaction transaction)processes the database request.gets the message if the login failedgets the Reason enum if the login failedgetInfo()gets the SecuredLoginInfo objectgets a list of previous logins so that the player can notice possible account hacks.protected voidprocessSuccessfulLogin(DBTransaction transaction)toString()returns a string suitable for debug output of this DBCommand.protected booleanverify(DBTransaction transaction)verifies credentials against the databaseMethods inherited from class marauroa.server.game.dbcommand.DBCommandWithCallback
getChannel, getClientid, getProtocolVersion, invokeCallbackMethods inherited from class marauroa.server.db.command.AbstractDBCommand
getEnqueueTime, getException, setEnqueueTime, setException
-
Constructor Details
-
LoginCommand
creates a new LoginCommand- Parameters:
info- SecuredLoginInfo
-
LoginCommand
public LoginCommand(SecuredLoginInfo info, DelayedEventHandler callback, int clientid, Channel channel, int protocolVersion)creates a new LoginCommand.- Parameters:
info- SecuredLoginInfocallback- DelayedEventHandlerclientid- optional parameter available to the callbackchannel- optional parameter available to the callbackprotocolVersion- protocolVersion
-
-
Method Details
-
execute
Description copied from class:AbstractDBCommandprocesses the database request.- Specified by:
executein interfaceDBCommand- Specified by:
executein classAbstractDBCommand- Parameters:
transaction- DBTransaction- Throws:
SQLException- in case of an database errorIOException- in case of an input/output error
-
blockCheck
- Throws:
SQLException
-
verify
verifies credentials against the database- Parameters:
transaction- DBTransaction- Returns:
- verification result
- Throws:
SQLException- in case of a database errorIOException- in case of an input/output error
-
credentialsCheck
- Throws:
SQLExceptionIOException
-
accountStatusCheck
- Throws:
SQLException
-
processSuccessfulLogin
- Throws:
SQLException
-
getInfo
gets the SecuredLoginInfo object- Returns:
- SecuredLoginInfo
-
getFailReason
gets the Reason enum if the login failed- Returns:
- MessageS2CLoginNACK.Reasons or
nullin case the login did not fail (was succesful).
-
getFailMessage
gets the message if the login failed- Returns:
- error message or
nullin case the login did not fail (was succesful).
-
getPreviousLogins
gets a list of previous logins so that the player can notice possible account hacks.- Returns:
- list of last logins
-
toString
returns a string suitable for debug output of this DBCommand.
-