Changeset 1064 for code/trunk/src/network
- Timestamp:
- Apr 14, 2008, 9:39:57 PM (17 years ago)
- Location:
- code/trunk/src/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/network/ConnectionManager.cc
r1056 r1064 114 114 115 115 bool ConnectionManager::addPacket(ENetPacket *packet, ENetPeer *peer) { 116 if(enet_peer_send(peer, head_->findClient(&(peer->address))->getID() , packet)!=0)116 if(enet_peer_send(peer, (enet_uint8)head_->findClient(&(peer->address))->getID() , packet)!=0) 117 117 return false; 118 118 return true; … … 120 120 121 121 bool ConnectionManager::addPacket(ENetPacket *packet, int clientID) { 122 if(enet_peer_send(head_->findClient(clientID)->getPeer(), clientID, packet)!=0)122 if(enet_peer_send(head_->findClient(clientID)->getPeer(), (enet_uint8)clientID, packet)!=0) 123 123 return false; 124 124 return true; … … 127 127 bool ConnectionManager::addPacketAll(ENetPacket *packet) { 128 128 for(ClientInformation *i=head_->next(); i!=0; i=i->next()){ 129 if(enet_peer_send(i->getPeer(), i->getID(), packet)!=0)129 if(enet_peer_send(i->getPeer(), (enet_uint8)i->getID(), packet)!=0) 130 130 return false; 131 131 } -
code/trunk/src/network/GameStateManager.cc
r1062 r1064 133 133 // run Synchronisable::getData with offset and additional place for 3 ints in between (for ids and length) 134 134 sync=it->getData((retval->data)+offset+3*sizeof(int)); 135 *(retval->data+offset)= sync.length;136 *(retval->data+offset+sizeof(int))= sync.objectID;137 *(retval->data+offset+2*sizeof(int))= sync.classID;135 *(retval->data+offset)=(unsigned char)sync.length; 136 *(retval->data+offset+sizeof(int))=(unsigned char)sync.objectID; 137 *(retval->data+offset+2*sizeof(int))=(unsigned char)sync.classID; 138 138 // increase data pointer 139 139 offset+=tempsize+3*sizeof(int); -
code/trunk/src/network/PacketDecoder.cc
r1062 r1064 153 153 } 154 154 //since it's not alowed to use void* for pointer arithmetic 155 //FIXME: variable never used 155 156 unsigned char* data = (unsigned char *)(packet->data); 156 157 //copy the GameStateCompressed id into the struct, which is located at second place data+sizeof( int )
Note: See TracChangeset
for help on using the changeset viewer.