Changeset 10765 for code/branches/cpp11_v2/src/libraries/network
- Timestamp:
- Nov 4, 2015, 10:25:42 PM (9 years ago)
- Location:
- code/branches/cpp11_v2/src/libraries/network
- Files:
-
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/network/ClientConnection.cc
r8858 r10765 44 44 Connection(NETWORK_PEER_ID_SERVER), 45 45 established_(false), 46 server_( NULL)46 server_(nullptr) 47 47 { 48 48 this->serverAddress_ = new ENetAddress(); … … 72 72 73 73 // create host 74 this->host_ = enet_host_create( NULL, NETWORK_CLIENT_MAX_CONNECTIONS, NETWORK_CHANNEL_COUNT, 0, 0);74 this->host_ = enet_host_create(nullptr, NETWORK_CLIENT_MAX_CONNECTIONS, NETWORK_CHANNEL_COUNT, 0, 0); 75 75 76 if ( this->host_ == NULL)76 if ( this->host_ == nullptr ) 77 77 { 78 orxout(internal_error, context::network) << "ClientConnection: host_ == NULL" << endl;78 orxout(internal_error, context::network) << "ClientConnection: host_ == nullptr" << endl; 79 79 // error handling 80 80 return false; … … 93 93 94 94 this->server_ = enet_host_connect(this->host_, serverAddress_, NETWORK_CHANNEL_COUNT, 0); 95 if ( this->server_== NULL)95 if ( this->server_==nullptr ) 96 96 { 97 orxout(internal_error, context::network) << "ClientConnection: server_ == NULL" << endl;97 orxout(internal_error, context::network) << "ClientConnection: server_ == nullptr" << endl; 98 98 // error handling 99 99 return false; -
code/branches/cpp11_v2/src/libraries/network/FunctionCall.cc
r10624 r10765 48 48 bool FunctionCall::execute(){ 49 49 NetworkFunctionBase* fct = NetworkFunctionManager::getInstance().getFunctionByNetworkId( this->functionID_ ); 50 assert( fct != NULL);50 assert( fct != nullptr ); 51 51 assert( this->nrOfArguments_==this->arguments_.size() ); 52 52 switch(this->nrOfArguments_) -
code/branches/cpp11_v2/src/libraries/network/LANDiscoverable.cc
r10622 r10765 85 85 assert( this->host_ == 0 ); 86 86 this->host_ = enet_host_create( &bindAddress, 10, 0, 0, 0 ); 87 if ( this->host_ == NULL)88 orxout(internal_error, context::network) << "LANDiscoverable: host_ == NULL" << endl;87 if ( this->host_ == nullptr ) 88 orxout(internal_error, context::network) << "LANDiscoverable: host_ == nullptr" << endl; 89 89 } 90 90 else -
code/branches/cpp11_v2/src/libraries/network/LANDiscovery.cc
r10624 r10765 42 42 LANDiscovery::LANDiscovery() 43 43 { 44 this->host_ = enet_host_create( NULL, 10, 0, 0, 0 );45 if ( this->host_ == NULL)46 orxout(internal_error, context::network) << "LANDiscovery: host_ == NULL" << endl;44 this->host_ = enet_host_create(nullptr, 10, 0, 0, 0 ); 45 if ( this->host_ == nullptr ) 46 orxout(internal_error, context::network) << "LANDiscovery: host_ == nullptr" << endl; 47 47 } 48 48 49 49 LANDiscovery::~LANDiscovery() 50 50 { 51 if (this->host_ != NULL)51 if (this->host_ != nullptr) 52 52 enet_host_destroy(this->host_); 53 53 } … … 65 65 address.host = ENET_HOST_BROADCAST; 66 66 peer = enet_host_connect(this->host_, &address, 0, 0); 67 if (peer == NULL)67 if (peer == nullptr) 68 68 orxout(internal_error, context::network) << "Could not send LAN discovery to IPv4 Broadcast." << endl; 69 69 … … 71 71 enet_address_set_host(&address, "ff02::1"); // TODO: use a multicast group 72 72 peer = enet_host_connect(this->host_, &address, 0, 0); 73 if (peer == NULL)73 if (peer == nullptr) 74 74 orxout(internal_error, context::network) << "Could not send LAN discovery to IPv6 Multicast." << endl; 75 75 -
code/branches/cpp11_v2/src/libraries/network/MasterServer.cc
r10624 r10765 43 43 44 44 /* forward declaration so the linker doesn't complain */ 45 MasterServer *MasterServer::instance = NULL;45 MasterServer *MasterServer::instance = nullptr; 46 46 47 47 /* command: list servers */ … … 345 345 /***** ENTER MAIN LOOP *****/ 346 346 ENetEvent *event = (ENetEvent *)calloc(sizeof(ENetEvent), sizeof(char)); 347 if( event == NULL)347 if( event == nullptr ) 348 348 { 349 349 orxout(user_error, context::master_server) << "Could not create ENetEvent structure, exiting." << endl; -
code/branches/cpp11_v2/src/libraries/network/MasterServerComm.cc
r8858 r10765 54 54 55 55 /* initiate the client */ 56 this->client = enet_host_create( NULL/* create a client host */,56 this->client = enet_host_create( nullptr /* create a client host */, 57 57 1, 58 58 2, /* allow up 2 channels to be used, 0 and 1 */ … … 61 61 62 62 /* see if it worked */ 63 if (this->client == NULL)63 if (this->client == nullptr) 64 64 { orxout(internal_error, context::master_server) << "An error occurred while trying to create an " 65 65 << "ENet client host." << endl; … … 85 85 this->peer = enet_host_connect(this->client, &this->address, 2, 0); 86 86 87 if( this->peer == NULL)87 if( this->peer == nullptr ) 88 88 { orxout(internal_error, context::master_server) << "No available peers for initiating an ENet" 89 89 << " connection." << endl; … … 157 157 158 158 /* address buffer */ 159 char *addrconv = NULL;159 char *addrconv = nullptr; 160 160 int retval = 0; 161 161 … … 193 193 194 194 /* call the supplied callback, if any. */ 195 if( listener != NULL)195 if( listener != nullptr ) 196 196 retval = listener->rhandler( addrconv, &(this->event) ); 197 197 -
code/branches/cpp11_v2/src/libraries/network/NetworkFunctionManager.cc
r10624 r10765 71 71 return it->second; 72 72 else 73 return NULL;73 return nullptr; 74 74 } 75 75 -
code/branches/cpp11_v2/src/libraries/network/PeerList.cc
r10622 r10765 41 41 PeerList::addPeer( ENetPeer *toadd ) 42 42 { /* error correction */ 43 if( toadd == NULL)43 if( toadd == nullptr ) 44 44 { orxout(internal_error, context::master_server) << "PeerList::addPeer: empty peer given." << endl; 45 45 return -1; … … 92 92 93 93 /* not found */ 94 return NULL;94 return nullptr; 95 95 } 96 96 -
code/branches/cpp11_v2/src/libraries/network/Server.cc
r10622 r10765 244 244 { 245 245 // ClientInformation *temp = ClientInformation::getBegin(); 246 // if( temp == NULL)246 // if( temp == nullptr ) 247 247 //no client connected 248 248 if( this->clientIDs_.size()==0 ) … … 255 255 } 256 256 // orxout(verbose, context::network) << "sending DeleteObjects" << endl; 257 // while(temp != NULL){257 // while(temp != nullptr){ 258 258 // if( !(temp->getSynched()) ) 259 259 // { -
code/branches/cpp11_v2/src/libraries/network/ServerConnection.cc
r8858 r10765 73 73 this->host_ = enet_host_create(this->bindAddress_, NETWORK_MAX_CONNECTIONS, NETWORK_CHANNEL_COUNT, 0, 0); 74 74 75 if ( this->host_ == NULL)75 if ( this->host_ == nullptr ) 76 76 { 77 orxout(internal_error, context::network) << "ServerConnection: host_ == NULL" << endl;77 orxout(internal_error, context::network) << "ServerConnection: host_ == nullptr" << endl; 78 78 return false; 79 79 } -
code/branches/cpp11_v2/src/libraries/network/packet/ClassID.cc
r9667 r10765 58 58 for(;it != IdentifierManager::getInstance().getIdentifierByStringMap().end();++it){ 59 59 id = it->second; 60 if(id == NULL|| !id->hasFactory())60 if(id == nullptr || !id->hasFactory()) 61 61 continue; 62 62 const std::string& classname = id->getName(); … … 144 144 id=ClassByString( std::string((const char*)classname) ); 145 145 orxout(internal_info, context::packets) << "processing classid: " << networkID << " name: " << classname << " id: " << id << endl; 146 if(id== NULL){146 if(id==nullptr){ 147 147 orxout(user_error, context::packets) << "Received a bad classname" << endl; 148 148 abort(); -
code/branches/cpp11_v2/src/libraries/network/packet/Gamestate.cc
r9667 r10765 608 608 609 609 if(dest_length==0) 610 return NULL;610 return nullptr; 611 611 612 612 uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()]; … … 645 645 646 646 if(dest_length==0) 647 return NULL;647 return nullptr; 648 648 649 649 uint8_t *ndata = new uint8_t[dest_length*sizeof(uint8_t)+GamestateHeader::getSize()]; -
code/branches/cpp11_v2/src/libraries/network/packet/Packet.cc
r8858 r10765 122 122 // Destroy the ENetPacket if necessary. 123 123 // Note: For the case ENet used the callback to destroy the packet, we have already set 124 // enetPacket_ to NULLto avoid destroying it again.124 // enetPacket_ to nullptr to avoid destroying it again. 125 125 if (this->enetPacket_) 126 126 { -
code/branches/cpp11_v2/src/libraries/network/synchronisable/Synchronisable.cc
r10624 r10765 105 105 uint32_t Synchronisable::findContextID(Context* context) 106 106 { 107 if (context == NULL)107 if (context == nullptr) 108 108 return OBJECTID_UNKNOWN; 109 109 110 110 Synchronisable* synchronisableContext = orxonox_cast<Synchronisable*>(context); 111 if (synchronisableContext != NULL)111 if (synchronisableContext != nullptr) 112 112 return synchronisableContext->getObjectID(); 113 113 else … … 226 226 return it1->second; 227 227 // if the objects not in the map it should'nt exist at all anymore 228 return NULL;228 return nullptr; 229 229 } 230 230
Note: See TracChangeset
for help on using the changeset viewer.