Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

extended gamestatehandling for diffed and not diffed gamestates (initial states, etc)

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    private:
41    bool sendGameState();
42    ConnectionManager *connection;
43    GameStateManager *gamestates;
44    PacketGenerator packet_gen;
45   
46    void processQueue();
47    void updateGamestate();
48    ClientInformation *clients;
49  };
50
51
52
53
54
55}
56
57#endif
Note: See TracBrowser for help on using the repository browser.