Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7954 in orxonox.OLD for trunk/src/lib/network/network_game_manager.h


Ignore:
Timestamp:
May 29, 2006, 3:28:41 PM (19 years ago)
Author:
patrick
Message:

trunk: merged the network branche back to trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/network/network_game_manager.h

    r6981 r7954  
    1212/* include base_object.h since all classes are derived from this one */
    1313#include "synchronizeable.h"
     14#include "message_manager.h"
    1415
    1516
    1617class TiXmlElement;
    1718class PNode;
    18 
    19 /**
    20  * protocol definition
    21  *
    22  *  CREATE_ENTITY:       >> CLASS_ID, UNIQUE_ID, OWNER
    23  *  REMOVE_ENTITY:       >> UNIQUE_ID
    24  *
    25  *  CREATE_ENTITY_LIST:  >> NUMBER, [CLASS_ID, UNIQUE_ID, OWNER][0..NUMBER]
    26  *  REMOVE_ENTITY_LIST:  >> NUMBER, [UNIQUE_ID][0..NUMBER]
    27  *
    28  *  REQUEST_CREATE:      >> CLASS_ID
    29  *                       << [Sync Info]
    30  *  REQUEST_REMOVE:      >> UNIQUE_ID
    31  *                       << [Sync Info]
    32  *
    33  *  //REQUEST_CREATE_LIST: NUMBER, [CLASS_ID][0..NUMBER]
    34  *  //REQUEST_CREATE_LIST: NUMBER, [UNIQUE_ID][0..NUMBER]
    35  *
    36  *  REQUEST_ENTITY_LIST: //request the whole world :D
    37  *  REQUEST_SYNC:        >> UNIQUE_ID
    38  *                       << [Sync Info]
    39  *  //REQUEST_SYNC_LIST:   NUMBER, [UNIQUE_ID][0..NUMBER]
    40  *
    41  *  YOU_ARE_ENTITY:      >> UNIQUE_ID
    42  *
    43  *  REQUEST_PNODE_PATH   >> UNIQUE_ID_START   UNIQUE_ID_STOP
    44  *                       << UNIQUE_ID_1   UNIQUE_ID_2   UNIQUE_ID_3 ...   UNIQUE_ID_N
    45  *
    46  *  SEND_PNODE_PATH      >> UNIQUE_ID_START   UNIQUE_ID_STOP NUMBER [UNIQUE_ID][0..NUMBER]
    47  */
    4819
    4920typedef enum NetworkGameManagerProtocol {
     
    5425  NET_REQUEST_CREATE,
    5526  NET_REQUEST_REMOVE,
    56   NET_REQUEST_SYNC,
    5727  NET_YOU_ARE_ENTITY,
    5828  NET_REQUEST_ENTITY_LIST,
     
    8151    { if (!NetworkGameManager::singletonRef) NetworkGameManager::singletonRef = new NetworkGameManager(); return NetworkGameManager::singletonRef; }
    8252
     53#if 0
    8354    virtual int writeBytes(const byte* data, int length, int sender);
    8455    virtual int readBytes(byte* data, int maxLength, int * reciever);
    8556    virtual void writeDebug() const;
    8657    virtual void readDebug() const;
     58#endif
    8759
    8860    int createEntity( ClassID classID, int owner = 0 );
     
    9163    void sendYouAre( int uniqueID, int userID );
    9264
    93     void sync(int uniqueID, int owner);
    94 
     65#if 0
    9566    void sendEntityList(int userID);
     67#endif
    9668
    9769    bool signalNewPlayer(int userId);
     
    10173  private:
    10274    NetworkGameManager();
     75   
     76    static bool youAreHandler(MessageId messageId, byte * data, int dataLength, void * someData, int userId );
    10377
    10478
     
    11185    bool handleRemoveEntityList( int& i, const byte* data, int length, int sender );
    11286    bool handleYouAreEntity( int& i, const byte* data, int length, int sender );
    113     bool handleRequestSync( int& i, const byte* data, int length, int sender );
    11487    bool handleRequestPNodePath(int& i, const byte* data, int length, int sender);
    11588    bool handleSendPNodePath(int& i, const byte* data, int length, int sender);
     
    11790
    11891    /* some network handlers helper functions */
    119     void requestCreateEntity(ClassID classID);
     92//    void requestCreateEntity(ClassID classID);
    12093    int executeCreateEntity(ClassID classID, int uniqueID = 0, int owner = 0);
    12194    BaseObject* doCreateEntity(ClassID classID, int uniqueID, int owner);
    12295
    123     void requestRemoveEntity(int uniqueID);
     96//    void requestRemoveEntity(int uniqueID);
    12497    void executeRemoveEntity(int uniqueID);
    12598    void doRemoveEntity(int uniqueID);
    12699
    127     void executeRequestSync( int uniqueID, int user );
    128     void doRequestSync(int uniqueID, int userID);
    129 
    130100    void doYouAre( int uniqueID );
    131101
    132     void requestPNodePath(const PNode* node1, const PNode* node2);
     102//    void requestPNodePath(const PNode* node1, const PNode* node2);
    133103    void executeRequestPNodePath(const PNode* node2, const PNode* node2);
    134104    void doRequestPNodePath(const PNode* node1, const PNode* node2);
    135105
    136106    bool canCreateEntity(ClassID classID);
     107#if 0
     108    void resizeBufferVector(int n);
    137109
    138     void resizeBufferVector(int n);
    139110
    140111    bool writeToClientBuffer( clientBuffer &cb, byte*data, int length );
     
    142113    bool writeToClientBuffer( clientBuffer &cb, int i );
    143114    bool readFromClientBuffer( clientBuffer &cb, byte*data, int length );
    144 
     115#endif
    145116
    146117  private:
     118#if 0
    147119    std::vector<clientBuffer>     outBuffer;
    148120    //clientBuffer                  allOutBuffer;
     121#endif
    149122    static NetworkGameManager*    singletonRef;
    150     bool                          hasRequestedWorld;
    151123};
    152124
Note: See TracChangeset for help on using the changeset viewer.