- Timestamp:
- Apr 21, 2011, 4:01:44 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/masterserver2/src/libraries/network/MasterServer.cc
r8242 r8280 38 38 /* commands for the terminal interface */ 39 39 SetConsoleCommand( "ms-listservers", &MasterServer::listServers ); 40 //SetConsoleCommand( "ms-delserver", &MasterServer::delServer );40 SetConsoleCommand( "ms-delserver", &MasterServer::delServer ); 41 41 //SetConsoleCommand( "ms-serverinfo", &MasterServer::serverInfo ); 42 42 … … 67 67 COUT(0) << MasterServer::getInstance()->mainlist.serverlist.size() << 68 68 " servers connected." << std::endl; 69 } 70 71 void 72 MasterServer::delServer( std::string todeladdr ) 73 { 74 /* tell the user we're now removing the entry from the server list */ 75 COUT(0) << "MS: Deleting server \"" << todeladdr << "\"..." 76 << std::endl; 77 78 /* see if we actually have that server on our list */ 79 ServerListSearchResult shandle = 80 MasterServer::getInstance()->mainlist.findServerByAddress(todeladdr); 81 82 if( !shandle.success ) 83 { COUT(0) << "MS: Server not found, not removing." << std::endl; 84 return; 85 } 86 87 /* force-disconnect the server */ 88 enet_peer_disconnect( shandle.result.peer, NULL ); 89 90 /* actually remove the entry from the server list by address */ 91 MasterServer::getInstance()->mainlist.delServerByAddress( todeladdr); 92 93 /* tell the user about our success */ 94 COUT(0) << "MS: Server deletion successful." << std::endl; 69 95 } 70 96 … … 365 391 } 366 392 367 /***** INITIALIZE GAME SERVER AND PEER LISTS *****/368 this->peers = new PeerList();369 370 393 /* set pointer to this instance */ 371 394 MasterServer::setInstance( this );
Note: See TracChangeset
for help on using the changeset viewer.