Changeset 7801 for code/trunk/src/libraries/network/Host.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/Host.h
r7284 r7801 31 31 32 32 #include "NetworkPrereqs.h" 33 #include "GamestateManager.h" 33 34 #include "core/CorePrereqs.h" 34 35 … … 49 50 * @author Oliver Scheuss 50 51 */ 51 class _NetworkExport Host{ 52 class _NetworkExport Host: public GamestateManager 53 { 52 54 private: 53 55 //TODO add these functions or adequate 54 56 //virtual bool processChat(packet::Chat *message, unsigned int clientID)=0; 55 57 //virtual bool sendChat(packet::Chat *chat)=0; 56 virtual bool queuePacket(ENetPacket *packet, int clientID)=0;58 virtual void queuePacket(ENetPacket *packet, int clientID, uint8_t channelID)=0; 57 59 virtual bool chat(const std::string& message)=0; 58 60 virtual bool broadcast(const std::string& message)=0; … … 71 73 // static Host* getInstance(){ return instance_; } 72 74 static bool running(){ return instances_s.size(); } 73 static bool addPacket(ENetPacket *packet, int clientID=0);75 static void addPacket(ENetPacket* packet, int clientID = NETWORK_PEER_ID_SERVER, uint8_t channelID = 0); 74 76 //static bool chat(std::string& message); 75 77 // static bool receiveChat(packet::Chat *message, unsigned int clientID); 76 78 static unsigned int getPlayerID(){ return clientID_s; } 77 static unsigned int getShipID(){return shipID_s;}78 79 static void setClientID(unsigned int id){ clientID_s = id; } 79 static void setShipID(unsigned int id){ shipID_s = id; }80 80 static bool isServer(); 81 81 static void Chat(const std::string& message); … … 86 86 private: 87 87 static uint32_t clientID_s; 88 static uint32_t shipID_s;89 88 static std::vector<Host*> instances_s; 90 89 bool bIsActive_;
Note: See TracChangeset
for help on using the changeset viewer.