Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 6337 in orxonox.OLD for branches/network/src/lib/lang/base_object.cc


Ignore:
Timestamp:
Dec 30, 2005, 1:32:46 AM (18 years ago)
Author:
rennerc
Message:

groundturret now scales correctly on client

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/network/src/lib/lang/base_object.cc

    r6275 r6337  
    2222#include "compiler.h"
    2323#include "class_list.h"
     24
     25#include "synchronizeable.h"
    2426
    2527using namespace std;
     
    194196      PRINT(0)(" -Weapon-");
    195197    PRINT(0)("\n");
    196 }
    197 }
     198  }
     199}
     200
     201/**
     202 * Writes data from network containing information about the state
     203 * @param data pointer to data
     204 * @param length length of data
     205 * @param sender hostID of sender
     206 */
     207int BaseObject::writeState( const byte * data, int length, int sender )
     208{
     209  SYNCHELP_READ_BEGIN();
     210
     211  if ( objectName )
     212  {
     213    delete[] objectName;
     214    objectName = NULL;
     215  }
     216  SYNCHELP_READ_STRINGM( this->objectName );
     217
     218  return SYNCHELP_READ_N;
     219}
     220
     221/**
     222 * data copied in data will bee sent to another host
     223 * @param data pointer to data
     224 * @param maxLength max length of data
     225 * @return the number of bytes writen
     226 */
     227int BaseObject::readState( byte * data, int maxLength )
     228{
     229  SYNCHELP_WRITE_BEGIN();
     230
     231  SYNCHELP_WRITE_STRING( this->objectName );
     232
     233  return SYNCHELP_WRITE_N;
     234}
Note: See TracChangeset for help on using the changeset viewer.