Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 19, 2008, 1:36:13 AM (16 years ago)
Author:
landauf
Message:

added option "forceCallback" to updateData(…) in Synchronisable to get a callback when synchronizing a variable for the first time (even if it didn't changed)

File:
1 edited

Legend:

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

    r1943 r1945  
    7373    }
    7474
     75    void PlayerInfo::checkName()
     76    {
     77std::cout << "# PlayerInfo: checkName: " << this->bLocalPlayer_ << std::endl;
     78        if (this->bLocalPlayer_)
     79            this->setName(this->playerName_);
     80    }
     81
    7582    void PlayerInfo::registerVariables()
    7683    {
     
    8491    }
    8592
    86     void PlayerInfo::checkName()
    87     {
    88         if (this->bLocalPlayer_)
    89             this->setName(this->playerName_);
    90     }
    91 
    9293    void PlayerInfo::checkClientID()
    9394    {
     95std::cout << "# PlayerInfo: checkClientID" << std::endl;
    9496        this->bHumanPlayer_ = true;
    9597
    9698        if (this->clientID_ == network::Host::getPlayerID())
    9799        {
     100std::cout << "#             it's the client's ID" << std::endl;
    98101            this->bLocalPlayer_ = true;
    99102            this->setName(this->playerName_);
     103std::cout << "#             " << this->getName() << std::endl;
    100104
    101105            if (!Settings::isClient())
    102106            {
     107std::cout << "#             not client: finish setup" << std::endl;
    103108                this->bFinishedSetup_ = true;
    104109                this->finishedSetup();
     
    109114    void PlayerInfo::finishedSetup()
    110115    {
     116std::cout << "# PlayerInfo: finishedSetup: " << this->bFinishedSetup_ << std::endl;
    111117        if (Settings::isClient())
     118        {
     119std::cout << "#             client: set to true" << std::endl;
    112120            this->bFinishedSetup_ = true;
     121        }
    113122        else if (this->bFinishedSetup_)
    114123        {
     124std::cout << "#             not client but finished: add player" << std::endl;
    115125            Gametype* gametype = Gametype::getCurrentGametype();
    116126            if (gametype)
    117127                gametype->addPlayer(this);
    118128        }
     129        else
     130        {
     131std::cout << "#             not client and not finished" << std::endl;
     132        }
    119133    }
    120134}
Note: See TracChangeset for help on using the changeset viewer.