Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9656 in orxonox.OLD for trunk/src/subprojects


Ignore:
Timestamp:
Aug 4, 2006, 11:01:28 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the proxy bache back with no conflicts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/subprojects/network/network_unit_test.cc

    r9494 r9656  
    5252    server1 = server.getNewSocket();
    5353  }
    54  
     54
    5555  assert( server1->isOk() );
    5656
     
    8686  printf("%d bytes send from server2\n", n);
    8787  SDL_Delay(10);
    88  
     88
    8989  server.update();
    9090
     
    120120
    121121  printf("data: '%s'\n", buf);
    122  
    123  
     122
     123
    124124  //22222222222222222222222222222222222222222
    125125  n = client1->writePacket((byte*)str1, strlen(str1)+1);
     
    132132  printf("%d bytes send from server2\n", n);
    133133  SDL_Delay(10);
    134  
     134
    135135  server.update();
    136136
     
    181181  delete client2;
    182182  delete server1;
    183   delete server2; 
    184  
     183  delete server2;
     184
    185185  return 0;
    186186}
     
    238238}
    239239
    240 bool testCB( MessageId messageId, byte * data, int dataLength, void * someData, int userId )
     240bool testCB( MessageType messageType, byte * data, int dataLength, void * someData, int userId )
    241241{
    242242  printf("GOT MESSAGE: %s\n", data);
     
    259259
    260260  NetworkManager* netMan = NetworkManager::getInstance();
    261  
     261
    262262  netMan->initialize();
    263  
     263
    264264  netMan->createMasterServer(/**ss, */ 9999);
    265  
     265
    266266  SimpleSync* ss = new SimpleSync("Server");
    267267  ss->setSynchronized( true );
    268  
     268
    269269  NetworkLog::getInstance()->listen( 8888 );
    270270
    271271  //MessageManager::getInstance()->initUser( 1 );
    272272  MessageManager::getInstance()->registerMessageHandler( TESTMESSAGEID, testCB, NULL );
    273  
     273
    274274  SDL_Delay(20);
    275275
    276276  for(;;)
    277277  {
    278     MessageManager::getInstance()->sendMessage( TESTMESSAGEID, (byte*)"server to client", 18, RT_ALL_BUT_ME, 0, MP_HIGHBANDWIDTH );
     278    MessageManager::getInstance()->sendMessage( TESTMESSAGEID, (byte*)"server to client", 18, RT_ALL_BUT_ME, NET_UNASSIGNED, MP_HIGHBANDWIDTH );
    279279    netMan->synchronize( 100 );
    280280    SDL_Delay(100);
     
    296296  State::setOnline(true);
    297297  NetworkManager* netMan = NetworkManager::getInstance();
    298  
     298
    299299
    300300  netMan->initialize();
    301  
     301
    302302  std::string host;
    303  
     303
    304304  if ( argc > 2 )
    305305    host = argv[2];
    306306  else
    307307    host = "localhost";
    308  
     308
    309309  netMan->createClient(host, 9999);
    310  
     310
    311311//  SimpleSync* ss = new SimpleSync("SimpleSync");
    312312//  ss->setSynchronized( true );
    313313//  netMan->connectSynchronizeable( *ss );
    314  
     314
    315315  NetworkLog::getInstance()->listen( 7777 );
    316316
    317317  SimpleSync * ss = NULL;
    318  
     318
    319319  //MessageManager::getInstance()->initUser( 0 );
    320320  MessageManager::getInstance()->registerMessageHandler( TESTMESSAGEID, testCB, NULL );
    321  
     321
    322322  for(;;)
    323323  {
    324324    netMan->synchronize( 100 );
    325     MessageManager::getInstance()->sendMessage( TESTMESSAGEID, (byte*)"client to server", 18, RT_ALL_BUT_ME, 0, MP_HIGHBANDWIDTH );
     325    MessageManager::getInstance()->sendMessage( TESTMESSAGEID, (byte*)"client to server", 18, RT_ALL_BUT_ME, NET_UNASSIGNED, MP_HIGHBANDWIDTH );
    326326    ss = dynamic_cast<SimpleSync*>(ClassList::getObject( "Server", CL_SIMPLE_SYNC ) );
    327327    SDL_Delay(100);
Note: See TracChangeset for help on using the changeset viewer.