Planeshift
psAuthenticationClient Class Reference

Handles Authentication details from the client to the server. More...

#include <authentclient.h>

Public Member Functions

bool Authenticate (const csString &user, const csString &pwd, const csString &pwd256)
 Send a message to the server to login. More...
 
const char * GetRejectMessage ()
 Return the reason ( if any ) for a client to be rejected. More...
 
virtual void HandleMessage (MsgEntry *mh)
 Handle incomming messages based on the subscribed types. More...
 
 psAuthenticationClient (MsgHandler *myMsgQueue)
 
void Reset (void)
 Clear the status of the login attempt. More...
 
int Status (void)
 Get the current status of authentication. More...
 
virtual ~psAuthenticationClient ()
 
- Public Member Functions inherited from psClientNetSubscriber
virtual void HandleMessage (MsgEntry *msg, Client *)
 Interprets a received message and executes the command. More...
 
virtual bool Verify (MsgEntry *, unsigned int, Client *&)
 
virtual ~psClientNetSubscriber ()
 

Protected Attributes

int iClientApproved
 
csRef< MsgHandlermsghandler
 
csString password
 
csString password256
 
csString rejectmsg
 
csString username
 

Detailed Description

Handles Authentication details from the client to the server.

The basic role of the authentication client is to handle the login/logout functions on the client. When it is created it will subscribe to these types of messages:

  • MSGTYPE_AUTHAPPROVE
  • MSGTYPE_AUTHREJECTED
  • MSGTYPE_PREAUTHAPPROVED
  • MSGTYPE_DISCONNECT
  • MSGTYPE_AUTHCHARACTERAPPROVED

This class will also handle disconnect messages from other clients/entities. Thus when other players disconnect or move out of range this class will be responsible for removing them from this client.

Definition at line 80 of file authentclient.h.

Constructor & Destructor Documentation

psAuthenticationClient::psAuthenticationClient ( MsgHandler myMsgQueue)
virtual psAuthenticationClient::~psAuthenticationClient ( )
virtual

Member Function Documentation

bool psAuthenticationClient::Authenticate ( const csString &  user,
const csString &  pwd,
const csString &  pwd256 
)

Send a message to the server to login.

Parameters
userThe account name
pwdThe account password
pwd256The account password
Returns
Always true.
const char* psAuthenticationClient::GetRejectMessage ( )

Return the reason ( if any ) for a client to be rejected.

virtual void psAuthenticationClient::HandleMessage ( MsgEntry mh)
virtual

Handle incomming messages based on the subscribed types.

Implements psClientNetSubscriber.

void psAuthenticationClient::Reset ( void  )
inline

Clear the status of the login attempt.

Definition at line 126 of file authentclient.h.

int psAuthenticationClient::Status ( void  )
inline

Get the current status of authentication.

Possible return values are:

  • NO_RESPONSE
  • APPROVED
  • REJECTED

Definition at line 118 of file authentclient.h.

Member Data Documentation

int psAuthenticationClient::iClientApproved
protected

Definition at line 134 of file authentclient.h.

csRef<MsgHandler> psAuthenticationClient::msghandler
protected

Definition at line 129 of file authentclient.h.

csString psAuthenticationClient::password
protected

Definition at line 135 of file authentclient.h.

csString psAuthenticationClient::password256
protected

Definition at line 136 of file authentclient.h.

csString psAuthenticationClient::rejectmsg
protected

Definition at line 133 of file authentclient.h.

csString psAuthenticationClient::username
protected

Definition at line 137 of file authentclient.h.


The documentation for this class was generated from the following file: