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
ConstructorDescriptionLoginCommand(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 boolean
accountStatusCheck(DBTransaction transaction)
protected boolean
blockCheck(DBTransaction transaction)
protected boolean
credentialsCheck(DBTransaction transaction)
void
execute(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 void
processSuccessfulLogin(DBTransaction transaction)
toString()
returns a string suitable for debug output of this DBCommand.protected boolean
verify(DBTransaction transaction)
verifies credentials against the databaseMethods inherited from class marauroa.server.game.dbcommand.DBCommandWithCallback
getChannel, getClientid, getProtocolVersion, invokeCallback
Methods 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:AbstractDBCommand
processes the database request.- Specified by:
execute
in interfaceDBCommand
- Specified by:
execute
in 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:
SQLException
IOException
-
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
null
in case the login did not fail (was succesful).
-
getFailMessage
gets the message if the login failed- Returns:
- error message or
null
in 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.
-