Changeset 6275 in orxonox.OLD for branches/network/src/world_entities/skybox.cc
- Timestamp:
- Dec 24, 2005, 2:15:49 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/network/src/world_entities/skybox.cc
r6273 r6275 218 218 setIsOutOfSync( false ); 219 219 220 int flsize = Converter::byteArrayToFloat( data, &size ); 221 Converter::byteArrayToString( data+flsize, textureName, length-flsize ); 222 223 PRINT(0)("GOT DATA: size=%f texture=%s\n", size, textureName); 220 /*int flsize = Converter::byteArrayToFloat( data, &size ); 221 Converter::byteArrayToString( data+flsize, textureName, length-flsize );*/ 222 223 SYNCHELP_READ_BEGIN(); 224 SYNCHELP_READ_FLOAT(size); 225 SYNCHELP_READ_STRING( textureName, 1024 ); 226 227 //PRINT(0)("GOT DATA: size=%f texture=%s\n", size, textureName); 224 228 225 229 this->setSize( size ); … … 228 232 } 229 233 234 235 230 236 int SkyBox::readBytes( byte * data, int maxLength, int * reciever ) 231 237 { 232 238 if ( isOutOfSync() && !requestedSync() && this->getHostID()!=this->getOwner() ) 233 239 { 234 PRINTF(0)("Requesting sync! %d\n", this->getUniqueID());240 //PRINTF(0)("Requesting sync! %d\n", this->getUniqueID()); 235 241 (NetworkGameManager::getInstance())->sync( this->getUniqueID(), this->getOwner() ); 236 242 setRequestedSync( true ); … … 240 246 if ( rec > 0 ) 241 247 { 242 PRINTF(0)("Serving client %d which requested sync %d size=%f texture=%s\n", rec, this->getUniqueID(), this->size, this->textureName);248 //PRINTF(0)("Serving client %d which requested sync %d size=%f texture=%s\n", rec, this->getUniqueID(), this->size, this->textureName); 243 249 *reciever = rec; 244 250 245 int flsize = Converter::floatToByteArray( this->size, data, maxLength ); 246 247 if ( flsize <= 0 ) 248 { 249 PRINTF(1)("Byte array is too small (%d) to store float\n", maxLength ); 250 return 0; 251 } 252 253 if ( strlen(textureName)+INTSIZE+flsize > maxLength ) 254 { 255 PRINTF(1)("Byte array is too small (%d) to store data\n", maxLength ); 256 return 0; 257 } 258 259 return flsize + Converter::stringToByteArray( textureName, data+flsize, strlen(textureName), maxLength-flsize ); 260 251 SYNCHELP_WRITE_BEGIN(); 252 SYNCHELP_WRITE_FLOAT(this->size); 253 SYNCHELP_WRITE_STRING(this->textureName); 254 255 return SYNCHELP_WRITE_N; 261 256 } 262 257
Note: See TracChangeset
for help on using the changeset viewer.