Ejemplo n.º 1
0
void LLEventNotifier::update()
{
	if (mNotificationTimer.getElapsedTimeF32() > 30.f)
	{
		// Check our notifications again and send out updates
		// if they happen.

		F64 alert_time = LLDate::now().secondsSinceEpoch() + 5 * 60;
		en_map::iterator iter;
		for (iter = mEventNotifications.begin();
			 iter != mEventNotifications.end();)
		{
			LLEventNotification *np = iter->second;

			iter++;
			if (np->getEventDateEpoch() < alert_time)
			{
				LLSD args;
				args["NAME"] = np->getEventName();
				
				args["DATE"] = np->getEventDateStr();
				LLNotificationsUtil::add("EventNotification", args, LLSD(),
					boost::bind(&LLEventNotifier::handleResponse, this, np->getEventID(), _1, _2));
				remove(np->getEventID());
				
			}
		}
		mNotificationTimer.reset();
	}
}
Ejemplo n.º 2
0
//static
void LLEventNotifier::notifyCallback(S32 option, void *user_data)
{
	LLEventNotification *np = (LLEventNotification *)user_data;
	if (!np)
	{
		llwarns << "Event notification callback without data!" << llendl;
		return;
	}
	switch (option)
	{
	case 0:
		gAgent.teleportViaLocation(np->getEventPosGlobal());
		gFloaterWorldMap->trackLocation(np->getEventPosGlobal());
		break;
	case 1:
		gDisplayEventHack = TRUE;
		LLFloaterDirectory::showEvents(np->getEventID());
		break;
	case 2:
		break;
	}

	// We could clean up the notification on the server now if we really wanted to.
}