Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Dec 19, 2007, 1:38:19 AM (17 years ago)
Author:
scheusso
Message:

synchronising of classid↔classname works now

Location:
code/branches/FICN/src/network
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN/src/network/ClientInformation.cc

    r620 r636  
    4747  nexte=0;
    4848  this->head=false;
     49  synched_=false;
    4950}
    5051
     
    5556  nexte=0;
    5657  this->head=head;
     58  synched_=false;
    5759}
    5860//
     
    220222}
    221223
    222 }
     224void ClientInformation::setSynched(bool s){
     225  synched_=s;
     226}
     227bool ClientInformation::getSynched(){
     228  return synched_;
     229}
     230
     231}
  • code/branches/FICN/src/network/ClientInformation.h

    r444 r636  
    4848  ClientInformation *findClient(int clientID, bool look_backwards=false);
    4949  ClientInformation *findClient(ENetAddress *address, bool look_backwards=false);
     50 
     51  void setSynched(bool s);
     52  bool getSynched();
     53 
    5054  bool head;
    5155 
     
    5761  int clientID_;
    5862  int gamestateID_;
     63  bool synched_;
    5964};
    6065
  • code/branches/FICN/src/network/ConnectionManager.cc

    r620 r636  
    233233      temp->setID(temp->prev()->getID()+1);
    234234    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);
    236238    return true;
    237239  }
     
    256258    while(!abort){
    257259      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      }
    260269      else{
    261270        classname = id->getName();
  • code/branches/FICN/src/network/GameStateClient.cc

    r632 r636  
    8888      }
    8989      if(it==0){
     90        std::cout << "classid: " << sync.classID << ", name: " << ID(sync.classID)->getName() << std::endl;
    9091        orxonox::BaseObject *no = ID(sync.classID)->fabricate();
    9192        ((Synchronisable *)no)->objectID=sync.objectID;
  • code/branches/FICN/src/network/PacketDecoder.cc

    r632 r636  
    186186        cid->clid = ((classid *)(packet->data))->clid;
    187187        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;
    188191        enet_packet_destroy( packet );
    189192        processClassid(cid);
  • code/branches/FICN/src/network/PacketGenerator.cc

    r632 r636  
    128128ENetPacket* PacketGenerator::clid( int classid, std::string classname, int reliable ){
    129129        unsigned char* data = (unsigned char *)malloc(3*sizeof(int)+classname.length()+1);
     130        std::cout << "classid: " << classid << ", name: " << classname << std::endl;
    130131        *(int *)data = CLASSID;
    131132        *((int *)data+1) = classname.length()+1;
  • code/branches/FICN/src/network/Server.cc

    r632 r636  
    142142        continue;
    143143      }
     144      if( !(temp->getSynched()) ){
     145        std::cout << "not sending gamestate" << std::endl;
     146        temp=temp->next();
     147        continue;
     148      }
    144149      std::cout << "doing gamestate" << std::endl;
    145150      int gid = temp->getGamestateID();
Note: See TracChangeset for help on using the changeset viewer.