Changeset 1907 for code/trunk/src/network/Host.h
- Timestamp:
- Oct 12, 2008, 7:40:47 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/network/Host.h
r1751 r1907 37 37 38 38 /** 39 @author Oliver Scheuss 39 * @brief Base class of Server and Client 40 * This is the Base class of the Server and Client classes 41 * - Makes server and client a singleton 42 * - defines static functions available on both server and client 43 * - is the interface to be used when communicating with the network 44 * @author Oliver Scheuss 40 45 */ 41 46 class Host{ … … 45 50 //virtual bool sendChat(packet::Chat *chat)=0; 46 51 virtual bool queuePacket(ENetPacket *packet, int clientID)=0; 47 virtual unsigned int shipID()=0; 48 virtual int playerID()=0; 52 virtual bool chat(std::string message)=0; 53 virtual bool processChat(std::string message, unsigned int playerID)=0; 54 virtual bool isServer_()=0; 49 55 50 56 … … 54 60 virtual ~Host(); 55 61 static Host *instance_; 56 bool isServer_; 62 unsigned int clientID_; 63 unsigned int shipID_; 57 64 58 65 public: … … 61 68 //static bool chat(std::string& message); 62 69 // static bool receiveChat(packet::Chat *message, unsigned int clientID); 63 static int getPlayerID();70 static unsigned int getPlayerID(); 64 71 static unsigned int getShipID(){return instance_->shipID_;} 65 72 static void setClientID(unsigned int id){ instance_->clientID_ = id; } 66 73 static void setShipID(unsigned int id){ instance_->shipID_ = id; } 67 static bool isServer(){ return instance_->isServer_; } 74 static bool isServer(){ return instance_->isServer_(); } 75 static bool Chat(std::string message); 76 static bool incomingChat(std::string message, unsigned int playerID); 68 77 private: 69 unsigned int clientID_;70 unsigned int shipID_;71 78 }; 72 79
Note: See TracChangeset
for help on using the changeset viewer.