Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Oct 12, 2008, 7:40:47 PM (16 years ago)
Author:
scheusso
Message:

merged network branch back to trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/network/packet/Gamestate.h

    r1763 r1907  
    2929#include "Packet.h"
    3030#include "network/Synchronisable.h"
     31#include <map>
    3132#ifndef NDEBUG
    3233#include "util/CRC32.h"
    3334#endif
     35
    3436
    3537#ifndef NETWORK_PACKETGAMESTATE_H
     
    4244struct GamestateHeader{
    4345  ENUM::Type packetType;
    44   int id; // id of the gamestate
    45   unsigned int compsize;
    46   unsigned int normsize;
    47   int base_id; // id of the base-gamestate diffed from
    48   bool diffed; // wheter diffed or not
    49   bool complete; // wheter it is a complete gamestate or only partial
    50   bool compressed;
     46  int32_t id; // id of the gamestate
     47  uint32_t compsize;
     48  uint32_t datasize;
     49  int32_t base_id; // id of the base-gamestate diffed from
     50  bool diffed:1; // wheter diffed or not
     51  bool complete:1; // wheter it is a complete gamestate or only partial
     52  bool compressed:1;
    5153#ifndef NDEBUG
    5254  uint32_t crc32;
     
    5557
    5658/**
    57         @author
     59        @author Oliver Scheuss
    5860*/
    5961class Gamestate: public Packet{
    6062  public:
    6163    Gamestate();
    62     Gamestate(unsigned char *data, int clientID);
     64    Gamestate(uint8_t *data, unsigned int clientID);
     65    Gamestate(uint8_t *data);
    6366
    6467    ~Gamestate();
     
    7174    int getBaseID();
    7275    Gamestate *diff(Gamestate *base);
     76    Gamestate* intelligentDiff(Gamestate *base, unsigned int clientID);
    7377    Gamestate *undiff(Gamestate *base);
     78    Gamestate* intelligentUnDiff(Gamestate *base);
     79    Gamestate* doSelection(unsigned int clientID);
    7480    bool compressData();
    7581    bool decompressData();
    7682
    7783    // Packet functions
     84  private:
    7885    virtual unsigned int getSize() const;
    7986    virtual bool process();
     
    8390    unsigned int calcGamestateSize(unsigned int id, int mode=0x0);
    8491    void removeObject(orxonox::ObjectListIterator<Synchronisable> &it);
    85 
    86 
    87     //Bytestream *bs_;
    88     //GamestateHeader *header_;
     92    std::map<unsigned int, Synchronisable*> dataMap_;
    8993};
    9094
Note: See TracChangeset for help on using the changeset viewer.