Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8807 for code/branches


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
Files:
26 edited

Legend:

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

    r7163 r8807  
    4040      //unsigned int senderID )
    4141    //{
    42       //COUT(0) << "Chat: \"" << message << "\"\n";
     42      //orxout(message) << "Chat: \"" << message << "\"" << endl;
    4343
    4444
  • code/branches/output/src/libraries/network/Client.cc

    r8788 r8807  
    118118  bool Client::processChat(const std::string& message, unsigned int playerID)
    119119  {
    120 //    COUT(1) << "Player " << playerID << ": " << message << std::endl;
     120//    orxout(message) << "Player " << playerID << ": " << message << endl;
    121121    return true;
    122122  }
     
    124124  void Client::printRTT()
    125125  {
    126     COUT(0) << "Round trip time to server is " << ClientConnection::getRTT() << " ms" << endl;
     126    orxout(message) << "Round trip time to server is " << ClientConnection::getRTT() << " ms" << endl;
    127127  }
    128128
     
    150150    {
    151151      timeSinceLastUpdate_ -= static_cast<unsigned int>( timeSinceLastUpdate_ / NETWORK_PERIOD ) * NETWORK_PERIOD;
    152       //     COUT(3) << '.';
    153152      if ( isConnected() && isSynched_ )
    154153      {
    155         COUT(4) << "popping partial gamestate: " << std::endl;
     154        orxout(verbose, context::network) << "popping partial gamestate: " << endl;
    156155//         packet::Gamestate *gs = GamestateClient::getGamestate();
    157156        if( GamestateManager::update() )
     
    166165        //assert(gs); <--- there might be the case that no data has to be sent, so its commented out now
    167166//         if(gs){
    168 //           COUT(4) << "client tick: sending gs " << gs << std::endl;
     167//           orxout(verbose, context::network) << "client tick: sending gs " << gs << endl;
    169168//           if( !gs->send() )
    170 //             COUT(2) << "Problem adding partial gamestate to queue" << std::endl;
     169//             orxout(internal_warning, context::network) << "Problem adding partial gamestate to queue" << endl;
    171170//         // gs gets automatically deleted by enet callback
    172171//         }
  • code/branches/output/src/libraries/network/ClientConnection.cc

    r8788 r8807  
    6060  void ClientConnection::setServerAddress( const std::string& serverAddress ) {
    6161    if (enet_address_set_host (this->serverAddress_, serverAddress.c_str()) < 0)
    62         COUT(1) << "Error: Could not resolve \"" << serverAddress << "\"." << std::endl;
     62        orxout(internal_error, context::network) << "Could not resolve \"" << serverAddress << "\"." << endl;
    6363  }
    6464
     
    7676    if ( this->host_ == NULL )
    7777    {
    78       COUT(1) << "ClientConnection: host_ == NULL" << std::endl;
     78      orxout(internal_error, context::network) << "ClientConnection: host_ == NULL" << endl;
    7979      // error handling
    8080      return false;
     
    8686    assert( this->host_->socket4 != ENET_SOCKET_NULL || this->host_->socket6 != ENET_SOCKET_NULL );
    8787    if (this->host_->socket4 == ENET_SOCKET_NULL)
    88         COUT(2) << "Warning: IPv4 Socket failed." << std::endl;
     88        orxout(internal_warning, context::network) << "IPv4 Socket failed." << endl;
    8989    else if (this->host_->socket6 == ENET_SOCKET_NULL)
    90         COUT(2) << "Warning: IPv6 Socket failed." << std::endl;
     90        orxout(internal_warning, context::network) << "IPv6 Socket failed." << endl;
    9191    else
    92         COUT(3) << "Info: Using IPv4 and IPv6 Sockets." << std::endl;
     92        orxout(internal_info, context::network) << "Using IPv4 and IPv6 Sockets." << endl;
    9393
    9494    this->server_ = enet_host_connect(this->host_, serverAddress_, NETWORK_CHANNEL_COUNT, 0);
    9595    if ( this->server_==NULL )
    9696    {
    97       COUT(1) << "ClientConnection: server_ == NULL" << std::endl;
     97      orxout(internal_error, context::network) << "ClientConnection: server_ == NULL" << endl;
    9898      // error handling
    9999      return false;
     
    113113      }
    114114    }
    115     COUT(1) << "Could not connect to server" << endl;
     115    orxout(user_error, context::network) << "Could not connect to server" << endl;
    116116    return false;
    117117  }
     
    140140            break;
    141141          case ENET_EVENT_TYPE_DISCONNECT:
    142             COUT(4) << "received disconnect confirmation from server" << endl;
     142            orxout(verbose, context::network) << "received disconnect confirmation from server" << endl;
    143143            this->connectionClosed();
    144144            return true;
     
    167167  {
    168168    this->established_=false;
    169     COUT(1) << "Received disconnect Packet from Server!" << endl;
     169    orxout(internal_error, context::network) << "Received disconnect Packet from Server!" << endl;
    170170        // server closed the connection
    171171    this->stopCommunicationThread();
  • code/branches/output/src/libraries/network/Connection.cc

    r8327 r8807  
    144144      while( outgoingEventsCount > 0 )
    145145      {
    146 //         COUT(0) << "outgoing event" << endl;
     146//         orxout(verbose, context::network) << "outgoing event" << endl;
    147147        this->outgoingEventsMutex_->lock();
    148148        outgoingEvent outEvent = this->outgoingEvents_.front();
  • code/branches/output/src/libraries/network/GamestateManager.cc

    r8788 r8807  
    128128    if( !this->sendPacket(ack))
    129129    {
    130       COUT(3) << "could not ack gamestate: " << gamestateID << std::endl;
     130      orxout(internal_warning, context::network) << "could not ack gamestate: " << gamestateID << endl;
    131131      return false;
    132132    }
    133133    else
    134134    {
    135       COUT(5) << "acked a gamestate: " << gamestateID << std::endl;
     135      orxout(verbose_more, context::network) << "acked a gamestate: " << gamestateID << endl;
    136136      return true;
    137137    }
     
    182182      if( !peerIt->second.isSynched )
    183183      {
    184         COUT(5) << "Server: not sending gamestate" << std::endl;
     184        orxout(verbose_more, context::network) << "Server: not sending gamestate" << endl;
    185185        continue;
    186186      }
    187       COUT(5) << "client id: " << peerIt->first << std::endl;
    188       COUT(5) << "Server: doing gamestate gamestate preparation" << std::endl;
     187      orxout(verbose_more, context::network) << "client id: " << peerIt->first << endl;
     188      orxout(verbose_more, context::network) << "Server: doing gamestate gamestate preparation" << endl;
    189189      int peerID = peerIt->first; //get client id
    190190
     
    256256//     OrxVerify(gs->compressData(), "");
    257257    clock.capture();
    258     COUT(5) << "diff and compress time: " << clock.getDeltaTime() << endl;
    259 //     COUT(5) << "sending gamestate with id " << gs->getID();
     258    orxout(verbose_more, context::network) << "diff and compress time: " << clock.getDeltaTime() << endl;
     259//     orxout(verbose_more, context::network) << "sending gamestate with id " << gs->getID();
    260260//     if(gamestate->isDiffed())
    261 //       COUT(5) << " and baseid " << gs->getBaseID() << endl;
     261//       orxout(verbose_more, context::network) << " and baseid " << gs->getBaseID() << endl;
    262262//     else
    263 //       COUT(5) << endl;
     263//       orxout(verbose_more, context::network) << endl;
    264264    gs->setPeerID(peerID);
    265265    destgamestate = gs;
     
    291291    if( gamestateID <= curid && curid != GAMESTATEID_INITIAL )
    292292        return true;
    293 COUT(4) << "acking gamestate " << gamestateID << " for peerID: " << peerID << " curid: " << curid << std::endl;
     293orxout(verbose, context::network) << "acking gamestate " << gamestateID << " for peerID: " << peerID << " curid: " << curid << endl;
    294294    std::map<uint32_t, packet::Gamestate*>::iterator it2;
    295295    for( it2=it->second.gamestates.begin(); it2!=it->second.gamestates.end(); )
  • code/branches/output/src/libraries/network/LANDiscoverable.cc

    r8788 r8807  
    7171      this->host_ = enet_host_create( &bindAddress, 10, 0, 0, 0 );
    7272      if ( this->host_ == NULL )
    73           COUT(1) << "LANDiscoverable: host_ == NULL" << std::endl;
     73          orxout(internal_error, context::network) << "LANDiscoverable: host_ == NULL" << endl;
    7474    }
    7575    else
     
    9494      {
    9595        case ENET_EVENT_TYPE_CONNECT:
    96             COUT(4) << "Received LAN discovery connect from client " << event.peer->host->receivedAddress << std::endl;
     96            orxout(verbose, context::network) << "Received LAN discovery connect from client " << event.peer->host->receivedAddress << endl;
    9797            break;
    9898        case ENET_EVENT_TYPE_DISCONNECT:
     
    102102          if( strcmp( LAN_DISCOVERY_MESSAGE, (char*)event.packet->data ) == 0 )      // check for a suitable orxonox client
    103103          {
    104             COUT(3) << "Received LAN discovery message from client " << event.peer->host->receivedAddress << std::endl;
     104            orxout(internal_info, context::network) << "Received LAN discovery message from client " << event.peer->host->receivedAddress << endl;
    105105            packet::ServerInformation info;
    106106            info.setServerName("Orxonox Server");
  • code/branches/output/src/libraries/network/LANDiscovery.cc

    r8706 r8807  
    4444    this->host_ = enet_host_create(NULL, 10, 0, 0, 0 );
    4545    if ( this->host_ == NULL )
    46         COUT(1) << "LANDiscovery: host_ == NULL" << std::endl;
     46        orxout(internal_error, context::network) << "LANDiscovery: host_ == NULL" << endl;
    4747  }
    4848
     
    6666    peer = enet_host_connect(this->host_, &address, 0, 0);
    6767    if (peer == NULL)
    68         COUT(1) << "Error: Could not send LAN discovery to IPv4 Broadcast." << std::endl;
     68        orxout(internal_error, context::network) << "Could not send LAN discovery to IPv4 Broadcast." << endl;
    6969
    7070    /* IPv6 */
     
    7272    peer = enet_host_connect(this->host_, &address, 0, 0);
    7373    if (peer == NULL)
    74         COUT(1) << "Error: Could not send LAN discovery to IPv6 Multicast." << std::endl;
     74        orxout(internal_error, context::network) << "Could not send LAN discovery to IPv6 Multicast." << endl;
    7575
    7676    ENetEvent event;
     
    8181        case ENET_EVENT_TYPE_CONNECT:
    8282        {
    83           COUT(4) << "Received LAN discovery connect from server " << event.peer->host->receivedAddress << std::endl;
     83          orxout(verbose, context::network) << "Received LAN discovery connect from server " << event.peer->host->receivedAddress << endl;
    8484          ENetPacket* packet = enet_packet_create(LAN_DISCOVERY_MESSAGE, strlen(LAN_DISCOVERY_MESSAGE)+1, ENET_PACKET_FLAG_RELIABLE);
    8585          enet_peer_send(event.peer, 0, packet);
     
    8989          {
    9090            packet::ServerInformation info(&event);
    91             COUT(3) << "Received LAN discovery server information; Name: " << info.getServerName() << ", Address: " << info.getServerIP() << ", RTT: " << info.getServerRTT() << endl;
     91            orxout(internal_info, context::network) << "Received LAN discovery server information; Name: " << info.getServerName() << ", Address: " << info.getServerIP() << ", RTT: " << info.getServerRTT() << endl;
    9292            std::vector<packet::ServerInformation>::iterator it;
    9393            for( it=this->servers_.begin(); it!=this->servers_.end(); ++it )
  • code/branches/output/src/libraries/network/MasterServer.cc

    r8351 r8807  
    3838  helper_output_debug( ENetEvent *event, char *addrconv )
    3939  {
    40     COUT(4) << "A packet of length"
     40    orxout(verbose, context::master_server)
     41      << "A packet of length"
    4142      << event->packet->dataLength
    4243      << " containing "
     
    4546      << addrconv
    4647      << " on channel "
    47       << event->channelID << "\n";
     48      << event->channelID << endl;
    4849  }
    4950
     
    6667          + MSPROTO_SERVERLIST_ITEM_LEN + 2,1 );
    6768      if( !tosend )
    68       { COUT(2) << "Masterserver.cc: Memory allocation failed.\n";
     69      { orxout(internal_warning, context::master_server) << "Masterserver.cc: Memory allocation failed." << endl;
    6970        continue;
    7071      }
     
    108109  { /* check for bad parameters */
    109110    if( !event )
    110     { COUT(2) << "MasterServer::eventConnect: No event given.\n" ;
     111    { orxout(internal_warning, context::master_server) << "MasterServer::eventConnect: No event given." << endl;
    111112      return -1;
    112113    }
     
    117118
    118119    /* output debug info */
    119     COUT(4) << "A new client connected from "
     120    orxout(verbose, context::master_server) << "A new client connected from "
    120121      << addrconv
    121122      << " on port "
    122       << event->peer->address.port << "\n";
     123      << event->peer->address.port << endl;
    123124
    124125    /* store string form of address here */
     
    134135  { /* check for bad parameters */
    135136    if( !event )
    136     { COUT(2) << "No event given.\n";
     137    { orxout(internal_warning, context::master_server) << "No event given." << endl;
    137138      return -1;
    138139    }
    139140
    140141    /* output that the disconnect happened */
    141     COUT(4) << (char*)event->peer->data << " disconnected.\n";
     142    orxout(verbose, context::master_server) << (char*)event->peer->data << " disconnected." << endl;
    142143
    143144    /* create string from peer data */
     
    159160  { /* validate packet */
    160161    if( !event || !(event->packet) || !(event->peer) )
    161     { COUT(2) << "No complete event given.\n";
     162    { orxout(internal_warning, context::master_server) << "No complete event given." << endl;
    162163      return -1;
    163164    }
     
    182183       
    183184        /* tell people we did so */
    184         COUT(2) << "Added new server to list: " <<
    185           packet::ServerInformation( event ).getServerIP() << "\n";
     185        orxout(internal_info, context::master_server) << "Added new server to list: " <<
     186          packet::ServerInformation( event ).getServerIP() << endl;
    186187      }
    187188
     
    197198
    198199        /* tell the user */
    199         COUT(2) << "Removed server " << name << " from list.\n";
     200        orxout(internal_info, context::master_server) << "Removed server " << name << " from list." << endl;
    200201      }
    201202
     
    230231    if( event == NULL )
    231232    {
    232       COUT(1) << "Could not create ENetEvent structure, exiting.\n";
     233      orxout(user_error, context::master_server) << "Could not create ENetEvent structure, exiting." << endl;
    233234      exit( EXIT_FAILURE );
    234235    }
     
    263264    /***** INITIALIZE NETWORKING *****/
    264265    if( enet_initialize () != 0)
    265     { COUT(1) << "An error occurred while initializing ENet.\n";
     266    { orxout(user_error, context::master_server) << "An error occurred while initializing ENet." << endl;
    266267      exit( EXIT_FAILURE );
    267268    }
     
    285286    /* see if creation worked */
    286287    if( !this->server )
    287     { COUT(1) <<
    288         "An error occurred while trying to create an ENet server host.\n";
     288    { orxout(user_error, context::master_server) <<
     289        "An error occurred while trying to create an ENet server host." << endl;
    289290      exit( EXIT_FAILURE );
    290291    }
     
    294295
    295296    /* tell people we're now initialized */
    296     COUT(0) << "MasterServer initialized, waiting for connections.\n";
     297    orxout(internal_status, context::master_server) << "MasterServer initialized, waiting for connections." << endl;
    297298  }
    298299
  • code/branches/output/src/libraries/network/MasterServerComm.cc

    r8788 r8807  
    4444    /* initialize Enet */
    4545    if( enet_initialize () != 0 )
    46     { COUT(1) << "An error occurred while initializing ENet.\n";
     46    { orxout(internal_error, context::master_server) << "An error occurred while initializing ENet." << endl;
    4747      return 1;
    4848    }
     
    6161    /* see if it worked */
    6262    if (this->client == NULL)
    63     { COUT(1) << "An error occurred while trying to create an "
    64         << "ENet client host.\n";
     63    { orxout(internal_error, context::master_server) << "An error occurred while trying to create an "
     64        << "ENet client host." << endl;
    6565      return 1;
    6666    }
     
    8585
    8686    if( this->peer == NULL )
    87     { COUT(2) << "ERROR: No available peers for initiating an ENet"
    88         << " connection.\n";
     87    { orxout(internal_error, context::master_server) << "No available peers for initiating an ENet"
     88        << " connection." << endl;
    8989      return -1;
    9090    }
     
    9393    if (enet_host_service (this->client, &this->event, 500) > 0 &&
    9494        this->event.type == ENET_EVENT_TYPE_CONNECT )
    95       COUT(3) << "Connection to master server succeeded.\n";
     95      orxout(internal_info, context::master_server) << "Connection to master server succeeded." << endl;
    9696    else
    9797    {
    9898      enet_peer_reset (this->peer);
    99       COUT(2) << "ERROR: connection to " << address << " failed.\n";
     99      orxout(internal_warning, context::master_server) << "Connection to " << address << " failed." << endl;
    100100      return -1;
    101101    }
     
    128128
    129129        case ENET_EVENT_TYPE_DISCONNECT:
    130           COUT(4) << "Disconnect from master server successful.\n";
     130          orxout(verbose, context::master_server) << "Disconnect from master server successful." << endl;
    131131          return 0;
    132132        default: break;
     
    154154    /* see whether anything happened */
    155155    /* WORK MARK REMOVE THIS OUTPUT */
    156     COUT(2) << "polling masterserver...\n";
     156    orxout(verbose, context::master_server) << "polling masterserver..." << endl;
    157157
    158158    /* address buffer */
     
    176176          addrconv = (char *) calloc( 50, 1 );
    177177          if( !addrconv )
    178           { COUT(2) << "MasterServerComm.cc: Could not allocate memory!\n";
     178          { orxout(internal_warning, context::master_server) << "MasterServerComm.cc: Could not allocate memory!" << endl;
    179179            break;
    180180          }
     
    185185
    186186          /* DEBUG */
    187           COUT(3) << "MasterServer Debug: A packet of length "
     187          orxout(verbose, context::master_server) << "MasterServer Debug: A packet of length "
    188188            << this->event.packet->dataLength
    189189            << " containing " << this->event.packet->data
  • code/branches/output/src/libraries/network/PeerList.cc

    r8351 r8807  
    4040  { /* error correction */
    4141    if( toadd == NULL )
    42     { fprintf( stderr, "PeerList::addPeer: empty peer given.\n" );
     42    { orxout(internal_error, context::master_server) << "PeerList::addPeer: empty peer given." << endl;
    4343      return -1;
    4444    }
  • code/branches/output/src/libraries/network/Server.cc

    r8788 r8807  
    114114  {
    115115    Host::setActive(true);
    116     COUT(4) << "opening server" << endl;
     116    orxout(verbose, context::network) << "opening server" << endl;
    117117    this->openListener();
    118118   
     
    137137  {
    138138    Host::setActive(false);
    139     COUT(4) << "closing server" << endl;
     139    orxout(verbose, context::network) << "closing server" << endl;
    140140    this->disconnectClients();
    141141    this->closeListener();
    142142
    143143    /* tell master server we're closing */
    144     COUT(2) << "disconnecting." << endl;
     144    orxout(internal_info, context::network) << "disconnecting." << endl;
    145145    WANDiscoverable::setActivity(false);   
    146     COUT(2) << "disconnecting done" << endl;
     146    orxout(internal_info, context::network) << "disconnecting done" << endl;
    147147
    148148    LANDiscoverable::setActivity(false);
     
    158158    chat->setPeerID(NETWORK_PEER_ID_BROADCAST);
    159159    chat->send( static_cast<Host*>(this) );
    160 //         COUT(3) << "could not send Chat message to client ID: " << temp->getID() << std::endl;
     160//         orxout(internal_warning, context::network) << "could not send Chat message to client ID: " << temp->getID() << endl;
    161161//       temp = temp->next();
    162162//     }
    163 //    COUT(1) << "Player " << playerID << ": " << message << std::endl;
     163//    orxout(message) << "Player " << playerID << ": " << message << endl;
    164164    return true;
    165165  }
     
    246246  {
    247247//     for( ClientInformation* temp=ClientInformation::getBegin(); temp!=0; temp=temp->next() )
    248 //       COUT(0) << "Round trip time to client with ID: " << temp->getID() << " is " << temp->getRTT() << " ms" << endl;
     248//       orxout(message) << "Round trip time to client with ID: " << temp->getID() << " is " << temp->getRTT() << " ms" << endl;
    249249  }
    250250
     
    268268      return;
    269269    GamestateManager::update();
    270 //     COUT(5) << "Server: one gamestate update complete, goig to sendGameState" << std::endl;
    271     //std::cout << "updated gamestate, sending it" << std::endl;
     270//     orxout(verbose_more, context::network) << "Server: one gamestate update complete, goig to sendGameState" << endl;
     271    //orxout(verbose_more, context::network) << "updated gamestate, sending it" << endl;
    272272    //if(clients->getGamestateID()!=GAMESTATEID_INITIAL)
    273273    sendGameStates();
    274274    sendObjectDeletes();
    275 //     COUT(5) << "Server: one sendGameState turn complete, repeat in next tick" << std::endl;
    276     //std::cout << "sent gamestate" << std::endl;
     275//     orxout(verbose_more, context::network) << "Server: one sendGameState turn complete, repeat in next tick" << endl;
     276    //orxout(verbose_more, context::network) << "sent gamestate" << endl;
    277277  }
    278278
     
    305305      return true;  //everything ok (no deletes this tick)
    306306    }
    307 //     COUT(3) << "sending DeleteObjects" << std::endl;
     307//     orxout(verbose, context::network) << "sending DeleteObjects" << endl;
    308308//     while(temp != NULL){
    309309//       if( !(temp->getSynched()) )
    310310//       {
    311 //         COUT(5) << "Server: not sending gamestate" << std::endl;
     311//         orxout(verbose_more, context::network) << "Server: not sending gamestate" << endl;
    312312//         temp=temp->next();
    313313//         continue;
     
    318318    del->setPeerID(NETWORK_PEER_ID_BROADCAST);
    319319    if ( !del->send( static_cast<Host*>(this) ) )
    320       COUT(3) << "Server: could not broadcast deleteObjects packet" << std::endl;
     320      orxout(internal_warning, context::network) << "Server: could not broadcast deleteObjects packet" << endl;
    321321//       temp=temp->next();
    322322      // gs gets automatically deleted by enet callback
     
    331331//     static unsigned int newid=1;
    332332//
    333 //     COUT(2) << "Server: adding client" << std::endl;
     333//     orxout(internal_info, context::network) << "Server: adding client" << endl;
    334334//     ClientInformation *temp = ClientInformation::insertBack(new ClientInformation);
    335335//     if(!temp)
    336336//     {
    337 //       COUT(2) << "Server: could not add client" << std::endl;
     337//       orxout(internal_warning, context::network) << "Server: could not add client" << endl;
    338338//     }
    339339//     temp->setID(newid);
     
    347347//     ++newid;
    348348
    349     COUT(3) << "Server: added client id: " << peerID << std::endl;
     349    orxout(internal_info, context::network) << "Server: added client id: " << peerID << endl;
    350350    createClient(peerID);
    351351}
     
    353353  void Server::removePeer(uint32_t peerID)
    354354  {
    355     COUT(4) << "removing client from list" << std::endl;
     355    orxout(verbose, context::network) << "removing client from list" << endl;
    356356//     ClientInformation *client = ClientInformation::findClient(&event->peer->address);
    357357//     if(!client)
     
    395395//     if(!temp)
    396396//     {
    397 //       COUT(2) << "Server. could not create client with id: " << clientID << std::endl;
     397//       orxout(internal_error, context::network) << "Server. could not create client with id: " << clientID << endl;
    398398//       return false;
    399399//     }
    400 //     COUT(4) << "Con.Man: creating client id: " << temp->getID() << std::endl;
     400//     orxout(verbose, context::network) << "Con.Man: creating client id: " << temp->getID() << endl;
    401401
    402402    // synchronise class ids
     
    412412    GamestateManager::setSynched(clientID);
    413413   
    414     COUT(4) << "sending welcome" << std::endl;
     414    orxout(verbose, context::network) << "sending welcome" << endl;
    415415    packet::Welcome *w = new packet::Welcome(clientID);
    416416    w->setPeerID(clientID);
     
    457457      chat->setPeerID(NETWORK_PEER_ID_BROADCAST);
    458458      chat->send( static_cast<Host*>(this) );
    459 //         COUT(3) << "could not send Chat message to client ID: " << temp->getID() << std::endl;
     459//         orxout(internal_warning, context::network) << "could not send Chat message to client ID: " << temp->getID() << endl;
    460460//       temp = temp->next();
    461461    }
    462 //    COUT(1) << "Player " << Host::getPlayerID() << ": " << message << std::endl;
     462//    orxout(message) << "Player " << Host::getPlayerID() << ": " << message << endl;
    463463    for (ObjectList<ChatListener>::iterator it = ObjectList<ChatListener>::begin(); it != ObjectList<ChatListener>::end(); ++it)
    464464      it->incomingChat(message, clientID);
     
    476476    }
    477477    assert(failures<10);
    478     COUT(4) << "syncClassid:\tall synchClassID packets have been sent" << std::endl;
     478    orxout(verbose, context::network) << "syncClassid:\tall synchClassID packets have been sent" << endl;
    479479  }
    480480
  • code/branches/output/src/libraries/network/ServerConnection.cc

    r8788 r8807  
    6161  {
    6262    if (enet_address_set_host (this->bindAddress_, bindAddress.c_str()) < 0)
    63         COUT(1) << "Error: Could not resolve \"" << bindAddress << "\"." << std::endl;
     63        orxout(internal_error, context::network) << "Could not resolve \"" << bindAddress << "\"." << endl;
    6464  }
    6565
     
    7575    if ( this->host_ == NULL )
    7676    {
    77         COUT(1) << "ServerConnection: host_ == NULL" << std::endl;
     77        orxout(internal_error, context::network) << "ServerConnection: host_ == NULL" << endl;
    7878        return false;
    7979    }
     
    8383    assert( this->host_->socket4 != ENET_SOCKET_NULL || this->host_->socket6 != ENET_SOCKET_NULL );
    8484    if (this->host_->socket4 == ENET_SOCKET_NULL)
    85         COUT(2) << "Warning: IPv4 Socket failed." << std::endl;
     85        orxout(internal_warning, context::network) << "IPv4 Socket failed." << endl;
    8686    else if (this->host_->socket6 == ENET_SOCKET_NULL)
    87         COUT(2) << "Warning: IPv6 Socket failed." << std::endl;
     87        orxout(internal_warning, context::network) << "IPv6 Socket failed." << endl;
    8888    else
    89         COUT(3) << "Info: Using IPv4 and IPv6 Sockets." << std::endl;
     89        orxout(internal_info, context::network) << "Using IPv4 and IPv6 Sockets." << endl;
    9090   
    9191    // start communication thread
     
    114114//       ClientInformation *temp = ClientInformation::findClient(clientID);
    115115//       if(!temp){
    116 //         COUT(3) << "C.Man: addPacket findClient failed" << std::endl;
     116//         orxout(internal_warning, context::network) << "C.Man: addPacket findClient failed" << endl;
    117117//       }
    118118      Connection::addPacket(packet, clientID, channelID);
  • code/branches/output/src/libraries/network/TrafficControl.cc

    r6417 r8807  
    287287  {
    288288    std::list<obj>::iterator it;
    289     COUT(0) << "=========== Objectlist ===========" << endl;
     289    orxout(debug_output, context::network) << "=========== Objectlist ===========" << endl;
    290290    for( it=list.begin(); it!=list.end(); it++)
    291       COUT(0) << "ObjectID: " << it->objID << " creatorID: " << it->objCreatorID << " Priority: " << clientListPerm_[clientID][it->objID].objValuePerm + clientListPerm_[clientID][it->objID].objValueSched << " size: " << it->objSize << endl;
     291      orxout(debug_output, context::network) << "ObjectID: " << it->objID << " creatorID: " << it->objCreatorID << " Priority: " << clientListPerm_[clientID][it->objID].objValuePerm + clientListPerm_[clientID][it->objID].objValueSched << " size: " << it->objSize << endl;
    292292  }
    293293
  • code/branches/output/src/libraries/network/WANDiscoverable.cc

    r8351 r8807  
    4444  {
    4545    /* debugging output */
    46     COUT(4) << "Creating WANDiscoverable.\n";
     46    orxout(verbose, context::master_server) << "Creating WANDiscoverable." << endl;
    4747 
    4848    /* register object in orxonox */
     
    9191    if( msc.initialize() )
    9292    {
    93       COUT(2) << "Error: could not initialize master server communications!\n";
     93      orxout(internal_error, context::master_server) << "Could not initialize master server communications!" << endl;
    9494      return false;
    9595    }
     
    9898    if( msc.connect( this->msaddress.c_str(), ORX_MSERVER_PORT ) )
    9999    {
    100       COUT(2) << "Error: could not connect to master server at "
    101                  << this->msaddress << std::endl;
     100      orxout(internal_error, context::master_server) << "Could not connect to master server at "
     101                 << this->msaddress << endl;
    102102      return false;
    103103    }
    104104                 
    105105    /* debugging output */
    106     COUT(4) << "Initialization of WANDiscoverable complete.\n";
     106    orxout(verbose, context::master_server) << "Initialization of WANDiscoverable complete." << endl;
    107107   
    108108   
  • code/branches/output/src/libraries/network/WANDiscovery.cc

    r8351 r8807  
    4545  {
    4646    /* debugging output */
    47     COUT(4) << "Creating WANDiscovery.\n";
     47    orxout(verbose, context::master_server) << "Creating WANDiscovery." << endl;
    4848 
    4949    /* register object in orxonox */
     
    5555    /* initialize it and see if it worked */
    5656    if( msc.initialize() )
    57       COUT(2) << "Error: could not initialize master server communications!\n";
     57      orxout(internal_error, context::master_server) << "Could not initialize master server communications!" << endl;
    5858
    5959    /* connect and see if it worked */
    6060    if( msc.connect( this->msaddress.c_str(), ORX_MSERVER_PORT ) )
    61       COUT(2) << "Error: could not connect to master server at "
    62         << this->msaddress << std::endl;
     61      orxout(internal_error, context::master_server) << "Could not connect to master server at "
     62        << this->msaddress << endl;
    6363
    6464    /* debugging output */
    65     COUT(4) << "Initialization of WANDiscovery complete.\n";
     65    orxout(verbose, context::master_server) << "Initialization of WANDiscovery complete." << endl;
    6666  }
    6767
     
    8585    /* error recognition */
    8686    if( !ev || !ev->packet || !ev->packet->data )
    87     { COUT(2) << "Bad arguments received in WANDiscovery's reply handler.\n";
     87    { orxout(internal_warning, context::master_server) << "Bad arguments received in WANDiscovery's reply handler." << endl;
    8888      return 0;
    8989    }
  • code/branches/output/src/libraries/network/packet/Acknowledgement.cc

    r8788 r8807  
    6464
    6565bool Acknowledgement::process(orxonox::Host* host){
    66   COUT(5) << "processing ACK with ID: " << getAckID() << endl;
     66  orxout(verbose_more, context::packets) << "processing ACK with ID: " << getAckID() << endl;
    6767  bool b = host->ackGamestate(getAckID(), peerID_);
    6868  delete this;
  • code/branches/output/src/libraries/network/packet/ClassID.cc

    r7801 r8807  
    9292  assert(tempsize==packetSize);
    9393
    94   COUT(5) << "classid packetSize is " << packetSize << endl;
     94  orxout(verbose_more, context::packets) << "classid packetSize is " << packetSize << endl;
    9595
    9696}
     
    131131  Identifier::clearNetworkIDs();
    132132
    133   COUT(4) << "=== processing classids: " << endl;
     133  orxout(verbose, context::packets) << "=== processing classids: " << endl;
    134134  std::pair<uint32_t, std::string> tempPair;
    135135  Identifier *id;
     
    143143    classname = temp+2*sizeof(uint32_t);
    144144    id=ClassByString( std::string((const char*)classname) );
    145     COUT(3) << "processing classid: " << networkID << " name: " << classname << " id: " << id << std::endl;
     145    orxout(internal_info, context::packets) << "processing classid: " << networkID << " name: " << classname << " id: " << id << endl;
    146146    if(id==NULL){
    147       COUT(0) << "Received a bad classname" << endl;
     147      orxout(user_error, context::packets) << "Received a bad classname" << endl;
    148148      abort();
    149149    }
  • code/branches/output/src/libraries/network/packet/DeleteObjects.cc

    r8788 r8807  
    6262  if(number==0)
    6363    return false;
    64   COUT(4) << "sending DeleteObjects: ";
     64  orxout(verbose, context::packets) << "sending DeleteObjects: ";
    6565  unsigned int size = sizeof(Type::Value) + sizeof(uint32_t)*(number+1);
    6666  data_ = new uint8_t[size];
     
    7373    unsigned int temp = Synchronisable::popDeletedObject();
    7474    *reinterpret_cast<uint32_t*>(tdata) = temp;
    75     COUT(4) << temp << ' ';
     75    orxout(verbose, context::packets) << temp << ' ';
    7676    tdata += sizeof(uint32_t);
    7777  }
    78   COUT(4) << std::endl;
     78  orxout(verbose, context::packets) << endl;
    7979  return true;
    8080}
     
    9090  for(unsigned int i=0; i<*(unsigned int *)(data_+_QUANTITY); i++)
    9191  {
    92     COUT(4) << "deleting object with id: " << *(uint32_t*)(data_+_OBJECTIDS+i*sizeof(uint32_t)) << std::endl;
     92    orxout(verbose, context::packets) << "deleting object with id: " << *(uint32_t*)(data_+_OBJECTIDS+i*sizeof(uint32_t)) << endl;
    9393    Synchronisable::deleteObject( *(uint32_t*)(data_+_OBJECTIDS+i*sizeof(uint32_t)) );
    9494  }
  • code/branches/output/src/libraries/network/packet/FunctionIDs.cc

    r8788 r8807  
    8888  }
    8989
    90   COUT(5) << "FunctionIDs packetSize is " << packetSize << endl;
     90  orxout(verbose_more, context::packets) << "FunctionIDs packetSize is " << packetSize << endl;
    9191
    9292}
     
    126126  unsigned char *functionname;
    127127
    128   COUT(4) << "=== processing functionids: " << endl;
     128  orxout(verbose, context::packets) << "=== processing functionids: " << endl;
    129129  std::pair<uint32_t, std::string> tempPair;
    130130  // read the total number of classes
     
    137137    stringsize = *(uint32_t*)(temp+sizeof(uint32_t));
    138138    functionname = temp+2*sizeof(uint32_t);
    139     COUT(3) << "processing functionid: " << networkID << " name: " << functionname << std::endl;
     139    orxout(internal_info, context::packets) << "processing functionid: " << networkID << " name: " << functionname << endl;
    140140    NetworkFunctionBase::setNetworkID((const char*)functionname, networkID);
    141141    temp += 2*sizeof(uint32_t) + stringsize;
  • code/branches/output/src/libraries/network/packet/Gamestate.cc

    r8788 r8807  
    108108  uint32_t size = calcGamestateSize(id, mode);
    109109
    110   COUT(5) << "G.ST.Man: producing gamestate with id: " << id << std::endl;
     110  orxout(verbose_more, context::packets) << "G.ST.Man: producing gamestate with id: " << id << endl;
    111111  if(size==0)
    112112    return false;
     
    114114  if(!data_)
    115115  {
    116     COUT(2) << "GameStateManager: could not allocate memory" << std::endl;
     116    orxout(internal_warning, context::packets) << "GameStateManager: could not allocate memory" << endl;
    117117    return false;
    118118  }
     
    139139      assert(0); // if we don't use multithreading this part shouldn't be neccessary
    140140      // start allocate additional memory
    141       COUT(3) << "Gamestate: need additional memory" << std::endl;
     141      orxout(internal_info, context::packets) << "Gamestate: need additional memory" << endl;
    142142      ObjectList<Synchronisable>::iterator temp = it;
    143143      uint32_t addsize=tempsize;
     
    167167  //stop write gamestate header
    168168
    169   COUT(5) << "Gamestate: Gamestate size: " << currentsize << std::endl;
    170   COUT(5) << "Gamestate: 'estimated' (and corrected) Gamestate size: " << size << std::endl;
     169  orxout(verbose_more, context::packets) << "Gamestate: Gamestate size: " << currentsize << endl;
     170  orxout(verbose_more, context::packets) << "Gamestate: 'estimated' (and corrected) Gamestate size: " << size << endl;
    171171  return true;
    172172}
     
    175175bool Gamestate::spreadData(uint8_t mode)
    176176{
    177   COUT(5) << "processing gamestate with id " << header_.getID() << endl;
     177  orxout(verbose_more, context::packets) << "processing gamestate with id " << header_.getID() << endl;
    178178  assert(data_);
    179179  assert(!header_.isCompressed());
     
    195195      else
    196196      {
    197 //         COUT(4) << "not creating object of classid " << objectheader.getClassID() << endl;
     197//         orxout(verbose, context::packets) << "not creating object of classid " << objectheader.getClassID() << endl;
    198198        mem += objectheader.getDataSize() + ( objectheader.isDiffed() ? SynchronisableHeaderLight::getSize() : SynchronisableHeader::getSize() );
    199199      }
     
    201201    else
    202202    {
    203 //       COUT(4) << "updating object of classid " << objectheader.getClassID() << endl;
     203//       orxout(verbose, context::packets) << "updating object of classid " << objectheader.getClassID() << endl;
    204204      OrxVerify(s->updateData(mem, mode), "ERROR: could not update Synchronisable with Gamestate data");
    205205    }
     
    219219        if (it->objectMode_ != 0x0)
    220220        {
    221           COUT(0) << "Found object with OBJECTID_UNKNOWN on the client with objectMode != 0x0!" << std::endl;
    222           COUT(0) << "Possible reason for this error: Client created a synchronized object without the Server's approval." << std::endl;
    223           COUT(0) << "Objects class: " << it->getIdentifier()->getName() << std::endl;
     221          orxout(user_error, context::packets) << "Found object with OBJECTID_UNKNOWN on the client with objectMode != 0x0!" << endl;
     222          orxout(user_error, context::packets) << "Possible reason for this error: Client created a synchronized object without the Server's approval." << endl;
     223          orxout(user_error, context::packets) << "Objects class: " << it->getIdentifier()->getName() << endl;
    224224          assert(false);
    225225        }
     
    232232          if (it->getObjectID() == *it2)
    233233          {
    234             COUT(0) << "Found duplicate objectIDs on the client!" << std::endl
    235                     << "Are you sure you don't create a Sychnronisable objcect with 'new' \
    236                         that doesn't have objectMode = 0x0?" << std::endl;
     234            orxout(user_error, context::packets) << "Found duplicate objectIDs on the client!" << endl
     235                                                 << "Are you sure you don't create a Sychnronisable objcect with 'new' \
     236                                                     that doesn't have objectMode = 0x0?" << endl;
    237237            assert(false);
    238238          }
     
    293293  switch ( retval )
    294294  {
    295     case Z_OK: COUT(5) << "G.St.Man: compress: successfully compressed" << std::endl; break;
    296     case Z_MEM_ERROR: COUT(1) << "G.St.Man: compress: not enough memory available in gamestate.compress" << std::endl; return false;
    297     case Z_BUF_ERROR: COUT(2) << "G.St.Man: compress: not enough memory available in the buffer in gamestate.compress" << std::endl; return false;
    298     case Z_DATA_ERROR: COUT(2) << "G.St.Man: compress: data corrupted in gamestate.compress" << std::endl; return false;
     295    case Z_OK: orxout(verbose_more, context::packets) << "G.St.Man: compress: successfully compressed" << endl; break;
     296    case Z_MEM_ERROR: orxout(internal_error, context::packets) << "G.St.Man: compress: not enough memory available in gamestate.compress" << endl; return false;
     297    case Z_BUF_ERROR: orxout(internal_warning, context::packets) << "G.St.Man: compress: not enough memory available in the buffer in gamestate.compress" << endl; return false;
     298    case Z_DATA_ERROR: orxout(internal_warning, context::packets) << "G.St.Man: compress: data corrupted in gamestate.compress" << endl; return false;
    299299  }
    300300
     
    310310  header_.setCompSize( buffer );
    311311  header_.setCompressed( true );
    312   COUT(4) << "gamestate compress datasize: " << header_.getDataSize() << " compsize: " << header_.getCompSize() << std::endl;
     312  orxout(verbose, context::packets) << "gamestate compress datasize: " << header_.getDataSize() << " compsize: " << header_.getCompSize() << endl;
    313313  return true;
    314314}
     
    319319  assert(data_);
    320320  assert(header_.isCompressed());
    321   COUT(4) << "GameStateClient: uncompressing gamestate. id: " << header_.getID() << ", baseid: " << header_.getBaseID() << ", datasize: " << header_.getDataSize() << ", compsize: " << header_.getCompSize() << std::endl;
     321  orxout(verbose, context::packets) << "GameStateClient: uncompressing gamestate. id: " << header_.getID() << ", baseid: " << header_.getBaseID() << ", datasize: " << header_.getDataSize() << ", compsize: " << header_.getCompSize() << endl;
    322322  uint32_t datasize = header_.getDataSize();
    323323  uint32_t compsize = header_.getCompSize();
     
    333333  switch ( retval )
    334334  {
    335     case Z_OK: COUT(5) << "successfully decompressed" << std::endl; break;
    336     case Z_MEM_ERROR: COUT(1) << "not enough memory available" << std::endl; return false;
    337     case Z_BUF_ERROR: COUT(2) << "not enough memory available in the buffer" << std::endl; return false;
    338     case Z_DATA_ERROR: COUT(2) << "data corrupted (zlib)" << std::endl; return false;
     335    case Z_OK: orxout(verbose_more, context::packets) << "successfully decompressed" << endl; break;
     336    case Z_MEM_ERROR: orxout(internal_error, context::packets) << "not enough memory available" << endl; return false;
     337    case Z_BUF_ERROR: orxout(internal_warning, context::packets) << "not enough memory available in the buffer" << endl; return false;
     338    case Z_DATA_ERROR: orxout(internal_warning, context::packets) << "data corrupted (zlib)" << endl; return false;
    339339  }
    340340
     
    375375  if( memcmp( origDataPtr+objectOffset, baseDataPtr+objectOffset, objectHeader.getDataSize()) == 0 )
    376376  {
    377 //     COUT(4) << "skip object " << Synchronisable::getSynchronisable(objectHeader.getObjectID())->getIdentifier()->getName() << endl;
     377//     orxout(verbose, context::packets) << "skip object " << Synchronisable::getSynchronisable(objectHeader.getObjectID())->getIdentifier()->getName() << endl;
    378378    origDataPtr += objectOffset + objectHeader.getDataSize(); // skip the whole object
    379379    baseDataPtr += objectOffset + objectHeader.getDataSize();
     
    431431inline void /*Gamestate::*/copyObject( uint8_t*& newData, uint8_t*& origData, uint8_t*& baseData, SynchronisableHeader& objectHeader, std::vector<uint32_t>::iterator& sizes )
    432432{
    433   //       COUT(4) << "docopy" << endl;
     433  //       orxout(verbose, context::packets) << "docopy" << endl;
    434434  // Just copy over the whole Object
    435435  memcpy( newData, origData, objectHeader.getDataSize()+SynchronisableHeader::getSize() );
     
    440440//   SynchronisableHeader baseHeader( baseData );
    441441//   baseData += baseHeader.getDataSize()+SynchronisableHeader::getSize();
    442   //       COUT(4) << "copy " << h.getObjectID() << endl;
    443   //       COUT(4) << "copy " << h.getObjectID() << ":";
     442  //       orxout(verbose, context::packets) << "copy " << h.getObjectID() << endl;
     443  //       orxout(verbose, context::packets) << "copy " << h.getObjectID() << ":";
    444444  sizes += Synchronisable::getSynchronisable(objectHeader.getObjectID())->getNrOfVariables();
    445445//   for( unsigned int i = 0; i < Synchronisable::getSynchronisable(objectHeader.getObjectID())->getNrOfVariables(); ++i )
    446446//   {
    447 //     //         COUT(4) << " " << *sizes;
     447//     //         orxout(verbose, context::packets) << " " << *sizes;
    448448//     ++sizes;
    449449//   }
    450     //       COUT(4) << endl;
     450    //       orxout(verbose, context::packets) << endl;
    451451}
    452452
     
    541541      if( SynchronisableHeader(baseDataPtr).getDataSize()==origHeader.getDataSize() )
    542542      {
    543 //         COUT(4) << "diffing object in order: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
     543//         orxout(verbose, context::packets) << "diffing object in order: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
    544544        diffObject(destDataPtr, origDataPtr, baseDataPtr, origHeader, sizesIt);
    545545        diffedObject = true;
     
    547547      else
    548548      {
    549 //         COUT(4) << "copy object because of different data sizes (1): " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
     549//         orxout(verbose, context::packets) << "copy object because of different data sizes (1): " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
    550550        copyObject(destDataPtr, origDataPtr, baseDataPtr, origHeader, sizesIt);
    551551        assert(sizesIt != this->sizes_.end() || origDataPtr==origDataEnd);
     
    565565        if( SynchronisableHeader(baseDataPtr).getDataSize()==origHeader.getDataSize() )
    566566        {
    567 //           COUT(4) << "diffing object out of order: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
     567//           orxout(verbose, context::packets) << "diffing object out of order: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
    568568          diffObject(destDataPtr, origDataPtr, baseDataPtr, origHeader, sizesIt);
    569569          diffedObject = true;
     
    571571        else
    572572        {
    573 //           COUT(4) << "copy object because of different data sizes (2): " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
     573//           orxout(verbose, context::packets) << "copy object because of different data sizes (2): " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
    574574          copyObject(destDataPtr, origDataPtr, baseDataPtr, origHeader, sizesIt);
    575575          assert(sizesIt != this->sizes_.end() || origDataPtr==origDataEnd);
     
    578578      else
    579579      {
    580 //         COUT(4) << "copy object: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
     580//         orxout(verbose, context::packets) << "copy object: " << Synchronisable::getSynchronisable(origHeader.getObjectID())->getIdentifier()->getName() << endl;
    581581        assert(baseDataPtr == oldBaseDataPtr);
    582582        copyObject(destDataPtr, origDataPtr, baseDataPtr, origHeader, sizesIt);
     
    718718  //copy in the zeros
    719719//   std::list<obj>::iterator itt;
    720 //   COUT(0) << "myvector contains:";
     720//   orxout() << "myvector contains:";
    721721//   for ( itt=dataVector_.begin() ; itt!=dataVector_.end(); itt++ )
    722 //     COUT(0) << " " << (*itt).objID;
    723 //   COUT(0) << endl;
     722//     orxout() << " " << (*itt).objID;
     723//   orxout() << endl;
    724724  for(it=dataVector_.begin(); it!=dataVector_.end();){
    725725    SynchronisableHeader oldobjectheader(origdata);
     
    771771    nrOfVariables += it->getNrOfVariables();
    772772  }
    773 //   COUT(0) << "allocating " << nrOfVariables << " ints" << endl;
     773//   orxout() << "allocating " << nrOfVariables << " ints" << endl;
    774774  this->sizes_.reserve(nrOfVariables);
    775775  return size;
  • code/branches/output/src/libraries/network/packet/Packet.cc

    r8788 r8807  
    192192//     peerID = NETWORK_PEER_ID_SERVER;
    193193  Packet *p = 0;
    194 //   COUT(6) << "packet type: " << *(Type::Value *)&data[_PACKETID] << std::endl;
     194//   orxout(verbose_ultra, context::packets) << "packet type: " << *(Type::Value *)&data[_PACKETID] << endl;
    195195  switch( *(Type::Value *)(data + _PACKETID) )
    196196  {
    197197    case Type::Acknowledgement:
    198 //       COUT(5) << "ack" << std::endl;
     198//       orxout(verbose_more, context::packets) << "ack" << endl;
    199199    p = new Acknowledgement( data, peerID );
    200200      break;
    201201    case Type::Chat:
    202 //       COUT(5) << "chat" << std::endl;
     202//       orxout(verbose_more, context::packets) << "chat" << endl;
    203203      p = new Chat( data, peerID );
    204204      break;
    205205    case Type::ClassID:
    206 //       COUT(5) << "classid" << std::endl;
     206//       orxout(verbose_more, context::packets) << "classid" << endl;
    207207      p = new ClassID( data, peerID );
    208208      break;
    209209    case Type::Gamestate:
    210 //       COUT(5) << "gamestate" << std::endl;
     210//       orxout(verbose_more, context::packets) << "gamestate" << endl;
    211211      p = new Gamestate( data, peerID );
    212212      break;
    213213    case Type::Welcome:
    214 //       COUT(5) << "welcome" << std::endl;
     214//       orxout(verbose_more, context::packets) << "welcome" << endl;
    215215      p = new Welcome( data, peerID );
    216216      break;
    217217    case Type::DeleteObjects:
    218 //       COUT(5) << "deleteobjects" << std::endl;
     218//       orxout(verbose_more, context::packets) << "deleteobjects" << endl;
    219219      p = new DeleteObjects( data, peerID );
    220220      break;
    221221    case Type::FunctionCalls:
    222 //       COUT(5) << "functionCalls" << std::endl;
     222//       orxout(verbose_more, context::packets) << "functionCalls" << endl;
    223223      p = new FunctionCalls( data, peerID );
    224224      break;
    225225    case Type::FunctionIDs:
    226 //       COUT(5) << "functionIDs" << std::endl;
     226//       orxout(verbose_more, context::packets) << "functionIDs" << endl;
    227227      p = new FunctionIDs( data, peerID );
    228228      break;
     
    255255  packetMap_.erase(it);
    256256  Packet::packetMapMutex_.unlock();
    257 //   COUT(6) << "PacketMap size: " << packetMap_.size() << std::endl;
     257//   orxout(verbose_ultra, context::packets) << "PacketMap size: " << packetMap_.size() << endl;
    258258}
    259259
  • code/branches/output/src/libraries/network/packet/Welcome.cc

    r8788 r8807  
    7878  assert(*(uint32_t *)(data_ + _ENDIANTEST ) == 0xFEDC4321);
    7979  host->setClientID(clientID);
    80   COUT(3) << "Welcome set clientId: " << clientID << endl;
     80  orxout(internal_info, context::packets) << "Welcome set clientId: " << clientID << endl;
    8181  Synchronisable::setClient(true);
    8282  delete this;
  • 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;
  • code/branches/output/src/libraries/util/output/OutputDefinitions.h

    r8806 r8807  
    9191            REGISTER_OUTPUT_CONTEXT(loader);
    9292            REGISTER_OUTPUT_CONTEXT(xml);
     93            REGISTER_OUTPUT_CONTEXT(network);
     94            REGISTER_OUTPUT_CONTEXT(packets);
     95            REGISTER_OUTPUT_CONTEXT(master_server);
    9396        }
    9497    }
Note: See TracChangeset for help on using the changeset viewer.