Changeset 7474 for code/trunk/src/modules/notifications/Notification.cc
- Timestamp:
- Sep 21, 2010, 11:15:44 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/modules/notifications/Notification.cc
r7463 r7474 42 42 { 43 43 44 CreateUnloadableFactory(Notification);45 46 registerMemberNetworkFunction(Notification, send);47 48 44 /** 49 45 @brief 50 46 Default constructor. Initializes the object. 51 @param creator52 The object that created this Notification53 47 */ 54 Notification::Notification( BaseObject* creator) : BaseObject(creator), Synchronisable(creator)48 Notification::Notification() 55 49 { 56 Register Object(Notification);50 RegisterRootObject(Notification); 57 51 this->initialize(); 58 52 this->registerVariables(); … … 67 61 The message of the Notification. 68 62 */ 69 Notification::Notification( BaseObject* creator, const std::string & message) : BaseObject(creator), Synchronisable(creator)63 Notification::Notification(const std::string & message) 70 64 { 71 Register Object(Notification);65 RegisterRootObject(Notification); 72 66 this->initialize(); 73 67 this->message_ = message; 74 this->registerVariables();75 68 } 76 69 … … 95 88 } 96 89 97 void Notification::registerVariables(void)98 {99 registerVariable(this->message_);100 registerVariable(this->sender_);101 registerVariable(this->sent_);102 }103 104 90 /** 105 91 @brief 106 92 Sends the Notification to the Notificationmanager, which then in turn distributes it to the different NotificationQueues. 107 @param clientId108 The id of the client that this Notification is sent to.109 93 @param sender 110 94 The sender the Notification was sent by. Used by the NotificationManager to distributes the notification to the correct NotificationQueues. … … 112 96 Returns true if successful. 113 97 */ 114 bool Notification::send(unsigned int clientId, const std::string & sender = NotificationManager::NONE) 115 { 116 COUT(0) << "MUP: " << Host::getPlayerID() << "|" << clientId << std::endl; 117 if(GameMode::isStandalone() || Host::getPlayerID() == clientId) 118 { 119 this->sendHelper(sender); 120 } 121 else if(GameMode::isServer()) 122 { 123 callMemberNetworkFunction(Notification, send, this->getObjectID(), clientId, clientId, sender); 124 } 125 126 return true; 127 } 128 129 bool Notification::sendHelper(const std::string& sender) 98 bool Notification::send(const std::string & sender) 130 99 { 131 100 if(this->isSent()) //TODO: Needed?
Note: See TracChangeset
for help on using the changeset viewer.