GuiProtocol

From MLDonkey

Jump to: navigation, search

This page and its links are copied from http://www.g2gui.net/wiki/index.php/GuiProtocol Its still work-in-progress --Spiralvoice 06:47, 8 February 2006 (PST)

Contents

[edit] Connection Phase

As of MLDonkey 2.5-4+2 (possibly earlier), the connection phase runs like so:

Once you've connected the socket to the server :

  • The Core sends a CoreProtocol message
  • The GUI sends a ProtocolVersion message with its protocol version
  • The GUI sends a Extensions message if it wants poll mode (optional)
  • The GUI sends a PassWord message
  • The Core replies with (these series of messages appear to come through twice)
  • The connection is established. If not in poll mode, the core sends many messages with the current state.
  • The Core will send periodic ClientStats messages, even in poll mode


The earlier connection phase looked like this:

  • The GUI sends a ProtocolVersion message with its protocol version
  • The Core replies with
  • The GUI sends a Extensions message if it wants poll mode
  • The GUI sends a PassWord message
  • The connection is established. If not in poll mode, the core sends many messages with the current state.

[edit] Basic Message Format

All integers are encoded in LittleEndian (least significant byte first).

Size of Content (Header) Opcode Payload

int32

int16

variable-size

[edit] Opcodes Received from core

GuiOpcode Name Notes
00CoreProtocol
01OptionsInfo
03DefineSearches
04ResultInfo
05SearchResult
09FileUpdateAvailability
10FileAddSource
12ServerUser
13ServerState
15ClientInfo
16ClientStateonly the state of the client has changed
19ConsoleMessage
20NetworkInfo
21UserInfo
22RoomInfofor protocol version <=3
23RoomMessage
24RoomAddUser
26ServerInfo
27MessageFromClient
28ConnectedServers
31RoomInfofor protocol version >3
34SharedFileUpload
35SharedFileUnshared
36AddSectionOptiondefine a new option to appear in the Settings panel
38AddPluginOptiondefine a new option to appear in the Settings panel
46FileDownloadUpdate
47BadPassword
48SharedFileInfoalso opcodes 33 for old protocol versions
49ClientStatsalso opcodes 25,37,39 for old protocol versions
50FileRemoveSource
51CleanTables
52FileInfoalso opcodes 7,40, 43 for old protocol versions
53DownloadingFilesalso old opcodes 29, 41, 44 for old protocol versions
54DownloadedFilesalso opcodes 30, 42, 45 for old protocol versions
55Uploaders
56Pending
57Search
58Version
59Statsprotocol > 40

[edit] Opcodes sent to core

GuiOpcode Name Notes
00ProtocolVersion
01ConnectMore
02CleanOldServers
03KillServer
04ExtendedSearch
08DlLink
09RemoveServer
10SaveOptions
11RemoveDownload
12GetServerUsers
13SaveFileAsrename file
14AddClientFriend
15AddUserFriend
16RemoveFriend
17RemoveAllFriends
18FindFriend
19ViewUsers
20ConnectAll
21ConnectServer
22DisconnectServer
23SwitchDownload
24VerifyAllChunks
25QueryFormat
26ModifyMp3Tags
27CloseSearch
28SetOption
29ConsoleCommand
30Preview
31ConnectFriend
32GetServerUsers
33GetClientFiles
34GetFileLocations
35GetServerInfo
36GetClientInfo
37GetFileInfo
38GetUserInfo
40EnableNetwork
41BrowseUser
42SearchQuery
43MessageToClient
44GetConnectedServers
45GetDownloadingFiles
46GetDownloadedFiles
47GuiExtensions
49RefreshUploadStats
50Download
51SetFilePriority
52PassWordprotocol_version > 14
53CloseSearch
54AddServer
55MessageVersionsonly for protocol 18
56RenameFile
57GetUploaders
58GetPending
59GetSearches
60GetSearch
61ConnectClient
62DisconnectClient
63NetworkMessage
64InterestedInSources
65GetVersion
68GetStatsprotocol > 40

[edit] Get information from source

To get information about the gui protocol from mldonkey's source code take a look at following files:

  • ./src/daemon/common/guiDeconding.ml
    • receive opcode -> action
  • ./src/daemon/common/guiEnconding.ml
    • action -> send opcode
  • ./src/daemon/common/guiProto.ml
Personal tools