Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 31, 2011, 9:09:23 PM (13 years ago)
Author:
landauf
Message:

Replaced COUT with orxout in network library. Tried to set levels and contexts in a more or less useful way, but not really optimized. Used contexts network, packets, and master_server.
Please use endl instead of \n in the future (@smerkli) ;)

Location:
code/branches/output/src/libraries/network/synchronisable
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/output/src/libraries/network/synchronisable/Synchronisable.cc

    r8706 r8807  
    130130//     assert( !header.isDiffed() );
    131131
    132     COUT(4) << "fabricating object with id: " << header.getObjectID() << std::endl;
     132    orxout(verbose, context::network) << "fabricating object with id: " << header.getObjectID() << endl;
    133133
    134134    Identifier* id = ClassByID(header.getClassID());
     
    136136    {
    137137        for(int i = 0; i<160; i++)
    138             COUT(0) << "classid: " << i << " identifier: " << ClassByID(i) << endl;
    139         COUT(0) << "Assertion failed: id" << std::endl;
    140         COUT(0) << "Possible reason for this error: Client received a synchronizable object whose class has no factory." << std::endl;
     138            orxout(user_error, context::network) << "classid: " << i << " identifier: " << ClassByID(i) << endl;
     139        orxout(user_error, context::network) << "Assertion failed: id" << endl;
     140        orxout(user_error, context::network) << "Possible reason for this error: Client received a synchronizable object whose class has no factory." << endl;
    141141        abort();
    142142    }
     
    168168      bo->setLevel(creator->getLevel());          // Note: this ensures that the level is known on the client for child objects of the scene (and the scene itself)
    169169    //assert(no->classID_ == header.getClassID());
    170     COUT(4) << "fabricate objectID_: " << no->objectID_ << " classID_: " << no->classID_ << std::endl;
     170    orxout(verbose, context::network) << "fabricate objectID_: " << no->objectID_ << " classID_: " << no->classID_ << endl;
    171171          // update data and create object/entity...
    172172    bool b = no->updateData(mem, mode, true);
     
    242242    uint8_t* oldmem = mem;
    243243    if (this->classID_==0)
    244       COUT(3) << "classid 0 " << this->getIdentifier()->getName() << std::endl;
     244      orxout(internal_info, context::network) << "classid 0 " << this->getIdentifier()->getName() << endl;
    245245#endif
    246246
     
    258258    // end copy header
    259259
    260     CCOUT(5) << "getting data from objectID_: " << objectID_ << ", classID_: " << classID_ << std::endl;
    261 //     COUT(4) << "objectid: " << this->objectID_ << ":";
     260    orxout(verbose_more, context::network) << "getting data from objectID_: " << objectID_ << ", classID_: " << classID_ << endl;
     261//     orxout(verbose, context::network) << "objectid: " << this->objectID_ << ":";
    262262    // copy to location
    263263    for(i=syncList_.begin(); i!=syncList_.end(); ++i)
    264264    {
    265265      uint32_t varsize = (*i)->getData( mem, mode );
    266 //       COUT(4) << " " << varsize;
     266//       orxout(verbose, context::network) << " " << varsize;
    267267      tempsize += varsize;
    268268      sizes.push_back(varsize);
     
    271271    }
    272272    assert(tempsize!=0);  // if this happens an empty object (with no variables) would be transmitted
    273 //     COUT(4) << endl;
     273//     orxout(verbose, context::network) << endl;
    274274
    275275    header.setObjectID( this->objectID_ );
     
    305305    if(syncList_.empty())
    306306    {
     307      orxout(internal_warning, context::network) << "Synchronisable::updateData syncList_ is empty" << endl;
    307308      assert(0);
    308       COUT(2) << "Synchronisable::updateData syncList_ is empty" << std::endl;
    309309      return false;
    310310    }
     
    326326    }
    327327
    328     //COUT(5) << "Synchronisable: objectID_ " << syncHeader.getObjectID() << ", classID_ " << syncHeader.getClassID() << " size: " << syncHeader.getDataSize() << " synchronising data" << std::endl;
     328    //orxout(verbose_more, context::network) << "Synchronisable: objectID_ " << syncHeader.getObjectID() << ", classID_ " << syncHeader.getClassID() << " size: " << syncHeader.getDataSize() << " synchronising data" << endl;
    329329    if( !syncHeaderLight.isDiffed() )
    330330    {
     
    344344    {
    345345      mem += SynchronisableHeaderLight::getSize();
    346 //       COUT(0) << "objectID: " << this->objectID_ << endl;
     346//       orxout(debug_output, context::network) << "objectID: " << this->objectID_ << endl;
    347347      while( mem < data+syncHeaderLight.getDataSize()+SynchronisableHeaderLight::getSize() )
    348348      {
    349349        VariableID varID = *(VariableID*)mem;
    350 //         COUT(0) << "varID: " << varID << endl;
     350//         orxout(debug_output, context::network) << "varID: " << varID << endl;
    351351        assert( varID < syncList_.size() );
    352352        mem += sizeof(VariableID);
  • code/branches/output/src/libraries/network/synchronisable/Synchronisable.h

    r8706 r8807  
    232232        it++;
    233233    }
    234     COUT(1) << "Tried to unregister not registered variable" << endl;
     234    orxout(internal_error, context::network) << "Tried to unregister not registered variable" << endl;
    235235    assert(false); //if we reach this point something went wrong:
    236236    // the variable has not been registered before
  • code/branches/output/src/libraries/network/synchronisable/SynchronisableVariable.h

    r7266 r8807  
    202202        if ( *static_cast<uint8_t*>(mem) != this->varReference_ )
    203203        { // wrong reference number, so discard the data
    204 //           COUT(0) << "discharding data" << endl;
     204//           orxout(debug_output, context::network) << "discharding data" << endl;
    205205          mem += getSize( mode ); // SynchronisableVariableBidirectional::getSize returns size of variable + reference
    206206          return;
Note: See TracChangeset for help on using the changeset viewer.