Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 29, 2008, 5:19:02 PM (16 years ago)
Author:
scheusso
Message:

client→server synchronisation of controllable entities works now

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/orxonox/objects/worldentities/ControllableEntity.cc

    r2048 r2062  
    163163            if (!Core::isMaster())
    164164            {
     165                this->client_overwrite_ = this->server_overwrite_;
    165166COUT(0) << "CE: bidirectional synchronization" << std::endl;
    166167                this->setObjectMode(network::direction::bidirectional);
     
    248249    {
    249250        REGISTERSTRING(this->cameraPositionTemplate_, network::direction::toclient);
     251       
     252       
     253        REGISTERDATA(this->client_overwrite_,   network::direction::toserver);
     254        REGISTERDATA(this->server_overwrite_,   network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
    250255
    251256        REGISTERDATA(this->server_position_,    network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerPosition));
     
    253258        REGISTERDATA(this->server_orientation_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processServerOrientation));
    254259
    255         REGISTERDATA(this->server_overwrite_,   network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processOverwrite));
    256260
    257261        REGISTERDATA(this->client_position_,    network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientPosition));
     
    259263        REGISTERDATA(this->client_orientation_, network::direction::toserver, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::processClientOrientation));
    260264
    261         REGISTERDATA(this->client_overwrite_,   network::direction::toserver);
    262265
    263266        REGISTERDATA(this->playerID_, network::direction::toclient, new network::NetworkCallback<ControllableEntity>(this, &ControllableEntity::networkcallback_changedplayerID));
     
    302305            this->server_position_ = this->client_position_;
    303306        }
     307        else
     308          COUT(2) << "callback: not setting client position" << endl;
    304309    }
    305310
     
    453458        else if (this->bControlled_)
    454459        {
    455             this->node_->lookAt(target, relativeTo, localDirectionVector);
     460//             this->node_->lookAt(target, relativeTo, localDirectionVector);
    456461            this->client_orientation_ = this->node_->getOrientation();
    457462        }
Note: See TracChangeset for help on using the changeset viewer.