root/trunk/src/trinitycore/RASocket.h @ 39

Revision 2, 1.9 kB (checked in by yumileroy, 17 years ago)

[svn] * Proper SVN structure

Original author: Neo2003
Date: 2008-10-02 16:23:55-05:00

Line 
1/*
2 * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
17 */
18
19/// \addtogroup mangosd
20/// @{
21/// \file
22
23#ifndef _RASOCKET_H
24#define _RASOCKET_H
25
26#include "Common.h"
27#include "sockets/TcpSocket.h"
28
29#define RA_BUFF_SIZE 1024
30
31class ISocketHandler;
32
33/// Remote Administration socket
34class RASocket: public TcpSocket
35{
36    public:
37
38        RASocket(ISocketHandler& h);
39        ~RASocket();
40
41        void OnAccept();
42        void OnRead();
43
44    private:
45
46        char * buff;
47        std::string szLogin;
48        uint32 iSess;
49        unsigned int iInputLength;
50        bool bLog;
51        bool bSecure;                                       //kick on wrong pass, non exist. user, user with no priv
52        //will protect from DOS, bruteforce attacks
53        //some 'smart' protection must be added for more scurity
54        uint8 iMinLevel;
55        enum
56        {
57            NONE,                                           //initial value
58            LG,                                             //only login was entered
59            OK,                                             //both login and pass were given, and they are correct and user have enough priv.
60        }stage;
61
62        static int zprintf( const char * szText, ... );
63};
64#endif
65/// @}
Note: See TracBrowser for help on using the browser.