MCPcopy Create free account
hub / github.com/amule-project/amule / SaveServerMet

Method SaveServerMet

src/ServerList.cpp:689–825  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

687
688
689bool CServerList::SaveServerMet()
690{
691 CPath curservermet = CPath(thePrefs::GetConfigDir() + "server.met");
692
693 CFile servermet(curservermet, CFile::write_safe);
694 if (!servermet.IsOpened()) {
695 AddLogLineN(_("Failed to save server.met!"));
696 return false;
697 }
698
699 try {
700 servermet.WriteUInt8(0xE0);
701 servermet.WriteUInt32( m_servers.size() );
702
703 for ( CInternalList::const_iterator it = m_servers.begin(); it != m_servers.end(); ++it) {
704 const CServer* const server = *it;
705
706 uint16 tagcount = 12;
707 if (!server->GetListName().IsEmpty()) {
708 ++tagcount;
709 }
710 if (!server->GetDynIP().IsEmpty()) {
711 ++tagcount;
712 }
713 if (!server->GetDescription().IsEmpty()) {
714 ++tagcount;
715 }
716 if (server->GetConnPort() != server->GetPort()) {
717 ++tagcount;
718 }
719
720 // For unicoded name, description, and dynip
721 if ( !server->GetListName().IsEmpty() ) {
722 ++tagcount;
723 }
724 if ( !server->GetDynIP().IsEmpty() ) {
725 ++tagcount;
726 }
727 if ( !server->GetDescription().IsEmpty() ) {
728 ++tagcount;
729 }
730 if (!server->GetVersion().IsEmpty()) {
731 ++tagcount;
732 }
733
734 if (server->GetServerKeyUDP(true)) {
735 ++tagcount;
736 }
737
738 if (server->GetServerKeyUDPIP()) {
739 ++tagcount;
740 }
741
742 if (server->GetObfuscationPortTCP()) {
743 ++tagcount;
744 }
745
746 if (server->GetObfuscationPortUDP()) {

Callers 2

OnBnClickedAddserverMethod · 0.45
ProcessPacketMethod · 0.45

Calls 15

GetConfigDirFunction · 0.85
CTagStringClass · 0.85
CTagInt32Class · 0.85
CTagInt16Class · 0.85
WriteUInt8Method · 0.80
WriteUInt32Method · 0.80
GetConnPortMethod · 0.80
GetServerKeyUDPMethod · 0.80
GetServerKeyUDPIPMethod · 0.80
GetObfuscationPortTCPMethod · 0.80
GetObfuscationPortUDPMethod · 0.80
WriteUInt16Method · 0.80

Tested by

no test coverage detected