Changeset 636 for code/branches/FICN/src/network
- Timestamp:
- Dec 19, 2007, 1:38:19 AM (17 years ago)
- Location:
- code/branches/FICN/src/network
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/FICN/src/network/ClientInformation.cc
r620 r636 47 47 nexte=0; 48 48 this->head=false; 49 synched_=false; 49 50 } 50 51 … … 55 56 nexte=0; 56 57 this->head=head; 58 synched_=false; 57 59 } 58 60 // … … 220 222 } 221 223 222 } 224 void ClientInformation::setSynched(bool s){ 225 synched_=s; 226 } 227 bool ClientInformation::getSynched(){ 228 return synched_; 229 } 230 231 } -
code/branches/FICN/src/network/ClientInformation.h
r444 r636 48 48 ClientInformation *findClient(int clientID, bool look_backwards=false); 49 49 ClientInformation *findClient(ENetAddress *address, bool look_backwards=false); 50 51 void setSynched(bool s); 52 bool getSynched(); 53 50 54 bool head; 51 55 … … 57 61 int clientID_; 58 62 int gamestateID_; 63 bool synched_; 59 64 }; 60 65 -
code/branches/FICN/src/network/ConnectionManager.cc
r620 r636 233 233 temp->setID(temp->prev()->getID()+1); 234 234 temp->setPeer(event->peer); 235 std::cout << "added client id: " << temp->prev()->getID() << std::endl; 235 std::cout << "added client id: " << temp->getID() << std::endl; 236 syncClassid(temp->getID()); 237 temp->setSynched(true); 236 238 return true; 237 239 } … … 256 258 while(!abort){ 257 259 id = ID(i); 258 if(id == NULL) 259 abort=true; 260 std::cout << "syncid: " << i << ", ID(id): " << id << std::endl; 261 if(id == NULL){ 262 if(i!=0) 263 abort=true; 264 else{ 265 ++i; 266 continue; 267 } 268 } 260 269 else{ 261 270 classname = id->getName(); -
code/branches/FICN/src/network/GameStateClient.cc
r632 r636 88 88 } 89 89 if(it==0){ 90 std::cout << "classid: " << sync.classID << ", name: " << ID(sync.classID)->getName() << std::endl; 90 91 orxonox::BaseObject *no = ID(sync.classID)->fabricate(); 91 92 ((Synchronisable *)no)->objectID=sync.objectID; -
code/branches/FICN/src/network/PacketDecoder.cc
r632 r636 186 186 cid->clid = ((classid *)(packet->data))->clid; 187 187 cid->message = (const char *)malloc(cid->length); 188 void *data = (void *)cid->message; 189 memcpy(data, (const void*)(packet->data+3*sizeof(int)), cid->length); 190 std::cout << "classid: " << cid->clid << ", name: " << cid->message << std::endl; 188 191 enet_packet_destroy( packet ); 189 192 processClassid(cid); -
code/branches/FICN/src/network/PacketGenerator.cc
r632 r636 128 128 ENetPacket* PacketGenerator::clid( int classid, std::string classname, int reliable ){ 129 129 unsigned char* data = (unsigned char *)malloc(3*sizeof(int)+classname.length()+1); 130 std::cout << "classid: " << classid << ", name: " << classname << std::endl; 130 131 *(int *)data = CLASSID; 131 132 *((int *)data+1) = classname.length()+1; -
code/branches/FICN/src/network/Server.cc
r632 r636 142 142 continue; 143 143 } 144 if( !(temp->getSynched()) ){ 145 std::cout << "not sending gamestate" << std::endl; 146 temp=temp->next(); 147 continue; 148 } 144 149 std::cout << "doing gamestate" << std::endl; 145 150 int gid = temp->getGamestateID();
Note: See TracChangeset
for help on using the changeset viewer.