[Orxonox-commit 2621] r7326 - code/branches/notifications/src/modules/notifications
dafrick at orxonox.net
dafrick at orxonox.net
Thu Sep 2 12:08:16 CEST 2010
Author: dafrick
Date: 2010-09-02 12:08:16 +0200 (Thu, 02 Sep 2010)
New Revision: 7326
Modified:
code/branches/notifications/src/modules/notifications/CMakeLists.txt
code/branches/notifications/src/modules/notifications/Notification.cc
code/branches/notifications/src/modules/notifications/Notification.h
Log:
Some additional changes.
Modified: code/branches/notifications/src/modules/notifications/CMakeLists.txt
===================================================================
--- code/branches/notifications/src/modules/notifications/CMakeLists.txt 2010-09-02 09:23:19 UTC (rev 7325)
+++ code/branches/notifications/src/modules/notifications/CMakeLists.txt 2010-09-02 10:08:16 UTC (rev 7326)
@@ -15,7 +15,6 @@
PCH_FILE
NotificationsPrecompiledHeaders.h
LINK_LIBRARIES
- objects
orxonox
overlays
SOURCE_FILES ${NOTIFICATIONS_SRC_FILES}
Modified: code/branches/notifications/src/modules/notifications/Notification.cc
===================================================================
--- code/branches/notifications/src/modules/notifications/Notification.cc 2010-09-02 09:23:19 UTC (rev 7325)
+++ code/branches/notifications/src/modules/notifications/Notification.cc 2010-09-02 10:08:16 UTC (rev 7326)
@@ -42,7 +42,7 @@
CreateUnloadableFactory(Notification);
- registerMemberNetworkFunction(Notification, send);
+ registerMemberNetworkFunction(Notification, sendHelper);
/**
@brief
@@ -106,24 +106,25 @@
*/
bool Notification::send(unsigned int clientId, const std::string & sender = NotificationManager::NONE)
{
- if(GameMode::isMaster())
- {
- if(this->isSent()) //TODO: Needed?
- return false;
- this->sender_ = sender;
- bool successful = NotificationManager::getInstance().registerNotification(this);
- if(!successful)
- return false;
- this->sent_ = true;
+ callMemberNetworkFunction(Notification, sendHelper, this->getObjectID(), clientId, clientId, sender);
- COUT(3) << "Notification \"" << this->getMessage() << "\" sent." << std::endl;
- }
- else
- {
- callMemberNetworkFunction(Notification, send, this->getObjectID(), clientId, clientId, sender);
- }
+ return true;
+ }
+ bool Notification::sendHelper(unsigned int clientId, const std::string& sender)
+ {
+ if(this->isSent()) //TODO: Needed?
+ return false;
+
+ this->sender_ = sender;
+ bool successful = NotificationManager::getInstance().registerNotification(this);
+ if(!successful)
+ return false;
+ this->sent_ = true;
+
+ COUT(3) << "Notification \"" << this->getMessage() << "\" sent." << std::endl;
+
return true;
}
Modified: code/branches/notifications/src/modules/notifications/Notification.h
===================================================================
--- code/branches/notifications/src/modules/notifications/Notification.h 2010-09-02 09:23:19 UTC (rev 7325)
+++ code/branches/notifications/src/modules/notifications/Notification.h 2010-09-02 10:08:16 UTC (rev 7326)
@@ -57,6 +57,7 @@
virtual ~Notification();
bool send(unsigned int clientId, const std::string & sender); //!< Sends the Notification to the Notificationmanager.
+ bool sendHelper(unsigned int clientId, const std::string& sender);
/**
@brief Checks whether the Notification was sent.
More information about the Orxonox-commit
mailing list