Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 23, 2005, 5:30:22 PM (18 years ago)
Author:
rennerc
Message:

converter: added functions for strings
network_protocol: length and id are now int
network_game_manager: fixed some more bugs :D
skybox: is loaded on client corectly now :)

File:
1 edited

Legend:

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

    r6139 r6273  
    3030#include "debug.h"
    3131
     32#include "converter.h"
     33
    3234/* using namespace std is default, this needs to be here */
    3335using namespace std;
     
    4143  /* set the class id for the base object */
    4244  this->setClassID(CL_NETWORK_PROTOCOL, "NetworkProtocol");
    43   this->headerLength = sizeof(Header);
     45  this->headerLength = INTSIZE+FLOATSIZE;
    4446}
    4547
     
    7476  //Now create the header
    7577  /* sender ID: FIXME: there will be a better ID (for example unique:D)*/
    76   data[0] = (byte)(source.getUniqueID());
     78  //data[0] = (byte)(source.getUniqueID());
     79  int res = Converter::intToByteArray( source.getUniqueID(), data, bufferLength );
     80
    7781  /* data length*/
    78   data[1] = length;
     82  //data[1] = length;
     83  res = Converter::intToByteArray( length, data+res, bufferLength-res );
    7984
    8085
     
    105110
    106111  /* unique ID */
    107   h.synchronizeableID = data[0];
     112  //h.synchronizeableID = data[0];
     113  int res = Converter::byteArrayToInt( data, &(h.synchronizeableID) );
    108114  /* data length*/
    109   h.length = data[1];
     115  //h.length = data[1];
     116  Converter::byteArrayToInt( data+res, &(h.length) );
    110117
    111118
Note: See TracChangeset for help on using the changeset viewer.