Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 10, 2008, 12:05:03 AM (16 years ago)
Author:
landauf
Message:

merged revisions 2111-2170 from objecthierarchy branch back to trunk.

Location:
code/trunk
Files:
2 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/orxonox/objects/infos/CMakeLists.txt

    r2131 r2171  
    11SET( SRC_FILES
    22  Info.cc
    3   Level.cc
    43  PlayerInfo.cc
    54  HumanPlayer.cc
  • code/trunk/src/orxonox/objects/infos/HumanPlayer.cc

    r2087 r2171  
    4646        RegisterObject(HumanPlayer);
    4747
    48         this->server_ready_ = Core::isMaster();
    49         this->client_ready_ = false;
     48        this->server_initialized_ = Core::isMaster();
     49        this->client_initialized_ = false;
    5050
    5151        this->bHumanPlayer_ = true;
     
    6767    void HumanPlayer::registerVariables()
    6868    {
    69         REGISTERSTRING(this->synchronize_nick_, network::direction::toserver, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick));
     69        REGISTERSTRING(this->synchronize_nick_, direction::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_changednick));
    7070
    71         REGISTERDATA(this->clientID_,     network::direction::toclient, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));
    72         REGISTERDATA(this->server_ready_, network::direction::toclient, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_ready));
    73         REGISTERDATA(this->client_ready_, network::direction::toserver, new network::NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_ready));
     71        REGISTERDATA(this->clientID_,     direction::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));
     72        REGISTERDATA(this->server_initialized_, direction::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_initialized));
     73        REGISTERDATA(this->client_initialized_, direction::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_initialized));
    7474    }
    7575
     
    9292    void HumanPlayer::networkcallback_clientIDchanged()
    9393    {
    94         if (this->clientID_ == network::Host::getPlayerID())
     94        if (this->clientID_ == Host::getPlayerID())
    9595        {
    9696            this->bLocalPlayer_ = true;
    9797            this->synchronize_nick_ = this->nick_;
    98             this->client_ready_ = true;
     98            this->client_initialized_ = true;
    9999
    100100            if (!Core::isMaster())
    101                 this->setObjectMode(network::direction::bidirectional);
     101                this->setObjectMode(direction::bidirectional);
    102102            else
    103103                this->setName(this->nick_);
     
    107107    }
    108108
    109     void HumanPlayer::networkcallback_server_ready()
     109    void HumanPlayer::networkcallback_server_initialized()
    110110    {
    111         this->client_ready_ = true;
     111        this->client_initialized_ = true;
    112112    }
    113113
    114     void HumanPlayer::networkcallback_client_ready()
     114    void HumanPlayer::networkcallback_client_initialized()
    115115    {
    116116        if (this->getGametype())
     
    118118    }
    119119
    120     bool HumanPlayer::isReady() const
     120    bool HumanPlayer::isInitialized() const
    121121    {
    122         return (this->server_ready_ && this->client_ready_);
     122        return (this->server_initialized_ && this->client_initialized_);
    123123    }
    124124
    125125    float HumanPlayer::getPing() const
    126126    {
    127         return network::ClientInformation::findClient(this->getClientID())->getRTT();
     127        return ClientInformation::findClient(this->getClientID())->getRTT();
    128128    }
    129129
    130130    float HumanPlayer::getPacketLossRatio() const
    131131    {
    132         return network::ClientInformation::findClient(this->getClientID())->getPacketLoss();
     132        return ClientInformation::findClient(this->getClientID())->getPacketLoss();
    133133    }
    134134
  • code/trunk/src/orxonox/objects/infos/HumanPlayer.h

    r2087 r2171  
    4747            void setConfigValues();
    4848
    49             bool isReady() const;
     49            bool isInitialized() const;
    5050            float getPing() const;
    5151            float getPacketLossRatio() const;
     
    5757            void networkcallback_changednick();
    5858            void networkcallback_clientIDchanged();
    59             void networkcallback_server_ready();
    60             void networkcallback_client_ready();
     59            void networkcallback_server_initialized();
     60            void networkcallback_client_initialized();
    6161
    6262            std::string nick_;
    6363            std::string synchronize_nick_;
    64             bool server_ready_;
    65             bool client_ready_;
     64            bool server_initialized_;
     65            bool client_initialized_;
    6666    };
    6767}
  • code/trunk/src/orxonox/objects/infos/Info.cc

    r2087 r2171  
    3434namespace orxonox
    3535{
    36     Info::Info(BaseObject* creator) : BaseObject(creator), network::Synchronisable(creator)
     36    Info::Info(BaseObject* creator) : BaseObject(creator), Synchronisable(creator)
    3737    {
    3838        RegisterObject(Info);
  • code/trunk/src/orxonox/objects/infos/Info.h

    r2087 r2171  
    3737namespace orxonox
    3838{
    39     class _OrxonoxExport Info : public BaseObject, public network::Synchronisable
     39    class _OrxonoxExport Info : public BaseObject, public Synchronisable
    4040    {
    4141        public:
  • code/trunk/src/orxonox/objects/infos/PlayerInfo.cc

    r2087 r2171  
    4242        RegisterObject(PlayerInfo);
    4343
    44         this->clientID_ = network::CLIENTID_UNKNOWN;
     44        this->clientID_ = CLIENTID_UNKNOWN;
    4545        this->bHumanPlayer_ = false;
    4646        this->bLocalPlayer_ = false;
     
    4848        this->controller_ = 0;
    4949        this->controllableEntity_ = 0;
    50         this->controllableEntityID_ = network::CLIENTID_UNKNOWN;
     50        this->controllableEntityID_ = CLIENTID_UNKNOWN;
    5151
    5252        this->registerVariables();
     
    5555    PlayerInfo::~PlayerInfo()
    5656    {
    57         if (this->isInitialized())
     57        if (this->BaseObject::isInitialized())
    5858        {
    5959            this->stopControl(this->controllableEntity_);
     
    6969    void PlayerInfo::registerVariables()
    7070    {
    71         REGISTERSTRING(this->name_,                 network::direction::toclient, new network::NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
    72         REGISTERDATA  (this->controllableEntityID_, network::direction::toclient, new network::NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
    73         REGISTERDATA  (this->bReadyToSpawn_,        network::direction::toserver);
     71        REGISTERSTRING(this->name_,                 direction::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::changedName));
     72        REGISTERDATA  (this->controllableEntityID_, direction::toclient, new NetworkCallback<PlayerInfo>(this, &PlayerInfo::networkcallback_changedcontrollableentityID));
     73        REGISTERDATA  (this->bReadyToSpawn_,        direction::toserver);
    7474    }
    7575
    7676    void PlayerInfo::changedName()
    7777    {
    78         if (this->isReady() && this->getGametype())
     78        if (this->isInitialized() && this->getGametype())
    7979            this->getGametype()->playerChangedName(this);
    8080    }
     
    8282    void PlayerInfo::changedGametype()
    8383    {
    84         if (this->isReady())
     84        if (this->isInitialized())
    8585        {
    8686            if (this->getOldGametype())
     
    126126        else
    127127        {
    128             this->controllableEntityID_ = network::OBJECTID_UNKNOWN;
     128            this->controllableEntityID_ = OBJECTID_UNKNOWN;
    129129        }
    130130
     
    138138        {
    139139            this->controllableEntity_ = 0;
    140             this->controllableEntityID_ = network::OBJECTID_UNKNOWN;
     140            this->controllableEntityID_ = OBJECTID_UNKNOWN;
    141141
    142142            if (this->controller_)
     
    150150    void PlayerInfo::networkcallback_changedcontrollableentityID()
    151151    {
    152         if (this->controllableEntityID_ != network::OBJECTID_UNKNOWN)
     152        if (this->controllableEntityID_ != OBJECTID_UNKNOWN)
    153153        {
    154154            Synchronisable* temp = Synchronisable::getSynchronisable(this->controllableEntityID_);
  • code/trunk/src/orxonox/objects/infos/PlayerInfo.h

    r2087 r2171  
    5555            inline unsigned int getClientID() const
    5656                { return this->clientID_; }
    57             inline bool isReadyToSpawn() const
    58                 { return this->bReadyToSpawn_; }
    5957
    60             virtual bool isReady() const = 0;
     58            virtual bool isInitialized() const = 0;
    6159            virtual float getPing() const = 0;
    6260            virtual float getPacketLossRatio() const = 0;
     
    6462            inline void setReadyToSpawn(bool bReady)
    6563                { this->bReadyToSpawn_ = bReady; }
     64            inline bool isReadyToSpawn() const
     65                { return this->bReadyToSpawn_; }
    6666
    6767            void startControl(ControllableEntity* entity);
Note: See TracChangeset for help on using the changeset viewer.