root/trunk/src/trinityrealm/AuthSocket.h @ 102

Revision 102, 2.3 kB (checked in by yumileroy, 17 years ago)

[svn] Fixed copyright notices to comply with GPL.

Original author: w12x
Date: 2008-10-23 03:29:52-05:00

Line 
1/*
2 * Copyright (C) 2005-2008 MaNGOS <http://www.mangosproject.org/>
3 *
4 * Copyright (C) 2008 Trinity <http://www.trinitycore.org/>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21/// \addtogroup realmd
22/// @{
23/// \file
24
25#ifndef _AUTHSOCKET_H
26#define _AUTHSOCKET_H
27
28#include "Common.h"
29#include "Auth/BigNumber.h"
30#include "sockets/TcpSocket.h"
31#include "sockets/SocketHandler.h"
32#include "sockets/ListenSocket.h"
33#include "sockets/Utility.h"
34#include "sockets/Parse.h"
35#include "sockets/Socket.h"
36#include "zthread/Mutex.h"
37
38/// Handle login commands
39class AuthSocket: public TcpSocket
40{
41    public:
42        const static int s_BYTE_SIZE = 32;
43
44        AuthSocket(ISocketHandler& h);
45        ~AuthSocket();
46
47        void OnAccept();
48        void OnRead();
49
50        bool _HandleLogonChallenge();
51        bool _HandleLogonProof();
52        bool _HandleRealmList();
53        //data transfer handle for patch
54
55        bool _HandleXferResume();
56        bool _HandleXferCancel();
57        bool _HandleXferAccept();
58
59        void _SetVSFields(std::string rI);
60
61        FILE *pPatch;
62        ZThread::Mutex patcherLock;
63        bool IsLag();
64
65    private:
66
67        BigNumber N, s, g, v;
68        BigNumber b, B;
69        BigNumber K;
70
71        bool _authed;
72
73        std::string _login;
74        std::string _safelogin;
75       
76       
77        // Since GetLocaleByName() is _NOT_ bijective, we have to store the locale as a string. Otherwise we can't differ
78        // between enUS and enGB, which is important for the patch system
79        std::string _localizationName;
80        uint16 _build;
81        AccountTypes _accountSecurityLevel;
82};
83#endif
84/// @}
Note: See TracBrowser for help on using the browser.