Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 8, 2008, 10:05:06 PM (16 years ago)
Author:
landauf
Message:

respawn of late joined clients works now

Location:
code/branches/objecthierarchy/src/orxonox/objects/infos
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/objects/infos/HumanPlayer.cc

    r2112 r2160  
    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;
     
    7070
    7171        REGISTERDATA(this->clientID_,     direction::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_clientIDchanged));
    72         REGISTERDATA(this->server_ready_, direction::toclient, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_server_ready));
    73         REGISTERDATA(this->client_ready_, direction::toserver, new NetworkCallback<HumanPlayer>(this, &HumanPlayer::networkcallback_client_ready));
     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
     
    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())
     
    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
  • code/branches/objecthierarchy/src/orxonox/objects/infos/HumanPlayer.h

    r2072 r2160  
    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/branches/objecthierarchy/src/orxonox/objects/infos/PlayerInfo.cc

    r2112 r2160  
    5555    PlayerInfo::~PlayerInfo()
    5656    {
    57         if (this->isInitialized())
     57        if (this->BaseObject::isInitialized())
    5858        {
    5959            this->stopControl(this->controllableEntity_);
     
    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())
  • code/branches/objecthierarchy/src/orxonox/objects/infos/PlayerInfo.h

    r2072 r2160  
    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.