Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Nov 9, 2008, 7:11:53 PM (16 years ago)
Author:
landauf
Message:

Split up LevelManager into LevelManager and PlayerManager where LevelManager handles all levels and is only active on the server, while PlayerManager handles client connections and passes new players to the LevelManager (if running on a server). If running on a client, PlayerManager just maps PlayerInfos with clientIDs.

Also added a small hack in Level.cc to show the ChatOverlay on clients.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/objecthierarchy/src/network/Synchronisable.cc

    r2156 r2168  
    7979    classID = (unsigned int)-1;
    8080    syncList = new std::list<synchronisableVariable *>;
    81    
    82    
     81
     82
    8383#ifndef NDEBUG
    8484    ObjectList<Synchronisable>::iterator it;
     
    173173      return 0;
    174174    }
    175    
     175
    176176    COUT(4) << "fabricating object with id: " << header->objectID << std::endl;
    177177
     
    240240    if (it1 != objectMap_.end())
    241241      return it1->second;
    242    
     242
    243243    ObjectList<Synchronisable>::iterator it;
    244244    for(it = ObjectList<Synchronisable>::begin(); it; ++it){
     
    295295#endif
    296296  }
    297  
     297
    298298  void Synchronisable::unregisterVariable(void *var){
    299299    std::list<synchronisableVariable *>::iterator it = syncList->begin();
     
    311311    // the variable has not been registered before
    312312  }
    313  
     313
    314314
    315315  /**
     
    366366        continue;  // this variable should only be received
    367367      }
    368      
     368
    369369      // =========== start bidirectional stuff =============
    370370      // if the variable gets synchronised bidirectional, then add the reference to the bytestream
     
    397397      }
    398398      // ================== end bidirectional stuff
    399        
     399
    400400      switch((*i)->type){
    401401        case DATA:
     
    461461      bool callback=false;
    462462      bool master=false;
    463      
     463
    464464      if( ( (*i)->mode & direction::bidirectional ) == direction::bidirectional )
    465465      {
     
    505505        mem += sizeof((*i)->varReference);
    506506      }
    507      
     507
    508508      switch((*i)->type){
    509509        case DATA:
     
    525525          (*i)->size = *(size_t *)mem;
    526526          mem += sizeof(size_t);
    527          
     527
    528528          if( (*i)->callback) // check whether this string changed
    529529            if( *static_cast<std::string*>((*i)->var) != std::string((char *)mem) )
     
    535535              *static_cast<std::string*>((*i)->varBuffer)=*static_cast<std::string*>( (void*)(mem+sizeof(size_t)) );
    536536          }
    537          
     537
    538538          *((std::string *)((*i)->var)) = std::string((const char*)mem);
    539539          COUT(5) << "synchronisable: char: " << (const char*)mem << " string: " << std::string((const char*)mem) << std::endl;
Note: See TracChangeset for help on using the changeset viewer.