Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6868 in orxonox.OLD for trunk/src/lib


Ignore:
Timestamp:
Jan 30, 2006, 4:41:19 PM (18 years ago)
Author:
bensch
Message:

orxonox/trunk: merged the Network back to the trunk.
merged with command
svn merge https://svn.orxonox.net/orxonox/branches/network . -r6817:HEAD
no conflicts

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

Legend:

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

    r6815 r6868  
    575575    if ( (*it)->getUniqueID() == uniqueID )
    576576    {
    577       delete *it;
     577      assert((*it)->isA(CL_WORLD_ENTITY));
     578      dynamic_cast<WorldEntity*>(*it)->toList(OM_DEAD);
    578579      break;
    579580    }
  • trunk/src/lib/network/network_stream.cc

    r6737 r6868  
    263263        if ( reciever!=0 )
    264264        {
    265           if ( networkSockets[reciever] != NULL )
    266           {
    267             PRINTF(5)("write %d bytes to socket %d\n", dataLength, reciever);
    268             networkSockets[reciever]->writePacket(downBuffer, dataLength);
     265          if ( reciever < 0)
     266          {
     267            for ( int i = 0; i<networkSockets.size(); i++)
     268            {
     269              if ( i!=-reciever && networkSockets[i] != NULL )
     270              {
     271                PRINTF(5)("write %d bytes to socket %d\n", dataLength, i);
     272                networkSockets[i]->writePacket(downBuffer, dataLength);
     273              }
     274            }
    269275          }
    270276          else
    271277          {
    272             PRINTF(1)("networkSockets[reciever] == NULL\n");
     278            if ( networkSockets[reciever] != NULL )
     279            {
     280              PRINTF(5)("write %d bytes to socket %d\n", dataLength, reciever);
     281              networkSockets[reciever]->writePacket(downBuffer, dataLength);
     282            }
     283            else
     284            {
     285              PRINTF(1)("networkSockets[reciever] == NULL\n");
     286            }
    273287          }
    274288        }
  • trunk/src/lib/network/synchronizeable.h

    r6815 r6868  
    3333  NWT_SS_VELY,
    3434  NWT_SS_VELZ,
     35  NWT_SS_PL_SYNC,
    3536 
    3637  NWT_HS_HOST_ID,
    3738  NWT_HS_NGM_ID,
     39 
     40  NWT_PL_FLAGS,
    3841 
    3942  NWT_PN_BO_WRITESTATE,
     
    101104 * with the same argument names!
    102105 *
     106 * id is one int out of that enum on top of this comment it is used to identify
     107 * read/write. when you read a value you have to use exactly the same as you used
     108 * to write or you will see an assertion failing.
     109 *
    103110 * SYNCHELP_WRITE_BEGIN()
    104  * SYNCHELP_WRITE_INT(i)
    105  * SYNCHELP_WRITE_FLOAT(f)
    106  * SYNCHELP_WRITE_BYTE(b)
    107  * SYNCHELP_WRITE_STRING(s)
     111 * SYNCHELP_WRITE_INT(i,id)
     112 * SYNCHELP_WRITE_FLOAT(f,id)
     113 * SYNCHELP_WRITE_BYTE(b,id)
     114 * SYNCHELP_WRITE_STRING(s,id)
    108115 * SYNCHELP_WRITE_N
    109116 *
    110117 * SYNCHELP_READ_BEGIN()
    111  * SYNCHELP_READ_INT(i)
    112  * SYNCHELP_READ_FLOAT(f)
    113  * SYNCHELP_READ_STRING(s,l) l = size of buffer s
    114  * SYNCHELP_READ_STRINGM(s)  allocates memory for string! you have to free this after
    115  * SYNCHELP_READ_BYTE(b)
     118 * SYNCHELP_READ_INT(i,id)
     119 * SYNCHELP_READ_FLOAT(f,id)
     120 * SYNCHELP_READ_STRING(s,l,id) l = size of buffer s
     121 * SYNCHELP_READ_STRINGM(s,id)  allocates memory for string! you have to delete this later
     122 * SYNCHELP_READ_BYTE(b,id)
     123 * SYNCHELP_READ_REMAINING() returns the remaining buffer size
     124 * SYNCHELP_READ_NEXTBYTE()  reads the next byte but it is not removed from the buffer
    116125 * SYNCHELP_READ_N
    117126 *
     
    122131 *  SYNCHELP_READ_FLOAT(size);
    123132 *  SYNCHELP_READ_STRING( textureName, 1024 ); //1024 is the length of textureName
     133 *  delete[] textureName;
     134 *  textureName = NULL;
     135 *  SYNCHELP_READ_STRINGM( texturename );      //this will call new char[strlen()+1]
    124136 *
    125137 * Example 2:
     
    130142 *
    131143 */
     144 
    132145#define SYNCHELP_WRITE_DEBUG(n) {\
    133146  __synchelp_write_n = Converter::intToByteArray( n, data+__synchelp_write_i, maxLength-__synchelp_write_i ); \
Note: See TracChangeset for help on using the changeset viewer.