mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-06 13:48:59 -04:00
Added RsConfig class which will in the future support most of the interface from rsinit.h & rsiface.h
* Moved rsnetwork.h => rsconfig.h * Implemented Network functions (call p3NetMgr) in RsConfig. * Implemented UserLevel (New/Basic/Casual/Power) Levels * added p3PeerMgr::haveOnceConnected() function, for UserLevel support. git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5-netupgrade@4431 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
4792d7c878
commit
c2a0309f05
9 changed files with 574 additions and 96 deletions
|
@ -320,18 +320,36 @@ int p3PeerMgr::getConnectAddresses(const std::string &id,
|
|||
return 1;
|
||||
}
|
||||
|
||||
/****************************
|
||||
* Update state,
|
||||
* trigger retry if necessary,
|
||||
*
|
||||
* remove from DHT?
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/******************************** Feedback ...... *********************************
|
||||
* From various sources
|
||||
*/
|
||||
bool p3PeerMgr::haveOnceConnected()
|
||||
{
|
||||
RsStackMutex stack(mPeerMtx); /****** STACK LOCK MUTEX *******/
|
||||
|
||||
/* check for existing */
|
||||
std::map<std::string, peerState>::iterator it;
|
||||
for(it = mFriendList.begin(); it != mFriendList.end(); it++)
|
||||
{
|
||||
if (it->second.lastcontact > 0)
|
||||
{
|
||||
#ifdef PEER_DEBUG
|
||||
std::cerr << "p3PeerMgr::haveOnceConnected() lastcontact: ";
|
||||
std::cerr << time(NULL) - it->second.lastcontact << " for id: " << it->first;
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef PEER_DEBUG
|
||||
std::cerr << "p3PeerMgr::haveOnceConnected() all Last Contacts = 0";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*******************************************************************/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue