Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 21, 2010, 11:15:44 PM (14 years ago)
Author:
dafrick
Message:

Synchronizing Notifications.
In the course of that, notifications are not longer sent by creating a Notification and the calling notification.send() bur by letting the NotificationManager handle all this: NotificationManager::getInstance().sendNotification(message)
This made QuestNotification obsolete, thus it was removde.

Also did some work on synchronizing the Script class. It should work properly most of the time, but the current solution is unreliable and unsatisfactory. So this will change as soon as I know how.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/modules/notifications/NotificationManager.cc

    r7417 r7474  
    3838#include "core/GUIManager.h"
    3939#include "core/LuaState.h"
     40#include "network/Host.h"
     41#include "network/NetworkFunction.h"
    4042#include "util/ScopedSingletonManager.h"
    4143
     
    5961
    6062    SetConsoleCommand("enterEditMode", &NotificationManager::enterEditMode);
     63
     64    registerStaticNetworkFunction(NotificationManager::sendNotification);
    6165
    6266    /**
     
    100104        }
    101105        this->queues_.clear();
     106    }
     107
     108    /*static*/ void NotificationManager::sendNotification(const std::string& message, unsigned int clientId, const std::string& sender)
     109    {
     110        if(GameMode::isStandalone() || Host::getPlayerID() == clientId)
     111        {
     112            Notification* notification = new Notification(message);
     113            notification->send(sender);
     114        }
     115        else if(GameMode::isServer())
     116        {
     117            callStaticNetworkFunction(NotificationManager::sendNotification, clientId, message, clientId, sender);
     118        }
    102119    }
    103120
Note: See TracChangeset for help on using the changeset viewer.