- Timestamp:
- Mar 20, 2008, 4:32:20 PM (17 years ago)
- Location:
- code/branches/network/src/network
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/network/src/network/Client.cc
r907 r913 191 191 192 192 void Client::processGamestate( GameStateCompressed *data){ 193 int id = data->id; 194 COUT(5) << "received gamestate id: " << data->id << std::endl; 193 195 gamestate.pushGameState(data); 194 COUT(5) << "received gamestate id: " << data->id << std::endl; 195 client_connection.addPacket(pck_gen.acknowledgement(data->id)); 196 client_connection.addPacket(pck_gen.acknowledgement(id)); 196 197 client_connection.sendPackets(); 197 198 return; -
code/branches/network/src/network/PacketDecoder.cc
r912 r913 154 154 //copy the GameStateCompressed id into the struct, which is located at second place data+sizeof( int ) 155 155 //memcpy( (void*)&(currentState->id), (const void*)(data+sizeof( int )), sizeof( int ) ); 156 currentState->id = (int)*(packet->data+sizeof(int)); 156 currentState->id = *((int *)packet->data+sizeof(int)); 157 COUT(5) << "decoder: received gs id: " << currentState->id << std::endl; 157 158 // std::cout << "id: " << currentState->id << std::endl; 158 159 //copy the size of the GameStateCompressed compressed data into the new GameStateCompressed struct, located at 3th -
code/branches/network/src/network/PacketGenerator.cc
r790 r913 50 50 ENetPacket* PacketGenerator::acknowledgement( int state, int reliable ) 51 51 { 52 std::cout<< "generating new acknowledgement, id: " << state << std::endl;52 COUT(4) << "generating new acknowledgement, id: " << state << std::endl; 53 53 ack* ackreq = new ack; 54 54 ackreq->id = ACK; … … 63 63 ENetPacket* PacketGenerator::mousem( double x, double y, int reliable ) 64 64 { 65 std::cout<< "generating new mouse" << std::endl;65 COUT(4) << "generating new mouse" << std::endl; 66 66 mouse* mousemove = new mouse; 67 67 mousemove->id = MOUSE; … … 77 77 ENetPacket* PacketGenerator::keystrike( char press, int reliable ) 78 78 { 79 std::cout<< "generating new keyboard" << std::endl;79 COUT(4) << "generating new keyboard" << std::endl; 80 80 keyboard* key = new keyboard; 81 81 key->id = KEYBOARD; -
code/branches/network/src/network/PacketManager.h
r907 r913 4 4 #include <string> 5 5 #include <enet/enet.h> 6 7 #include "core/CoreIncludes.h" 6 8 7 9 #include "NetworkPrereqs.h"
Note: See TracChangeset
for help on using the changeset viewer.