| 2817 | #endif |
| 2818 | |
| 2819 | void CUpDownClient::SendSharedDirectories() |
| 2820 | { |
| 2821 | // This list will contain all (unique) folders. |
| 2822 | PathList foldersToSend; |
| 2823 | |
| 2824 | // The shared folders |
| 2825 | const unsigned folderCount = theApp->glob_prefs->shareddir_list.size(); |
| 2826 | for (unsigned i = 0; i < folderCount; ++i) { |
| 2827 | foldersToSend.push_back(theApp->glob_prefs->shareddir_list[i]); |
| 2828 | } |
| 2829 | |
| 2830 | // ... the categories folders ... (category 0 -> incoming) |
| 2831 | for (unsigned i = 0; i < theApp->glob_prefs->GetCatCount(); ++i) { |
| 2832 | foldersToSend.push_back(theApp->glob_prefs->GetCategory(i)->path); |
| 2833 | } |
| 2834 | |
| 2835 | // Strip duplicates |
| 2836 | foldersToSend.sort(); |
| 2837 | foldersToSend.unique(); |
| 2838 | |
| 2839 | // Build packet |
| 2840 | CMemFile tempfile(80); |
| 2841 | tempfile.WriteUInt32(foldersToSend.size() + 1); // + 1 for the incomplete files |
| 2842 | |
| 2843 | PathList::iterator it = foldersToSend.begin(); |
| 2844 | for (; it != foldersToSend.end(); ++it) { |
| 2845 | // Note: the public shared name contains the 'raw' path, so we can recognize it again. |
| 2846 | // the 'raw' path is determined using CPath::GetRaw() |
| 2847 | tempfile.WriteString( theApp->sharedfiles->GetPublicSharedDirName(*it), GetUnicodeSupport() ); |
| 2848 | } |
| 2849 | |
| 2850 | // ... and the Magic thing from the eDonkey Hybrids... |
| 2851 | tempfile.WriteString(OP_INCOMPLETE_SHARED_FILES, GetUnicodeSupport()); |
| 2852 | |
| 2853 | // Send the packet. |
| 2854 | CPacket* replypacket = new CPacket(tempfile, OP_EDONKEYPROT, OP_ASKSHAREDDIRSANS); |
| 2855 | theStats::AddUpOverheadOther(replypacket->GetPacketSize()); |
| 2856 | AddDebugLogLineN( logLocalClient, "Local Client: OP_ASKSHAREDDIRSANS to " + GetFullIP() ); |
| 2857 | SendPacket(replypacket, true, true); |
| 2858 | } |
| 2859 | |
| 2860 | void CUpDownClient::SendSharedFilesOfDirectory(const wxString& strReqDir) |
| 2861 | { |
no test coverage detected