[2771] Applied MaNGOS coding style (see trunk/bcpp.cfg).
[mangos-git.git] / src / game / WorldSocket.h
blob755a55f48cce5b80dab5bde69e315b5818659b16
1 /*
2 * Copyright (C) 2005,2006 MaNGOS <http://www.mangosproject.org/>
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.
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.
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
19 #ifndef __WORLDSOCKET_H
20 #define __WORLDSOCKET_H
22 #include "Network/TcpSocket.h"
23 #include "Auth/BigNumber.h"
24 #include "Auth/AuthCrypt.h"
26 class WorldPacket;
27 class SocketHandler;
28 class WorldSession;
30 class WorldSocket : public TcpSocket
32 public:
33 WorldSocket(SocketHandler&);
34 ~WorldSocket();
36 void SendPacket(WorldPacket* packet);
38 void OnAccept();
39 void OnRead();
40 void OnDelete();
42 void Update(time_t diff);
44 protected:
45 void _HandleAuthSession(WorldPacket& recvPacket);
46 void _HandlePing(WorldPacket& recvPacket);
47 void SendAuthWaitQue(uint32 PlayersInQue);
49 static uint32 _GetSeed();
51 private:
52 AuthCrypt _crypt;
53 uint32 _seed;
54 uint32 _cmd;
55 uint16 _remaining;
56 WorldSession* _session;
58 ZThread::LockedQueue<WorldPacket*,ZThread::FastMutex> _sendQueue;
60 #endif