- Timestamp:
- Mar 13, 2008, 3:47:21 PM (17 years ago)
- Location:
- code/branches/network/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/ClientConnection.cc
r790 r889 159 159 case ENET_EVENT_TYPE_CONNECT: 160 160 case ENET_EVENT_TYPE_RECEIVE: 161 //std::cout << "gotpacket" << std::endl;161 COUT(5) << "receiver-Thread: got new packet" << std::endl; 162 162 processData(&event); 163 163 break; … … 215 215 216 216 bool ClientConnection::processData(ENetEvent *event) { 217 //std::cout<< "got packet, pushing to queue" << std::endl;217 COUT(5) << "got packet, pushing to queue" << std::endl; 218 218 // just add packet to the buffer 219 219 // this can be extended with some preprocessing -
code/branches/network/src/network/GameStateManager.cc
r871 r889 67 67 GameStateCompressed GameStateManager::popGameState(int clientID) { 68 68 int gID = head_->findClient(clientID)->getGamestateID(); 69 std::cout<< "popgamestate: sending gstate id: " << id << "diffed from: " << gID << std::endl;69 COUT(4) << "popgamestate: sending gstate id: " << id << "diffed from: " << gID << std::endl; 70 70 if(gID!=GAMESTATEID_INITIAL){ 71 71 GameState *client = gameStateMap[gID]; … … 100 100 GameState *retval=new GameState; //return value 101 101 retval->id=id++; 102 std::cout<< "producing gamestate with id: " << retval->id << std::endl;102 COUT(4) << "producing gamestate with id: " << retval->id << std::endl; 103 103 // reserve a little memory and increase it later on 104 //COUT(2) << "mallocing" << std::endl;104 COUT(5) << "mallocing" << std::endl; 105 105 retval->data = (unsigned char*)malloc(memsize); 106 //COUT(2) << "malloced" << std::endl;106 COUT(5) << "malloced" << std::endl; 107 107 108 108 // offset of memory functions … … 113 113 //get size of the synchronisable 114 114 tempsize=it->getSize(); 115 //std::cout<< "size of temp gamestate: " << tempsize << std::endl;115 // COUT(5) << "size of temp gamestate: " << tempsize << std::endl; 116 116 //COUT(2) << "size of synchronisable: " << tempsize << std::endl; 117 117 // add place for data and 3 ints (length,classid,objectid) … … 137 137 offset+=tempsize+3*sizeof(int); 138 138 } 139 COUT(5) << "Gamestate size: " << totalsize << std::endl; 139 140 retval->size=totalsize; 140 141 return retval; … … 188 189 189 190 GameStateCompressed GameStateManager::compress_(GameState *a) { 190 //COUT(2) << "compressing gamestate" << std::endl;191 COUT(5) << "compressing gamestate" << std::endl; 191 192 int size = a->size; 192 193 uLongf buffer = (uLongf)((a->size + 12)*1.01)+1; … … 206 207 GameStateCompressed compressedGamestate; 207 208 compressedGamestate.compsize = buffer; 208 //std::cout << "compressedGamestate.compsize = buffer; " << buffer << std::endl;209 // std::cout << "compressedGamestate.compsize = buffer; " << buffer << std::endl; 209 210 compressedGamestate.normsize = size; 210 //std::cout << "compressedGamestate.normsize = size; " << size << std::endl;211 // std::cout << "compressedGamestate.normsize = size; " << size << std::endl; 211 212 compressedGamestate.id = a->id; 212 213 compressedGamestate.data = dest; -
code/branches/network/src/network/PacketDecoder.cc
r790 r889 54 54 cout << "clientId: " << client << endl; //control cout, not important, just debugging info 55 55 int id = (int)*packet->data; //the first 4 bytes are always the enet packet id 56 std::cout<< "packet id: " << id << std::endl;57 std::cout<< "packet size inside packetdecoder: " << packet->dataLength << std::endl;56 COUT(5) << "packet id: " << id << std::endl; 57 // COUT(5) << "packet size inside packetdecoder: " << packet->dataLength << std::endl; 58 58 switch( id ) { 59 59 case ACK: … … 93 93 94 94 95 std::cout<< "got ack id: " << a->id << std::endl;95 COUT(5) << "got ack id: " << a->id << std::endl; 96 96 processAck( a, clientId ); //debug info 97 97 … … 150 150 //memcpy( (void*)&(currentState->id), (const void*)(data+sizeof( int )), sizeof( int ) ); 151 151 currentState->id = (int)*(data+sizeof(int)); 152 std::cout << "id: " << currentState->id << std::endl;152 // std::cout << "id: " << currentState->id << std::endl; 153 153 //copy the size of the GameStateCompressed compressed data into the new GameStateCompressed struct, located at 3th 154 154 //position of the data stream, data+2*sizeof( int ) 155 memcpy( (void*)&(currentState->compsize), (const void*)(data+2*sizeof( int )), sizeof( int) );155 // memcpy( (void*)&(currentState->compsize), (const void*)(data+2*sizeof( int )), sizeof( int) ); 156 156 //currentState->compsize = (int)*(data+2*sizeof(int)); 157 std::cout << "compsize: " << currentState->compsize << std::endl;157 // std::cout << "compsize: " << currentState->compsize << std::endl; 158 158 //size of uncompressed data 159 159 memcpy( (void*)&(currentState->normsize), (const void*)(data+3*sizeof( int )), sizeof( int ) ); 160 160 //currentState->normsize = (int)*(data+3*sizeof(int)); 161 std::cout << "normsize. " << currentState->normsize << std::endl;161 // std::cout << "normsize. " << currentState->normsize << std::endl; 162 162 //since the packetgenerator was changed, due to a new parameter, change this function too 163 163 memcpy( (void*)&(currentState->diffed), (const void*)(data+4*sizeof(int)), sizeof(bool)); 164 164 //currentState->diffed = (bool)*(data+4*sizeof(int)); 165 std::cout << "diffed: " << currentState->diffed << std::endl;165 // std::cout << "diffed: " << currentState->diffed << std::endl; 166 166 //since data is not allocated, because it's just a pointer, allocate it with size of gamestatedatastream 167 167 currentState->data = (unsigned char*)(malloc( currentState->compsize )); 168 168 if(currentState->data==NULL) 169 std::cout << "memory leak" << std::endl;169 COUT(2) << "Gamestatepacket-decoder: memory leak" << std::endl; 170 170 //copy the GameStateCompressed data 171 171 //std::cout << "packet size (enet): " << packet->dataLength << std::endl; … … 175 175 //clean memory 176 176 enet_packet_destroy( packet ); 177 //run processGameStateCompressed178 //TODO: not yet implemented!179 177 processGamestate(currentState); 180 178 } … … 189 187 void *data = (void *)cid->message; 190 188 memcpy(data, (const void*)(packet->data+3*sizeof(int)), cid->length); 191 std::cout<< "classid: " << cid->clid << ", name: " << cid->message << std::endl;189 COUT(4) << "classid: " << cid->clid << ", name: " << cid->message << std::endl; 192 190 enet_packet_destroy( packet ); 193 191 processClassid(cid); … … 223 221 void PacketDecoder::printAck( ack* data ) 224 222 { 225 cout<< "data id: " << data->id << endl;226 cout<< "data: " << data->a << endl;223 COUT(5) << "data id: " << data->id << endl; 224 COUT(5) << "data: " << data->a << endl; 227 225 } 228 226 229 227 void PacketDecoder::printMouse( mouse* data ) 230 228 { 231 cout<< "data id: " << data->id << endl;232 cout<< "data: " << data->x << " " << data->y << endl;229 COUT(5) << "data id: " << data->id << endl; 230 COUT(5) << "data: " << data->x << " " << data->y << endl; 233 231 } 234 232 235 233 void PacketDecoder::printKey( keyboard* data ) 236 234 { 237 cout<< "data id: " << data->id << endl;238 cout<< "data: " << (char)data->press << endl;235 COUT(5) << "data id: " << data->id << endl; 236 COUT(5) << "data: " << (char)data->press << endl; 239 237 } 240 238 … … 242 240 { 243 241 if(clientId!=CLIENTID_CLIENT) 244 cout<< "client: " << clientId << endl;245 cout<< "data id: " << data->id << endl;246 cout<< "data: " << data->message << endl;242 COUT(5) << "client: " << clientId << endl; 243 COUT(5) << "data id: " << data->id << endl; 244 COUT(5) << "data: " << data->message << endl; 247 245 } 248 246 249 247 void PacketDecoder::printGamestate( GameStateCompressed* data ) 250 248 { 251 cout<< "id of GameStateCompressed: " << data->id << endl;252 cout<< "size of GameStateCompressed: " << data->compsize << endl;249 COUT(5) << "id of GameStateCompressed: " << data->id << endl; 250 COUT(5) << "size of GameStateCompressed: " << data->compsize << endl; 253 251 } 254 252 255 253 void PacketDecoder::printClassid( classid *cid) 256 254 { 257 cout<< "id of classid: " << cid->id << endl;258 cout<< "size of classid: " << cid->length << endl;259 cout<< "ID of classid: " << cid->clid <<endl;260 cout<< "data of classid: " << cid->message <<endl;255 COUT(5) << "id of classid: " << cid->id << endl; 256 COUT(5) << "size of classid: " << cid->length << endl; 257 COUT(5) << "ID of classid: " << cid->clid <<endl; 258 COUT(5) << "data of classid: " << cid->message <<endl; 261 259 } 262 260 -
code/branches/network/src/orxonox/objects/SpaceShip.cc
r888 r889 196 196 SetConfigValue(bInvertYAxis_, false).description("Set this to true for joystick-like mouse behaviour (mouse up = ship down)."); 197 197 SetConfigValue(reloadTime_, 0.125).description("The reload time of the weapon in seconds"); 198 //SetConfigValue(testvector_, Vector3()).description("asdfblah");198 SetConfigValue(testvector_, Vector3()).description("asdfblah"); 199 199 } 200 200
Note: See TracChangeset
for help on using the changeset viewer.