Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7777 in orxonox.OLD for branches/network/src/lib


Ignore:
Timestamp:
May 23, 2006, 4:21:02 PM (19 years ago)
Author:
rennerc
Message:

added debug output

Location:
branches/network/src/lib/network
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/handshake.cc

    r7776 r7777  
    7979        localState.error = 1;
    8080        localState.completed = 1;
    81         localState.errorString = "Seems not to be orxonox!";
     81        PRINTF(0)("orxId: %d:%d", remoteState.orxId, _ORXONOX_ID);
     82        localState.errorString = "Seems not to be orxonox!\n";
    8283        return;
    8384      }
     
    9394        localState.error = 2;
    9495        localState.completed = 1;
    95         localState.errorString = "Versions of server and client do not match!";
     96        PRINTF(0)("version: %d:%d", remoteState.version, _ORXONOX_VERSION);
     97        localState.errorString = "Versions of server and client do not match!\n";
    9698        return;
    9799      }
  • branches/network/src/lib/network/handshake.h

    r7731 r7777  
    3939    inline int        getMessageManagerId(){ return remoteState.messageManagerId; }
    4040    inline void       doReject( std::string reason ){ localState.error = 1; localState.errorString = "the server rejected your connection ["+ reason +"]"; }
     41    inline std::string getErrorString(){ return remoteState.errorString; }
    4142   
    4243    virtual void varChangeHandler( std::list<int> & id );
  • branches/network/src/lib/network/network_stream.cc

    r7776 r7777  
    341341            handleNewClient( it->second.userId );
    342342
    343           PRINT(0)("handshake finished id=%d\n", it->second.handshake->getNetworkGameManagerId());
     343          PRINTF(0)("handshake finished id=%d\n", it->second.handshake->getNetworkGameManagerId());
    344344
    345345          delete it->second.handshake;
     
    349349        else
    350350        {
    351           PRINT(1)("handshake failed!\n");
     351          PRINTF(1)("handshake failed: %s!\n", it->second.handshake->getErrorString().c_str());
    352352          it->second.socket->disconnectServer();
     353          it->second.socket = NULL;
     354         
     355          delete it->second.handshake;
     356          it->second.handshake = NULL;
    353357        }
    354358      }
     
    422426    }
    423427   
    424     NETPRINTF(n)("adsf\n");
     428    NETPRINTF(0)("adsf\n");
    425429   
    426430    assert( Converter::intToByteArray( offset, buf, INTSIZE ) == INTSIZE );
    427431   
     432    NETPRINTF(0)("adsf %d\n", offset);
     433   
    428434    assert( peer->second.socket->writePacket( buf, offset ) );
     435   
     436    NETPRINTF(0)("adsf\n");
    429437   
    430438    //peer->second.connectionMonitor->processUnzippedOutgoingPacket( buf, offset, currentState );
  • branches/network/src/lib/network/udp_socket.cc

    r7613 r7777  
    1717#include "udp_server_socket.h"
    1818
     19#include "network_log.h"
    1920
    2021void UdpSocket::init( )
     
    151152bool UdpSocket::writePacket( byte * data, int length )
    152153{
     154  NETPRINTF(0)("adsf\n");
    153155  if ( serverSocket )
    154156  {
     157    NETPRINTF(0)("adsf\n");
    155158    NetworkPacket networkPacket;
    156159    networkPacket.length = length;
    157160    networkPacket.data = data;
     161    NETPRINTF(0)("adsf\n");
    158162    if ( !serverSocket->sendPacket( networkPacket, this->userId ) )
    159163    {
     164      NETPRINTF(0)("adsf\n");
    160165      bOk = false;
    161166      return false;
    162167    }
    163168    else
     169    {
     170      NETPRINTF(0)("adsf\n");
    164171      return true;
     172    }
     173    NETPRINTF(0)("adsf\n");
    165174  }
    166175  else
    167176  {
     177    if ( !socket )
     178      return false;
     179   
     180    NETPRINTF(0)("adsf\n");
    168181    assert( length <= packet->maxlen );
    169182   
     183    NETPRINTF(0)("adsf\n");
    170184    memcpy( packet->data, data, length );
     185    NETPRINTF(0)("adsf\n");
    171186    packet->len = length;
    172187   
     188    NETPRINTF(0)("adsf\n");
    173189    if ( SDLNet_UDP_Send( socket, 1, packet) == 0 )
    174190    {
     191      NETPRINTF(0)("adsf\n");
    175192      PRINTF(1)("SDLNet_UDP_Send: %s\n", SDLNet_GetError());
    176193      bOk = false;
     
    178195    }
    179196   
     197    NETPRINTF(0)("adsf\n");
    180198    return true;
    181199  }
     200  NETPRINTF(0)("adsf\n");
    182201}
    183202
Note: See TracChangeset for help on using the changeset viewer.