Changeset 8068 in orxonox.OLD for trunk/src/lib/network/network_game_manager.h
- Timestamp:
- Jun 1, 2006, 2:28:16 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/lib/network/network_game_manager.h
r7954 r8068 47 47 public: 48 48 virtual ~NetworkGameManager(); 49 49 50 50 static NetworkGameManager* NetworkGameManager::getInstance() 51 51 { if (!NetworkGameManager::singletonRef) NetworkGameManager::singletonRef = new NetworkGameManager(); return NetworkGameManager::singletonRef; } 52 52 53 #if 054 virtual int writeBytes(const byte* data, int length, int sender);55 virtual int readBytes(byte* data, int maxLength, int * reciever);56 virtual void writeDebug() const;57 virtual void readDebug() const;58 #endif59 53 60 int createEntity( ClassID classID, int owner = 0);61 BaseObject* createEntity(const TiXmlElement* element);62 void removeEntity( int uniqueID );63 void sendYouAre( int uniqueID, int userID);54 bool signalNewPlayer( int userId ); 55 bool signalLeftPlayer( int userID ); 56 57 void removeSynchronizeable( int uniqueId ); 64 58 65 #if 0 66 void sendEntityList(int userID); 67 #endif 68 69 bool signalNewPlayer(int userId); 70 bool signalLeftPlayer(int userID); 71 59 inline void setGameState( int gameState ){ this->gameState = gameState; } 60 inline int getGameState(){ return this->gameState; } 72 61 73 62 private: 74 63 NetworkGameManager(); 75 64 76 static bool youAreHandler(MessageId messageId, byte * data, int dataLength, void * someData, int userId );65 static bool delSynchronizeableHandler( MessageId messageId, byte * data, int dataLength, void * someData, int userId ); 77 66 78 79 /* some network signal handlers */80 bool handleRequestCreate( int& i, const byte* data, int length, int sender );81 bool handleRequestRemove( int& i, const byte* data, int length, int sender );82 bool handleCreateEntity( int& i, const byte* data, int length, int sender );83 bool handleRemoveEntity( int& i, const byte* data, int length, int sender );84 bool handleCreateEntityList( int& i, const byte* data, int length, int sender );85 bool handleRemoveEntityList( int& i, const byte* data, int length, int sender );86 bool handleYouAreEntity( int& i, const byte* data, int length, int sender );87 bool handleRequestPNodePath(int& i, const byte* data, int length, int sender);88 bool handleSendPNodePath(int& i, const byte* data, int length, int sender);89 90 91 /* some network handlers helper functions */92 // void requestCreateEntity(ClassID classID);93 int executeCreateEntity(ClassID classID, int uniqueID = 0, int owner = 0);94 BaseObject* doCreateEntity(ClassID classID, int uniqueID, int owner);95 96 // void requestRemoveEntity(int uniqueID);97 void executeRemoveEntity(int uniqueID);98 void doRemoveEntity(int uniqueID);99 100 void doYouAre( int uniqueID );101 102 // void requestPNodePath(const PNode* node1, const PNode* node2);103 void executeRequestPNodePath(const PNode* node2, const PNode* node2);104 void doRequestPNodePath(const PNode* node1, const PNode* node2);105 106 bool canCreateEntity(ClassID classID);107 #if 0108 void resizeBufferVector(int n);109 110 111 bool writeToClientBuffer( clientBuffer &cb, byte*data, int length );112 bool writeToClientBuffer( clientBuffer &cb, byte b );113 bool writeToClientBuffer( clientBuffer &cb, int i );114 bool readFromClientBuffer( clientBuffer &cb, byte*data, int length );115 #endif116 117 private:118 #if 0119 std::vector<clientBuffer> outBuffer;120 //clientBuffer allOutBuffer;121 #endif122 67 static NetworkGameManager* singletonRef; 68 69 int gameState; 123 70 }; 124 71
Note: See TracChangeset
for help on using the changeset viewer.