Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5736 in orxonox.OLD for branches/network/src/lib


Ignore:
Timestamp:
Nov 23, 2005, 3:19:45 PM (19 years ago)
Author:
bwuest
Message:

network_protocol.cc and network_protocol.h changed

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

Legend:

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

    r5735 r5736  
    2424#include "network_protocol.h"
    2525
    26 /* include this file, it contains some default definitions */
    27 #include "netdefs.h"
     26/* include the synchronizeable object */
     27#include "synchronizeable.h"
    2828
    2929/* include this file for debugging */
     
    4141  /* set the class id for the base object */
    4242  this->setClassID(CL_NETWORK_PROTOCOL, "NetworkProtocol");
     43  this->headerLength = HEADER_LENGTH;
    4344}
    4445
     
    6061    *          -1 if there isn't enough space in the buffer for the header
    6162*/
    62 NetworkProtocol::createHeader(byte* data, int length, int bufferLength, const Synchronizeable& source, unsigned int remoteID)
     63int NetworkProtocol::createHeader(byte* data, int length, int bufferLength, const Synchronizeable& source, unsigned int remoteID)
    6364{
    6465  //If there isn't enough space for the header return -1
     
    8788    PRINTF(0)("Received data is to short; it can't contain a header!");
    8889    Header h;
    89     h.protocol = -1;
     90    h.protocol = 0;
    9091    return h;
    9192  }
  • branches/network/src/lib/network/network_protocol.h

    r5735 r5736  
    88#include "base_object.h"
    99
     10/* include this file, it contains some default definitions */
     11#include "netdefs.h"
     12
     13#define HEADER_LENGTH 1
    1014
    1115typedef struct Header
     
    1822  byte* data;
    1923};
     24
     25class Synchronizeable;
    2026
    2127/*!
     
    3238
    3339  private:
    34     const unsigned int headerLength = 1; //The Length of the Header in bytes
    35     dataFields dFields;
    36 
     40    unsigned int headerLength; //The Length of the Header in bytes
    3741};
    3842
Note: See TracChangeset for help on using the changeset viewer.