Editing Recomendations

From EMule Wiki
Jump to: navigation, search

Warning: The database has been locked for maintenance, so you will not be able to save your edits right now. You may wish to cut-n-paste the text into a text file and save it for later.

The administrator who locked it offered this explanation: site maintenance

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 24: Line 24:
 
Bit number 2 shows if some recommendations (at least one) are available. This is evaluated in case we want to request the list from someone. (this is rather cosmetic but should save some overhead).
 
Bit number 2 shows if some recommendations (at least one) are available. This is evaluated in case we want to request the list from someone. (this is rather cosmetic but should save some overhead).
  
The request has to be sent over OP_ASKSHAREDFILESDIR (OP_OP_EDONKEYPROT) asking for a special directoy (L"*REC* suggested) and sending the answer via OP_ASKSHAREDFILESDIRANS (OP_OP_EDONKEYPROT). This has the advantage that no additional opcode has to be used and the code is nearly completely available in the official client already.
+
The request and answer are done via one opcode, if the received packet has "zero" size then it's a request, otherwise it's an answer.
 
+
I'd prefere to use
= Packet Format =
+
 
+
The recommendation request is an empty packet with the OP_RECOMMENDATIONS opcode.
+
The recommendation answer will be sent in any case, even if there are no recommendations available. That way only ONE opcode is used.
+
The packet will look like that (adapted from official code):
+
 
<pre>
 
<pre>
[uint32 4]    //filecount
+
#define OP_RECOMMENDATIONS 0x52 //'R'
// file 1
+
[hash128 16]  //filehash
+
[uint32 4]    //our ID - only if useful*
+
[uint16 2]    //our Port - only if useful*
+
[uint32 4]    //taglist size **
+
<taglist>      //variable size depending on which tags are to be sent
+
includes:
+
* filename    //FT_FILENAME
+
* filesize    //FT_FILESIZE
+
* filerating  //FT_FILERATING
+
* filecomment //FT_FILECOMMENT
+
can include:
+
* filetype    //FT_FILETYPE
+
* metadata    //FT_MEDIA_ARTIST,FT_MEDIA_ALBUM,FT_MEDIA_TITLE,FT_MEDIA_LENGTH,FT_MEDIA_BITRATE,FT_MEDIA_CODEC
+
...
+
// file n
+
 
</pre>
 
</pre>
 +
for that packet.
 +
  
<nowiki>*</nowiki> we are useful if we are connected, not firewalled and do currently share the recommended file
 
<nowiki>**</nowiki> it would be possible to cut that down to a uint8 (1 byte) to save overhead because it's extremely unlikely that we will ever need more than 255 tags
 
  
This format is kept for now so we can easily process the resulting packet using the ProcessSearchAnswer function which is already available in the official client.
 
  
 
[[category:Mod_protocol_extensions]]
 
[[category:Mod_protocol_extensions]]

Please note that all contributions to EMule Wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see EMule Wiki:Copyrights for details). Do not submit copyrighted work without permission!

Cancel | Editing help (opens in new window)
Personal tools