Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 12, 2008, 5:36:57 PM (16 years ago)
Author:
scheusso
Message:

we have a new gamestate concept now: dont transmit synchronisable header of objects, that dont get updated that tick. transmit objectids of deleted objects to delete them on the client too

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network/src/network/Synchronisable.h

    r1751 r1775  
    3333
    3434#include <list>
     35#include <map>
     36#include <queue>
    3537#include "core/OrxonoxClass.h"
    3638#include "util/XMLIncludes.h"
     
    7476    void registerVar(void *var, int size, variableType t, int mode=1, NetworkCallbackBase *cb=0);
    7577    bool getData(unsigned char*& men, unsigned int id, int mode=0x0);
    76     int getSize2(unsigned int id, int mode=0x0);
     78    int getSize(unsigned int id, int mode=0x0);
    7779    bool updateData(unsigned char*& mem, int mode=0x0);
    7880    bool isMyData(unsigned char* mem);
     
    8486    static void setClient(bool b);
    8587   
    86     static bool fabricate(unsigned char*& mem, int mode=0x0);
     88    static Synchronisable *fabricate(unsigned char*& mem, int mode=0x0);
     89    static bool deleteObject(unsigned int objectID);
     90    static Synchronisable *getSynchronisable(unsigned int objectID);
     91    static unsigned int getNumberOfDeletedObject(){ return deletedObjects_.size(); }
     92    static unsigned int popDeletedObject(){ unsigned int i = deletedObjects_.front(); deletedObjects_.pop(); return i; }
     93   
     94   
    8795  protected:
    8896    Synchronisable();
    8997  private:
    90     int getSize(unsigned int id, int mode=0x0);
    9198    bool isMyTick(unsigned int id);
    9299    std::list<synchronisableVariable *> *syncList;
     
    96103    unsigned int objectFrequency_;
    97104    int objectMode_;
     105    static std::map<unsigned int, Synchronisable *> objectMap_;
     106    static std::queue<unsigned int> deletedObjects_;
    98107  };
    99108}
Note: See TracChangeset for help on using the changeset viewer.