- Timestamp:
- Sep 2, 2010, 12:08:16 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/notifications/src/modules/notifications/Notification.cc
r7324 r7326 43 43 CreateUnloadableFactory(Notification); 44 44 45 registerMemberNetworkFunction(Notification, send );45 registerMemberNetworkFunction(Notification, sendHelper); 46 46 47 47 /** … … 107 107 bool Notification::send(unsigned int clientId, const std::string & sender = NotificationManager::NONE) 108 108 { 109 if(GameMode::isMaster())110 {111 if(this->isSent()) //TODO: Needed?112 return false;113 109 114 this->sender_ = sender; 115 bool successful = NotificationManager::getInstance().registerNotification(this); 116 if(!successful) 117 return false; 118 this->sent_ = true; 110 callMemberNetworkFunction(Notification, sendHelper, this->getObjectID(), clientId, clientId, sender); 119 111 120 COUT(3) << "Notification \"" << this->getMessage() << "\" sent." << std::endl; 121 } 122 else 123 { 124 callMemberNetworkFunction(Notification, send, this->getObjectID(), clientId, clientId, sender); 125 } 112 return true; 113 } 114 115 bool Notification::sendHelper(unsigned int clientId, const std::string& sender) 116 { 117 if(this->isSent()) //TODO: Needed? 118 return false; 119 120 this->sender_ = sender; 121 bool successful = NotificationManager::getInstance().registerNotification(this); 122 if(!successful) 123 return false; 124 this->sent_ = true; 125 126 COUT(3) << "Notification \"" << this->getMessage() << "\" sent." << std::endl; 126 127 127 128 return true;
Note: See TracChangeset
for help on using the changeset viewer.