Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9629 in orxonox.OLD for branches/proxy/src/lib


Ignore:
Timestamp:
Jul 31, 2006, 1:32:36 AM (18 years ago)
Author:
patrick
Message:

one more rule to prevent proxys overwriting masters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/proxy/src/lib/network/synchronizeable.cc

    r9628 r9629  
    423423    // Permission   SERVER accept if:
    424424    // sender == SERVER
    425     else if( (*it)->checkPermission( PERMISSION_SERVER ) && !SharedNetworkData::getInstance()->isUserClient( userId) ) {
     425    else if( (*it)->checkPermission( PERMISSION_SERVER ) && !SharedNetworkData::getInstance()->isUserClient( userId) &&
     426               SharedNetworkData::getInstance()->isClient()) {
    426427      hasPermission = true; b6 = true; }
     428    else if(  (*it)->checkPermission( PERMISSION_SERVER ) && !SharedNetworkData::getInstance()->isUserClient( userId) &&
     429                !SharedNetworkData::getInstance()->isClient() &&
     430                !SharedNetworkData::getInstance()->isUserLocal( this->owner) && this->owner !=  SharedNetworkData::getInstance()->getHostID()) {
     431      hasPermission = true; b7 = true; }
     432
     433
     434#if 0
     435
     436    // i am SERVER && reciever == SERVER && reciever != owner && ( owner is local || i am owner)
     437        else if( (*it)->checkPermission( PERMISSION_SERVER ) && !SharedNetworkData::getInstance()->isClient() &&
     438                   userId != this->owner &&
     439                   ( SharedNetworkData::getInstance()->isUserLocal( userId) || this->owner ==  SharedNetworkData::getInstance()->getHostID())) {
     440          hasPermission = true; b6 = true; }
     441#endif
     442
    427443
    428444    // Pemission    ALL accept if:
    429445    else if(  (*it)->checkPermission( PERMISSION_ALL )) {
    430       hasPermission = true; b7 = true; }
     446      hasPermission = true; b8 = true; }
    431447
    432448   // no rights to over-write local data
     
    452468//         (*it)->checkPermission( PERMISSION_OWNER ), (*it)->checkPermission( PERMISSION_MASTER_SERVER ),
    453469//         (*it)->checkPermission( PERMISSION_SERVER ), (*it)->checkPermission( PERMISSION_ALL ));
    454 //         PRINTF(0)("hasPermission: %i, eval: %i, %i, %i, %i, %i, %i, %i\n", hasPermission, b1, b2, b3, b4, b5, b6, b7);
     470//         PRINTF(0)("hasPermission: %i, eval: %i, %i, %i, %i, %i, %i, %i, %i\n", hasPermission, b1, b2, b3, b4, b5, b6, b7, b8);
    455471//         PRINTF(0)("rec %s %s %d\n", this->getClassCName(), (*it)->getName().c_str(), n);
    456472//       }
Note: See TracChangeset for help on using the changeset viewer.