Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6665 in orxonox.OLD for branches/network


Ignore:
Timestamp:
Jan 24, 2006, 1:36:11 PM (19 years ago)
Author:
patrick
Message:

network: changed network signal namings and added a new one

Location:
branches/network/src/lib/network
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/network/network_game_manager.cc

    r6662 r6665  
    8484    if ( isServer() )
    8585    {
    86       if ( b == REQUEST_CREATE )
     86      if ( b == NET_REQUEST_CREATE )
    8787      {
    8888        if ( !handleRequestCreate( i, data, length, sender ) )
     
    9090        continue;
    9191      }
    92       if ( b == REQUEST_REMOVE )
     92      if ( b == NET_REQUEST_REMOVE )
    9393      {
    9494        if ( !handleRequestRemove( i, data, length, sender ) )
     
    9999    else
    100100    {
    101       if ( b == CREATE_ENTITY )
     101      if ( b == NET_CREATE_ENTITY )
    102102      {
    103103        PRINTF(0)("CREATE_ENTITY\n");
     
    106106        continue;
    107107      }
    108       if ( b == REMOVE_ENTITY )
     108      if ( b == NET_REMOVE_ENTITY )
    109109      {
    110110        if ( !handleRemoveEntity( i, data, length, sender ) )
     
    112112        continue;
    113113      }
    114       if ( b == CREATE_ENTITY_LIST )
     114      if ( b == NET_CREATE_ENTITY_LIST )
    115115      {
    116116        if ( !handleCreateEntityList( i, data, length, sender ) )
     
    118118        continue;
    119119      }
    120       if ( b == REMOVE_ENTITY_LIST )
     120      if ( b == NET_REMOVE_ENTITY_LIST )
    121121      {
    122122        if ( !handleRemoveEntityList( i, data, length, sender ) )
     
    124124        continue;
    125125      }
    126       if ( b == YOU_ARE_ENTITY )
     126      if ( b == NET_YOU_ARE_ENTITY )
    127127      {
    128128        if ( !handleYouAreEntity( i, data, length, sender ) )
     
    132132    }
    133133
    134     if ( b == REQUEST_ENTITY_LIST )
     134    if ( b == NET_REQUEST_ENTITY_LIST )
    135135    {
    136136      sendEntityList( sender );
     
    138138    }
    139139
    140     if ( b == REQUEST_SYNC )
     140    if ( b == NET_REQUEST_SYNC )
    141141    {
    142142      if ( !handleRequestSync( i, data, length, sender ) )
     
    261261  }
    262262  else
     263
    263264  {
    264265    PRINTF(1)("This node is not a server and cannot create id %x\n", element->Value());
     
    298299      continue;
    299300
    300     if ( !writeToClientBuffer( outBuffer[i], (byte)REQUEST_CREATE ) )
     301    if ( !writeToClientBuffer( outBuffer[i], (byte)NET_REQUEST_CREATE ) )
    301302      return;
    302303    if ( !writeToClientBuffer( outBuffer[i], (int)classID ) )
     
    316317      continue;
    317318
    318     if ( !writeToClientBuffer( outBuffer[i], (byte)REQUEST_REMOVE ) )
     319    if ( !writeToClientBuffer( outBuffer[i], (byte)NET_REQUEST_REMOVE ) )
    319320      return;
    320321    if ( !writeToClientBuffer( outBuffer[i], uniqueID ) )
     
    335336      continue;
    336337
    337     if ( !writeToClientBuffer( outBuffer[i], (byte)CREATE_ENTITY ) )
     338    if ( !writeToClientBuffer( outBuffer[i], (byte)NET_CREATE_ENTITY ) )
    338339      return -1;
    339340    if ( !writeToClientBuffer( outBuffer[i], (int)classID ) )
     
    362363      continue;
    363364
    364     if ( !writeToClientBuffer( outBuffer[i], (byte)REMOVE_ENTITY ) )
     365    if ( !writeToClientBuffer( outBuffer[i], (byte)NET_REMOVE_ENTITY ) )
    365366      return;
    366367    if ( !writeToClientBuffer( outBuffer[i], uniqueID ) )
     
    397398  e = this->networkStream->getSyncEnd();
    398399
    399   if ( !writeToClientBuffer( outBuffer[userID], (byte)CREATE_ENTITY_LIST ) )
     400  if ( !writeToClientBuffer( outBuffer[userID], (byte)NET_CREATE_ENTITY_LIST ) )
    400401    return;
    401402
     
    485486    s->setUniqueID( uniqueID );
    486487    s->setOwner( owner );
     488    s->setSynchronized(true);
    487489    //this->networkStream->connectSynchronizeable( *s );
    488490    if ( !isServer() )
  • branches/network/src/lib/network/network_game_manager.h

    r6634 r6665  
    1919 * protocol definition
    2020 *
    21  *  CREATE_ENTITY:       CLASS_ID, UNIQUE_ID, OWNER
    22  *  REMOVE_ENTITY:       UNIQUE_ID
     21 *  CREATE_ENTITY:       >> CLASS_ID, UNIQUE_ID, OWNER
     22 *  REMOVE_ENTITY:       >> UNIQUE_ID
    2323 *
    24  *  CREATE_ENTITY_LIST:  NUMBER, [CLASS_ID, UNIQUE_ID, OWNER][0..NUMBER]
    25  *  REMOVE_ENTITY_LIST:  NUMBER, [UNIQUE_ID][0..NUMBER]
     24 *  CREATE_ENTITY_LIST:  >> NUMBER, [CLASS_ID, UNIQUE_ID, OWNER][0..NUMBER]
     25 *  REMOVE_ENTITY_LIST:  >> NUMBER, [UNIQUE_ID][0..NUMBER]
    2626 *
    27  *  REQUEST_CREATE:      CLASS_ID
    28  *  REQUEST_REMOVE:      UNIQUE_ID
     27 *  REQUEST_CREATE:      >> CLASS_ID
     28 *                       << [Sync Info]
     29 *  REQUEST_REMOVE:      >> UNIQUE_ID
     30 *                       << [Sync Info]
    2931 *
    3032 *  //REQUEST_CREATE_LIST: NUMBER, [CLASS_ID][0..NUMBER]
     
    3234 *
    3335 *  REQUEST_ENTITY_LIST: //request the whole world :D
    34  *  REQUEST_SYNC:        UNIQUE_ID
     36 *  REQUEST_SYNC:        >> UNIQUE_ID
     37 *                       << [Sync Info]
    3538 *  //REQUEST_SYNC_LIST:   NUMBER, [UNIQUE_ID][0..NUMBER]
    3639 *
    37  *  YOU_ARE_ENTITY:      UNIQUE_ID
     40 *  YOU_ARE_ENTITY:      >> UNIQUE_ID
     41 *
     42 *  REQUEST_PNODE_PATH   >> UNIQUE_ID_START   UNIQUE_ID_STOP
     43 *                       << UNIQUE_ID_1   UNIQUE_ID_2   UNIQUE_ID_3 ...   UNIQUE_ID_N
    3844 *
    3945 */
    4046
    4147typedef enum NetworkGameManagerProtocol{
    42   CREATE_ENTITY = 0,
    43   REMOVE_ENTITY,
    44   CREATE_ENTITY_LIST,
    45   REMOVE_ENTITY_LIST,
    46   REQUEST_CREATE,
    47   REQUEST_REMOVE,
    48   REQUEST_SYNC,
    49   YOU_ARE_ENTITY,
    50   REQUEST_ENTITY_LIST
     48  NET_CREATE_ENTITY = 0,
     49  NET_REMOVE_ENTITY,
     50  NET_CREATE_ENTITY_LIST,
     51  NET_REMOVE_ENTITY_LIST,
     52  NET_REQUEST_CREATE,
     53  NET_REQUEST_REMOVE,
     54  NET_REQUEST_SYNC,
     55  NET_YOU_ARE_ENTITY,
     56  NET_REQUEST_ENTITY_LIST,
     57  NET_REQUEST_PNODE_PATH,
     58
     59  NET_NUMBER
    5160};
    5261
  • branches/network/src/lib/network/network_manager.cc

    r6662 r6665  
    163163      if( static_cast<NetworkStream*>(*stream)->isActive())
    164164        static_cast<NetworkStream*>(*stream)->processData();
    165 
    166165  }
    167 
    168166}
    169167
Note: See TracChangeset for help on using the changeset viewer.