Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 22, 2008, 2:02:06 PM (16 years ago)
Author:
rgrieder
Message:

merged merge branch back to trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/network/ClientInformation.h

    r1293 r1360  
    4444
    4545#include <enet/enet.h>
     46#include <boost/thread/recursive_mutex.hpp>
    4647
    4748#define GAMESTATEID_INITIAL -1
     49#define CLIENTID_UNKNOWN -2
    4850
    4951namespace network
     
    6264    ClientInformation *next();
    6365    ClientInformation *prev();
    64     bool setNext(ClientInformation *next);
    65     bool setPrev(ClientInformation *prev);
    66     ClientInformation *insertAfter(ClientInformation *ins);
    67     ClientInformation *insertBefore(ClientInformation *ins);
    6866    ClientInformation *insertBack(ClientInformation *ins);
    6967   
    7068    // set functions
    7169    void setID(int clientID);
    72     void setPeer(ENetPeer *peer);
    73     void setGamestateID(int id);
     70    bool setPeer(ENetPeer *peer);
     71    bool setGamestateID(int id);
     72    bool setPartialGamestateID(int id);
    7473    inline void setShipID(int id){ShipID_=id;}
    7574   
     
    7877    int getID();
    7978    int getGamestateID();
     79    int getPartialGamestateID();
    8080    ENetPeer *getPeer();
     81    bool getHead();
     82    void setHead(bool h);
    8183   
     84    int getFailures();
     85    void addFailure();
     86    void resetFailures();
    8287   
    8388    bool removeClient(int clientID);
     
    8893    ClientInformation *findClient(ENetAddress *address, bool look_backwards=false);
    8994
    90     void setSynched(bool s);
     95    bool setSynched(bool s);
    9196    bool getSynched();
    9297
    93     bool head;
    94     unsigned short failures_;
    9598
    96   private:
     99    private:
     100      bool setNext(ClientInformation *next);
     101      bool setPrev(ClientInformation *prev);
     102    ClientInformation *insertAfter(ClientInformation *ins);
     103    ClientInformation *insertBefore(ClientInformation *ins);
     104   
    97105    ClientInformation *preve;
    98106    ClientInformation *nexte;
     
    101109    int clientID_;
    102110    int gamestateID_;
     111    int partialGamestateID_;
    103112    int ShipID_;   // this is the unique objectID
    104113    bool synched_;
     114    bool head_;
     115    unsigned short failures_;
     116    static boost::recursive_mutex mutex_;
     117   
    105118  };
    106119
Note: See TracChangeset for help on using the changeset viewer.