Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/network/src/network/Server.h @ 917

Last change on this file since 917 was 917, checked in by rgrieder, 16 years ago
  • merged all changes in the input branch into this one
  • moved Tickable to core (would have created circular library dependencies)
  • exported OrxListener to a separate file, soon to be deleted
changed
, &&, XOR back to or, and, xor because I found the necessary include file for VC++
  • created abortRequest() in Orxonox.cc to call for a smooth end of the game (an alternative would be to make tick() return a boolean, like it is with frameStarted())
File size: 1.1 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 _Server_H__
14#define _Server_H__
15
16#include <string>
17
18#include "core/Tickable.h"
19
20#include "PacketManager.h"
21#include "NetworkPrereqs.h"
22
23
24
25namespace network
26{
27  /**
28  * This class is the root class of the network module for a server.
29  * It implements all functions necessary for a Server
30  */
31  class _NetworkExport Server : public PacketDecoder, public orxonox::Tickable{
32  public:
33    Server();
34    Server(int port, std::string bindAddress);
35    Server(int port, const char *bindAddress);
36    void open();
37    void close();
38    bool sendMSG(std::string msg);
39    bool sendMSG(const char *msg);
40    void tick(float time);
41  protected:
42    void processQueue();
43    void updateGamestate();
44  private:
45    bool sendGameState();
46    void processAck( ack *data, int clientID);
47    ConnectionManager *connection;
48    GameStateManager *gamestates;
49    PacketGenerator packet_gen;
50
51    ClientInformation *clients;
52  };
53
54
55
56
57}
58
59#endif /* _Server_H__ */
Note: See TracBrowser for help on using the repository browser.