Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9251 in orxonox.OLD


Ignore:
Timestamp:
Jul 12, 2006, 10:58:24 AM (18 years ago)
Author:
patrick
Message:

some code cleanup and rearangement in the network stream. nothing major

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/network_stream.h

    r9250 r9251  
    7676    void startHandshake();
    7777
     78    /* synchronizeable interface */
    7879    void connectSynchronizeable(Synchronizeable& sync);
    7980    void disconnectSynchronizeable(Synchronizeable& sync);
    8081
     82    /* functions for the localhost settings */
    8183    inline bool isMasterServer() const { return (this->type == NET_MASTER_SERVER)? true:false; }
    8284    inline bool isProxyServer() const { return (this->type == NET_PROXY_SERVER)? true:false; }
    8385    inline bool isClient() const { return (this->type == NET_CLIENT)? true:false; }
    8486    inline bool isActive() const { return this->bActive; }
    85 
    8687    inline int getMaxConnections(){ return MAX_CONNECTIONS; }
    8788
    88     virtual void processData();
    89 
    90     inline SynchronizeableList::const_iterator getSyncBegin(){ return synchronizeables.begin(); }
    91     inline SynchronizeableList::const_iterator getSyncEnd(){ return synchronizeables.end(); }
    92     int getSyncCount();
    93 
     89    /* functions for the peerInfo information retreival */
    9490    inline bool isUserIdActive( int userID ) { return (peers.find(userID) != peers.end()); }
    9591    inline bool isUserMasterServer( int userID ){ if ( !isUserIdActive(userID) ) return false; return peers[userID].isMasterServer; }
     
    9793    inline bool isUserClient( int userID ){ if ( !isUserIdActive(userID) ) return false; return peers[userID].isClient; }
    9894
     95
     96    virtual void processData();
     97
    9998    void debug();
    100 
    101     inline PeerInfo & getPeerInfo( int userId ) { return peers[userId]; }
    10299
    103100
    104101  private:
     102    inline SynchronizeableList::const_iterator getSyncBegin(){ return synchronizeables.begin(); }
     103    inline SynchronizeableList::const_iterator getSyncEnd(){ return synchronizeables.end(); }
     104    inline PeerInfo & getPeerInfo( int userId ) { return peers[userId]; }
     105
     106    int getSyncCount();
     107
    105108    void updateConnectionList();
    106109    void handleHandshakes();
     
    114117
    115118  private:
    116     SynchronizeableList        synchronizeables;
    117     PeerList                   peers;
    118     ServerSocket*              serverSocket;
    119     int                        type;
    120     bool                       bActive;
    121     std::list<int>             freeSocketSlots;
     119    PeerList                   peers;                       //!< list of the network node informations
    122120
    123     int                        myHostId;
     121    int                        type;                        //!< the type of this host (NET_CLIENT, NET_MASTER_SERVER,...)
     122    int                        myHostId;                    //!< the host id of the localhost
     123    bool                       bActive;                     //!< true if this host is active
    124124
     125    std::list<int>             freeSocketSlots;             //!< list of free sockets (to ensure not to resycle sockets)
    125126    int                        currentState;                //!< current state id
    126127
    127     NetworkGameManager*        networkGameManager;
     128    NetworkGameManager*        networkGameManager;          //!< reference to the network game manager
     129    ServerSocket*              serverSocket;                //!< the listening socket of the server
    128130
    129131    std::map<int,int>          oldSynchronizeables;         //!< used to save recently deleted sync ids to not recreate them
     132    SynchronizeableList        synchronizeables;            //!< list of the synchronizeables
    130133
    131134    byte                       buf[UDP_PACKET_SIZE];        //!< used by handleUp/Downstream
    132135    byte                       compBuf[UDP_PACKET_SIZE];    //!< used by handleUp/Downstream
    133 
    134136    int                        remainingBytesToWriteToDict; //!< if > 0 NetworkStream will write packets to DATA/dicts/newdict
    135137
    136     int dictServer;
    137     int dictClient;
     138    int                        dictServer;                  //!< the zip dict for the server
     139    int                        dictClient;                  //!< the zip dict for the client
    138140};
    139141#endif /* _NETWORK_STREAM */
Note: See TracChangeset for help on using the changeset viewer.