Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/FICN/src/network/Server.h @ 440

Last change on this file since 440 was 440, checked in by scheusso, 16 years ago

added dummyserver3.cc (implements a chatserver, including main)

File size: 1.0 KB
Line 
1//
2// C++ Interface: Server
3//
4// Description:
5//
6//
7// Author:  Oliver Scheuss, (C) 2007
8//
9// Copyright: See COPYING file that comes with this distribution
10//
11//
12
13#ifndef NETWORK_SERVER_H
14#define NETWORK_SERVER_H
15
16#include <string>
17
18#include "ConnectionManager.h"
19#include "PacketManager.h"
20#include "GameStateManager.h"
21#include "enet/enet.h"
22#include "ClientInformation.h"
23
24namespace network{
25
26  /**
27   * This class is the root class of the network module for a server.
28   * It implements all functions necessary for a Server
29   */
30  class Server : PacketDecoder{
31    public:
32    Server();
33    Server(int port, std::string bindAddress);
34    Server(int port, const char *bindAddress);
35    void open();
36    void close();
37    bool sendMSG(std::string msg);
38    bool sendMSG(const char *msg);
39    void tick();
40    protected:
41    void processQueue();
42    void updateGamestate();
43    private:
44    bool sendGameState();
45    ConnectionManager *connection;
46    GameStateManager *gamestates;
47    PacketGenerator packet_gen;
48   
49    ClientInformation *clients;
50  };
51
52
53
54
55
56}
57
58#endif
Note: See TracBrowser for help on using the repository browser.