accounthandler.hpp

Go to the documentation of this file.
00001 /*
00002  *  The Mana World Server
00003  *  Copyright 2004 The Mana World Development Team
00004  *
00005  *  This file is part of The Mana World.
00006  *
00007  *  The Mana World is free software; you can redistribute it and/or modify
00008  *  it under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation; either version 2 of the License, or
00010  *  any later version.
00011  *
00012  *  The Mana World is distributed in the hope that it will be useful,
00013  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  *  GNU General Public License for more details.
00016  *
00017  *  You should have received a copy of the GNU General Public License
00018  *  along with The Mana World; if not, write to the Free Software
00019  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020  *
00021  *  $Id: accounthandler.hpp 3197 2007-03-18 18:10:31Z rogier_polak $
00022  */
00023 
00024 #ifndef _TMWSERV_ACCOUNTHANDLER_H_
00025 #define _TMWSERV_ACCOUNTHANDLER_H_
00026 
00027 #include "net/connectionhandler.hpp"
00028 #include "utils/tokencollector.hpp"
00029 
00030 class AccountClient;
00031 
00040 class AccountHandler : public ConnectionHandler
00041 {
00042     public:
00046         AccountHandler();
00047 
00051         bool
00052         startListen(enet_uint16 port);
00053 
00058         void
00059         tokenMatched(AccountClient *computer, int accountID);
00060 
00065         void
00066         deletePendingClient(AccountClient* computer);
00067 
00072         void
00073         deletePendingConnect(int accountID);
00074 
00079         TokenCollector<AccountHandler, AccountClient*, int>
00080         mTokenCollector;
00081 
00082     protected:
00086         void
00087         processMessage(NetComputer *computer, MessageIn &message);
00088 
00089         NetComputer*
00090         computerConnected(ENetPeer *peer);
00091 
00092         void
00093         computerDisconnected(NetComputer *comp);
00094 
00095         // --- message handling ---
00096 
00097         void
00098         handleLoginMessage(AccountClient &computer, MessageIn &msg);
00099 
00100         void
00101         handleLogoutMessage(AccountClient &computer);
00102 
00103         void
00104         handleReconnectMessage(AccountClient &computer, MessageIn &msg);
00105 
00106         void
00107         handleRegisterMessage(AccountClient &computer, MessageIn &msg);
00108 
00109         void
00110         handleUnregisterMessage(AccountClient &computer, MessageIn &msg);
00111 
00112         void
00113         handleEmailChangeMessage(AccountClient &computer, MessageIn &msg);
00114 
00115         void
00116         handleEmailGetMessage(AccountClient &computer);
00117 
00118         void
00119         handlePasswordChangeMessage(AccountClient &computer, MessageIn &msg);
00120 
00121         void
00122         handleCharacterCreateMessage(AccountClient &computer, MessageIn &msg);
00123 
00124         void
00125         handleCharacterSelectMessage(AccountClient &computer, MessageIn &msg);
00126 
00127         void
00128         handleCharacterDeleteMessage(AccountClient &computer, MessageIn &msg);
00129 };
00130 
00131 extern AccountHandler * accountHandler;
00132 
00133 #endif

Generated on Fri Mar 30 15:39:16 2007 for TMW Server by  doxygen 1.3.9.1