Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7681 in orxonox.OLD for branches/network/src/subprojects


Ignore:
Timestamp:
May 18, 2006, 2:32:47 PM (19 years ago)
Author:
rennerc
Message:

finished and tested MessageManager

File:
1 edited

Legend:

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

    r7631 r7681  
    1616#include "state.h"
    1717#include "shared_network_data.h"
     18#include "message_manager.h"
    1819
    1920#include "simple_sync.h"
     
    236237}
    237238
    238 
     239void testCB( MessageId messageId, byte * data, int dataLength, void * someData, int userId )
     240{
     241  printf("GOT MESSAGE: %s\n", data);
     242}
    239243
    240244/**
     
    261265  ss->setSynchronized( true );
    262266
     267  //MessageManager::getInstance()->initUser( 1 );
     268  MessageManager::getInstance()->registerMessageHandler( TESTMESSAGEID, testCB, NULL );
    263269 
    264270  SDL_Delay(20);
     
    266272  for(;;)
    267273  {
     274    MessageManager::getInstance()->sendMessage( TESTMESSAGEID, (byte*)"server to client", 18, RT_ALL, 0, MP_HIGHBANDWIDTH );
    268275    netMan->synchronize();
    269276    SDL_Delay(1000);
     
    299306  SimpleSync * ss = NULL;
    300307 
     308  //MessageManager::getInstance()->initUser( 0 );
     309  MessageManager::getInstance()->registerMessageHandler( TESTMESSAGEID, testCB, NULL );
     310 
    301311  for(;;)
    302312  {
    303313    netMan->synchronize();
     314    MessageManager::getInstance()->sendMessage( TESTMESSAGEID, (byte*)"client to server", 18, RT_ALL, 0, MP_HIGHBANDWIDTH );
    304315    ss = dynamic_cast<SimpleSync*>(ClassList::getObject( "Server", CL_SIMPLE_SYNC ) );
    305316    SDL_Delay(1000);
Note: See TracChangeset for help on using the changeset viewer.