Changeset 656 for code/branches/FICN/src/network
- Timestamp:
- Dec 19, 2007, 1:33:30 PM (17 years ago)
- Location:
- code/branches/FICN/src/network
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/network/ClientConnection.h
r620 r656 28 28 #define NETWORK_PORT 55556 29 29 #define NETWORK_CLIENT_MAX_CONNECTIONS 5 30 #define NETWORK_CLIENT_TIMEOUT 530 #define NETWORK_CLIENT_TIMEOUT 10 31 31 #define NETWORK_SEND_WAIT 5 32 32 #define NETWORK_CLIENT_CHANNELS 2 -
code/branches/FICN/src/network/GameStateManager.cc
r632 r656 126 126 127 127 // run Synchronisable::getData with offset and additional place for 3 ints in between (for ids and length) 128 sync=it->getData( retval->data+offset+3*sizeof(int));128 sync=it->getData((retval->data)+offset+3*sizeof(int)); 129 129 *(retval->data+offset)=sync.length; 130 130 *(retval->data+offset+sizeof(int))=sync.objectID; -
code/branches/FICN/src/network/Synchronisable.cc
r630 r656 110 110 retVal.objectID=this->objectID; 111 111 retVal.classID=this->classID; 112 retVal.length= datasize;112 retVal.length=getSize(); 113 113 retVal.data=mem; 114 114 // copy to location … … 117 117 //COUT(2) << "size of variable: " << i->size << std::endl; 118 118 //(std::memcpy(retVal.data+n, (const void*)(&(i->size)), sizeof(int)); 119 *((int *)(retVal.data+n)) = i->size;119 memcpy( (void *)(retVal.data+n), (const void*)&(i->size), sizeof(int) ); 120 120 n+=sizeof(int); 121 121 switch(i->type){ 122 122 case DATA: 123 std::memcpy( retVal.data+n, (const void*)(i->var), i->size);123 std::memcpy( (void *)(retVal.data+n), (const void*)(i->var), i->size); 124 124 n+=i->size; 125 125 break; … … 172 172 switch(i->type){ 173 173 case DATA: 174 tsize+=sizeof(int); 174 175 tsize+=i->size; 175 176 break; 176 177 case STRING: 178 tsize+=sizeof(int); 177 179 tsize+=((std::string *)i->var)->length()+1; 178 180 break;
Note: See TracChangeset
for help on using the changeset viewer.