Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 18, 2008, 10:00:17 PM (16 years ago)
Author:
scheusso
Message:

made clientinformation threadsafe and improved packetbuffer; wrote a static function SpaceShip *SpaceShip::getLocalShip. it returns the pointer to the ship that should be steered

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/merge/src/network/ClientInformation.h

    r1299 r1318  
    4444
    4545#include <enet/enet.h>
     46#include <boost/thread/recursive_mutex.hpp>
    4647
    4748#define GAMESTATEID_INITIAL -1
     
    6364    ClientInformation *next();
    6465    ClientInformation *prev();
    65     bool setNext(ClientInformation *next);
    66     bool setPrev(ClientInformation *prev);
    67     ClientInformation *insertAfter(ClientInformation *ins);
    68     ClientInformation *insertBefore(ClientInformation *ins);
    6966    ClientInformation *insertBack(ClientInformation *ins);
    7067   
     
    8077    int getGamestateID();
    8178    ENetPeer *getPeer();
     79    bool getHead();
     80    void setHead(bool h);
    8281   
     82    int getFailures();
     83    void addFailure();
     84    void resetFailures();
    8385   
    8486    bool removeClient(int clientID);
     
    9294    bool getSynched();
    9395
    94     bool head;
    95     unsigned short failures_;
    9696
    97   private:
     97    private:
     98      bool setNext(ClientInformation *next);
     99      bool setPrev(ClientInformation *prev);
     100    ClientInformation *insertAfter(ClientInformation *ins);
     101    ClientInformation *insertBefore(ClientInformation *ins);
     102   
    98103    ClientInformation *preve;
    99104    ClientInformation *nexte;
     
    104109    int ShipID_;   // this is the unique objectID
    105110    bool synched_;
     111    bool head_;
     112    unsigned short failures_;
     113    static boost::recursive_mutex mutex_;
     114   
    106115  };
    107116
Note: See TracChangeset for help on using the changeset viewer.