Changeset 7801 for code/trunk/src/libraries/network/Server.h
- Timestamp:
- Dec 22, 2010, 7:24:24 PM (13 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/libraries/network/Server.h
r7163 r7801 32 32 #include "NetworkPrereqs.h" 33 33 34 #include <deque> 35 34 36 #include "util/UtilPrereqs.h" 35 37 #include "core/CorePrereqs.h" 36 38 #include "Host.h" 37 #include "GamestateManager.h"39 // #include "GamestateManager.h" 38 40 #include "ServerConnection.h" 39 41 #include "LANDiscoverable.h" 42 #include "WANDiscoverable.h" 43 // #include "MasterServerComm.h" 44 // #include "MasterServerProtocol.h" 45 40 46 41 47 namespace orxonox … … 46 52 * It implements all functions necessary for a Server 47 53 */ 48 class _NetworkExport Server : public Host, public ServerConnection, public GamestateManager, public LANDiscoverable{ 54 class _NetworkExport Server : public Host, public ServerConnection, public LANDiscoverable, public WANDiscoverable 55 { 49 56 public: 50 57 Server(); … … 53 60 ~Server(); 54 61 62 /* helpers */ 63 void helper_ConnectToMasterserver(); 64 void helper_HandleMasterServerRequests(); 65 int replyhandler( char *addr, ENetEvent *ev ); 66 55 67 void open(); 56 68 void close(); 57 69 bool processChat(const std::string& message, unsigned int playerID); 58 bool queuePacket(ENetPacket *packet, int clientID); 70 void queuePacket(ENetPacket *packet, int clientID, uint8_t channelID); 71 virtual bool sendPacket( packet::Packet* packet ){ return packet->send( static_cast<Host*>(this) ); } 59 72 void update(const Clock& time); 60 73 unsigned int getRTT(unsigned int clientID); … … 65 78 private: 66 79 virtual bool isServer_(){return true;} 67 unsigned int shipID(){return 0;}68 80 unsigned int playerID(){return 0;} 69 81 70 82 void addPeer(ENetEvent *event); 71 83 void removePeer(ENetEvent *event); 84 void processPacket(packet::Packet* packet); 72 85 73 86 bool createClient(int clientID); 74 87 void disconnectClient( ClientInformation *client); 75 bool processPacket( ENetPacket *packet, ENetPeer *peer ); 76 bool sendGameState(); 88 bool sendGameStates(); 77 89 bool sendObjectDeletes(); 78 90 virtual bool chat(const std::string& message); … … 82 94 83 95 float timeSinceLastUpdate_; 96 std::deque<packet::Packet*> packetQueue_; 84 97 }; 85 98
Note: See TracChangeset
for help on using the changeset viewer.