Changeset 6921 for code/branches/dynamicmatch/src/orxonox/infos
- Timestamp:
- May 17, 2010, 5:01:54 PM (15 years ago)
- Location:
- code/branches/dynamicmatch/src/orxonox/infos
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/dynamicmatch/src/orxonox/infos/GametypeInfo.cc
r5781 r6921 42 42 registerMemberNetworkFunction(GametypeInfo, dispatchKillMessage); 43 43 registerMemberNetworkFunction(GametypeInfo, dispatchDeathMessage); 44 registerMemberNetworkFunction(GametypeInfo, dispatchStaticMessage); 45 registerMemberNetworkFunction(GametypeInfo, dispatchFadingMessage); 44 46 45 47 GametypeInfo::GametypeInfo(BaseObject* creator) : Info(creator) … … 110 112 } 111 113 114 void GametypeInfo::sendStaticMessage(const std::string& message, unsigned int clientID) 115 { 116 if (GameMode::isMaster()) 117 { 118 if (clientID == CLIENTID_SERVER) 119 this->dispatchStaticMessage(message); 120 else 121 callMemberNetworkFunction(GametypeInfo, dispatchStaticMessage, this->getObjectID(), clientID, message); 122 } 123 } 124 125 void GametypeInfo::sendFadingMessage(const std::string& message, unsigned int clientID) 126 { 127 if (GameMode::isMaster()) 128 { 129 if (clientID == CLIENTID_SERVER) 130 this->dispatchFadingMessage(message); 131 else 132 callMemberNetworkFunction(GametypeInfo, dispatchFadingMessage, this->getObjectID(), clientID, message); 133 } 134 } 135 112 136 void GametypeInfo::dispatchAnnounceMessage(const std::string& message) 113 137 { … … 127 151 it->deathmessage(this, message); 128 152 } 153 154 void GametypeInfo::dispatchStaticMessage(const std::string& message) 155 { 156 for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it) 157 it->staticmessage(this, message); 158 } 159 160 void GametypeInfo::dispatchFadingMessage(const std::string& message) 161 { 162 for (ObjectList<GametypeMessageListener>::iterator it = ObjectList<GametypeMessageListener>::begin(); it != ObjectList<GametypeMessageListener>::end(); ++it) 163 it->fadingmessage(this, message); 164 } 129 165 } -
code/branches/dynamicmatch/src/orxonox/infos/GametypeInfo.h
r5781 r6921 64 64 void sendKillMessage(const std::string& message, unsigned int clientID); 65 65 void sendDeathMessage(const std::string& message, unsigned int clientID); 66 void sendStaticMessage(const std::string& message, unsigned int clientID); 67 void sendFadingMessage(const std::string& message, unsigned int clientID); 66 68 67 69 void dispatchAnnounceMessage(const std::string& message); 68 70 void dispatchKillMessage(const std::string& message); 69 71 void dispatchDeathMessage(const std::string& message); 72 void dispatchStaticMessage(const std::string& message); 73 void dispatchFadingMessage(const std::string& message); 70 74 71 75 private:
Note: See TracChangeset
for help on using the changeset viewer.