Changeset 7745
- Timestamp:
- Dec 8, 2010, 5:35:36 PM (14 years ago)
- Location:
- code/branches/presentation/src/libraries/network
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation/src/libraries/network/MasterServerComm.cc
r7739 r7745 87 87 if (this->peer == NULL ) 88 88 { COUT(2) << "ERROR: No available peers for initiating an ENet connection.\n"; 89 //exit (EXIT_FAILURE);90 89 return -1; 91 90 } … … 94 93 if (enet_host_service (this->client, this->event, 2000) > 0 && 95 94 this->event->type == ENET_EVENT_TYPE_CONNECT ) 96 fprintf( stdout, "Connection to server succeeded." );95 COUT(3) << "Connection to master server succeeded.\n"; 97 96 else 98 97 { 99 98 enet_peer_reset (this->peer); 100 99 fprintf( stdout, "Connection to %s failed.", address ); 101 //exit(EXIT_FAILURE);100 COUT(2) << "ERROR: connection to " << address << " failed.\n"; 102 101 return -1; 103 102 } -
code/branches/presentation/src/libraries/network/MasterServerComm.h
r7739 r7745 26 26 * 27 27 */ 28 29 #ifndef MASTERSERVERCOMM_H 30 #define MASTERSERVERCOMM_H 28 31 29 32 #include <cstdlib> … … 95 98 96 99 } 100 101 #endif /* MASTERSERVERCOMM_H */ -
code/branches/presentation/src/libraries/network/Server.cc
r7740 r7745 60 60 #include "FunctionCallManager.h" 61 61 #include "GamestateManager.h" 62 #include "WANDiscovery.h" 62 63 63 64 namespace orxonox … … 110 111 111 112 /* connect and see if it worked */ 112 if( msc.connect( MS_ADDRESS, ORX_MSERVER_PORT ) ) 113 if( msc.connect( WANDiscovery::getInstance().getMSAddress().c_str(), 114 ORX_MSERVER_PORT ) ) 113 115 { COUT(1) << "Error: could not connect to master server!\n"; 114 116 return; -
code/branches/presentation/src/libraries/network/WANDiscovery.h
r7739 r7745 1 1 /* 2 * ORXONOX - the hottest 3D action shooter ever to exist 3 * > www.orxonox.net < 2 * ORXONOX - the hottest 3D action shooter ever to exist > www.orxonox.net < 4 3 * 5 4 * 6 5 * License notice: 7 6 * 8 * This program is free software; you can redistribute it and/or 9 * modify it under the terms of the GNU General Public License10 * as published by the Free Software Foundation; either version 211 * of the License, or (at your option)any later version.7 * This program is free software; you can redistribute it and/or modify it 8 * under the terms of the GNU General Public License as published by the Free 9 * Software Foundation; either version 2 of the License, or (at your option) 10 * any later version. 12 11 * 13 * This program is distributed in the hope that it will be useful, 14 * but WITHOUT ANY WARRANTY; without even the implied warranty of15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the16 * GNU General Public Licensefor more details.12 * This program is distributed in the hope that it will be useful, but 13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 14 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 15 * for more details. 17 16 * 18 * You should have received a copy of the GNU General Public License 19 * along with this program; if not, write to the Free Software20 * F oundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.17 * You should have received a copy of the GNU General Public License along 18 * with this program; if not, write to the Free Software Foundation, Inc., 51 19 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 21 20 * 22 * Author: 23 * Fabian 'x3n' Landau (original) 24 * Co-authors: 25 * Sandro 'smerkli' Merkli (copied and adapted to WAN) 21 * Author: Fabian 'x3n' Landau (original) Co-authors: Sandro 'smerkli' Merkli 22 * (copied and adapted to WAN) 26 23 * 27 24 */ 28 25 29 #ifndef WANDISCOVERY_H 26 #ifndef WANDISCOVERY_H 30 27 #define WANDISCOVERY_H 31 28 … … 59 56 /** destructor */ 60 57 ~WANDiscovery(); 58 59 /** get content of msaddress */ 60 std::string getMSAddress() 61 { return this->msaddress; } 61 62 62 63 /** ask server for server list */ -
code/branches/presentation/src/libraries/network/packet/ServerInformation.cc
r7461 r7745 58 58 char* ack = new char[strlen(LAN_DISCOVERY_ACK)+1]; 59 59 loadAndIncrease((char*&)ack, temp); 60 assert(strcmp(ack, (const char*)LAN_DISCOVERY_ACK)==0); 60 61 /* Fabian, what is this used for? it crashes the masterserver, hence commenting it */ 62 //assert(strcmp(ack, (const char*)LAN_DISCOVERY_ACK)==0); 63 61 64 // Save Server Name 62 65 loadAndIncrease(this->serverName_, temp);
Note: See TracChangeset
for help on using the changeset viewer.