Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9402 in orxonox.OLD


Ignore:
Timestamp:
Jul 24, 2006, 9:26:31 AM (18 years ago)
Author:
patrick
Message:

fixed another bug: anomality in the permissions settings. Mr Data made a full scan, investigation closed. Mr Helm, bring us out of orbit

Location:
branches/proxy/src/lib/network
Files:
2 edited

Legend:

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

    r9401 r9402  
    720720      // server fakes uniqueid == 0 for handshake
    721721      if ( ( SharedNetworkData::getInstance()->isMasterServer() || SharedNetworkData::getInstance()->isProxyServer() ) &&
    722              sync.getUniqueID() < SharedNetworkData::getInstance()->getMaxPlayer() + 1 )
     722             sync.getUniqueID() <= SharedNetworkData::getInstance()->getMaxPlayer())
    723723        n = Converter::intToByteArray( 0, buf + offset, UDP_PACKET_SIZE - offset );
    724724      else
  • branches/proxy/src/lib/network/synchronizeable.cc

    r9396 r9402  
    229229    else
    230230      hasPermission = false;
     231
     232    PRINTF(0)("i have |%i| permission to getStateDiff %s\n", hasPermission, (*it)->getName().c_str());
    231233
    232234
     
    357359      hasPermission = true;
    358360    // now check OWNER permissions
    359     else if( this->owner == SharedNetworkData::getInstance()->getHostID() && (*it)->checkPermission( PERMISSION_OWNER ))
     361    else if( this->owner == userId && (*it)->checkPermission( PERMISSION_OWNER ))
    360362      hasPermission = true;
    361363    // now check ALL permissions
    362364    else if( (*it)->checkPermission( PERMISSION_ALL ))
    363365      hasPermission = true;
    364     // SPECIAL: get write permissions if i am master server and i am able to overwrite the client stuff
    365     else if( this->networkStream->isUserMasterServer( userId ) && this->owner != userId && (*it)->checkPermission( PERMISSION_OWNER ))
    366       hasPermission = true;
    367     // SPECIAL: get write permissions if i am proxy server and i am able to overwrite the client stuff
    368     else if( this->networkStream->isUserProxyServer( userId )  && this->owner != userId && (*it)->checkPermission( PERMISSION_OWNER ))
     366    // SPECIAL: get write permissions if im sending to a master server that does not own this sync
     367    else if( this->networkStream->isUserMasterServer( userId ) && this->owner != SharedNetworkData::getInstance()->getHostID() && (*it)->checkPermission( PERMISSION_OWNER ))
     368      hasPermission = true;
     369    // SPECIAL: get write permissions if im sending to a proxy server that does not own this sync
     370    else if( this->networkStream->isUserProxyServer( userId )  && this->owner != SharedNetworkData::getInstance()->getHostID() && (*it)->checkPermission( PERMISSION_OWNER ))
    369371      hasPermission = true;
    370372    else
    371373      hasPermission = false;
     374
     375
     376    PRINTF(0)("i have |%i| permission to write %s\n", hasPermission, (*it)->getName().c_str());
    372377
    373378    // if it has the permission to write do it
Note: See TracChangeset for help on using the changeset viewer.