Server.met file

From AMule Project FAQ
Jump to: navigation, search

File

Name: server.met

Location: ~/.aMule/

Description

Binary file containing the list of servers known to aMule.

Because it's in binary format, it must be changed within aMule, or with other appropriate tools.

The format description below is for development information purposes.

Format

File Format

This file's fields are written in little endian order.

Note: All digit fields are unsigned unless stated.

  • Met Header (1 Byte): With value Ox0E or OxE0, and is used in aMule to check for valid server.met files
  • Server Count (4 Bytes): Lists the number of servers that follow
  • Block of servers: Each server is constituted by the following fields:
    • Server IP (4 Bytes): Simply that. The server's IP.
    • Server Port (2 Bytes): Simply that. The port through which aMule will connect to the server.
    • Tag Count (4 Bytes): Lists the number of server tags that follows.
    • Block of Tags: Each server can have a list of associated tags with the format bellow.

Tags Format

General tags format

There are two tag identifiers: A name (string) and an ID (1 Byte)

Which one is used depends on the tag value type given or on the size of the tag name. If tag name length is 1, an ID is used.

  • Tag value type (1 Byte)
  • Tag name length (2 Bytes)
  • Tag name (size given above)
  • Tag value length (2 Bytes) (Only when the value is a string)
  • Tag value (if the value is a string, it's size is given in the above field. If it is not a string, the size depends on the type of value it is)

Tag value types

Tag types
Tag type (Code) Explanation
String (0x02) (*) Defines a string tag.
Unsigned 32 bits number (0x03) Defines a numeric tag.

(*): Systems with Unicode enabled have the same tag string defined twice, the first in Unicode, and the second in plain ASCII, which will be ignored by Unicode enabled clients, and used by non-Unicode ones.

Tag IDs

Tag IDs
ID (code) Tag value type Description
ServerName (0x01) String Name of the server
Description (0x0B) String Short description about the server
Ping (0x0C) Unsigned 32 bits number Time (in ms) it takes to comunicate with the server
Fail (0x0D) Unsigned 32 bits number How many times connecting to the server failed
Preference (0x0E) Unsigned 32 bits number Priority given to this server among the others (Normal=0, High=1, Low=2)
DNS (0x85) String DNS of the server
Max users (0x87) Unsigned 32 bits number Maximum number of users the server allows to simoultaneously connect to it
Soft files (0x88) Unsigned 32 bits number Soft files number
Hard files (0x89) Unsigned 32 bits number Hard files number
Last ping (0x90) Unsigned 32 bits number Last time the server was pinged
Version (0x91) String / Unsigned 32 bits number Version and name of the software the server is running to support the ed2k network
UDP flags (0x92) Unsigned 32 bits number Informs of the actions the server accepts through UDP connections. This flags are:
  • 0x01: Get sources
  • 0x02: Get files
  • 0x08: New tags
  • 0x10: Unicode
  • 0x20: Get extended sources info
Auxiliary ports list (0x93) String Some servers have additional ports open for those users who cannot connect to the standard one (usually because they have a firewall which tries to stop P2P connections). This servers tell in this field which additional ports they have open. Each additional port is separated from the others by a coma (,).
LowID clients (0x94) Unsigned 32 bits number Number of users connected with a LowID

Tag Names

There are at the moment two tag names recognized by aMule:
Tag Name Tag Value
"files" Unsigned 32 bits number Shows the number of files registered in the server
"users" Unsigned 32 bits number Shows the number of users registered in the server

Example

The following is an example file:

E00200000050EFC86CB80B0C000000020100010A004269472042616E4720390201000B0E0077 77772E42694742616E472E746F0305007573657273EF1A010003050066696C657331DC8C0003 01000C9C00000003010090332B114303010087E0930400030100888813000003010089102700 0002010091040031372E3603010092FB0000000301009474580000428722C64E200C00000002 0100011E003E3E3E2A2A2A5757572E534558455345584F5345582E434F4D2A2A2A2020

Here goes the explanation of the file:

  • E0 <- Validation initial value
  • 02000000 <- 2 servers will be listed (remember its little endian)
  • Server #1:
    • 50EFC86C <- IP: 108.200.239.80 (remember its little endian) endian]])
    • B80B <- Port: 3000 (remember its little endian)
    • 0C000000 <- 12 tags (remember its little endian)
    • Tag #1
      • 02 <- Tag type 2 (String)
      • 0100 <- Tag name length: 1 (remember its little endian)
      • 01 <- Tag name: 1 (Server name)
      • 0A00 <- Tag value length: 10 (remember its little endian)
      • 4269472042616E472039 <- Tag value: BiG BanG 9 (server name)
    • Tag #2
      • 02 <- Tag type 2 (String)
      • 0100 <- Tag name length: 1 (remember its little endian)
      • 0B <- Tag name: 0B (Description)
      • 0E00 <- Tag value length: 14 (remember its little endian)
      • 7777772E42694742616E472E746F <- Tag value: www.BiGBanG.to (server description)
    • Tag #3
      • 03 <- Tag type 3 (Unsigned 32 bits number)
      • 0500 <- Tag name length: 5 (remember its little endian)
      • 7573657273 <- Tag name: users (this is a string, not a code)
      • EF1A0100 <- Tag value: 72431 (remember its little endian)
    • Tag #4
      • 03 <- Tag type 3 (Unsigned 32 bits number)
      • 0500 <- Tag name length: 5 (remember its little endian)
      • 66696C6573 <- Tag name: files (this is a string, not a code)
      • 31DC8C00 <- Tag value: 9231409 (remember its little endian)
    • Tag #5
      • 03 <- Tag type 3 (Unsigned 32 bits number)
      • 0100 <- Tag name length: 1 (remember its little endian)
      • 0C <- Tag name: 0C (Ping)
      • 9C000000 <- Tag value: 156 (ping time in ms)
    • Tag #6
      • 03 <- Tag type 3 (Unsigned 32 bits number)
      • 0100 <- Tag name length: 1 (remember its little endian)
      • 90 <- Tag name: 90 (Last ping)
      • 332B1143 <- Tag value: 5:10:43 28/08/2005 (last time the server was pinged)
    • Tag #7
      • 03 <- Tag type 3 (Unsigned 32 bits number)
      • 0100 <- Tag name length: 1 (remember its little endian)
      • 87 <- Tag name: 87 (Max users)
      • E0930400 <- Tag value: 300000 (max users)
    • Tag #8
      • 03 <- Tag type 3 (Unsigned 32 bits number)
      • 0100 <- Tag name length: 1 (remember its little endian)
      • 88 <- Tag name: 88 (Soft files)
      • 88130000 <- Tag value: 5000 (soft files)
    • Tag #9
      • 03 <- Tag type 3 (Unsigned 32 bits number)
      • 0100 <- Tag name length: 1 (remember its little endian)
      • 89 <- Tag name: 89 (Hard files)
      • 10270000 <- Tag value: 10000 (hard files)
    • Tag #10
      • 02 <- Tag type 2 (String)
      • 0100 <- Tag name length: 1 (remember its little endian)
      • 91 <- Tag name: 91 (Version)
      • 0400 <- Tag value length: 4 (remember its little endian)
      • 31372E36 <- Tag value: 17.6 (version)
    • Tag #11
      • 03 <- Tag type 3 (Unsigned 32 bits number)
      • 0100 <- Tag name length: 1 (remember its little endian)
      • 92 <- Tag name: 92 (UDP flags)
      • FB000000 <- Tag value (in binnary, only the least valuable byte): 11111001 (UDP flags: get sources, new tags, unicode, extended sources)
    • Tag #11
      • 03 <- Tag type 3 (Unsigned 32 bits number)
      • 0100 <- Tag name length: 1 (remember its little endian)
      • 94 <- Tag name: 94 (LowID users)
      • 74580000 <- Tag value: 22644 (LowID users)
  • Server #2
    • 428722C6 <- IP: 198.34.135.66 (remember its little endian)
    • 4E20 <- Port: 8270 (remember its little endian)
    • 01000000 <- 1 tag (remember its little endian)
    • Tag #1
      • 02 <- Tag type 2 (String)
      • 0100 <- Tag name length: 1 (remember its little endian)
      • 01 <- Tag name: 1 (Server name)
      • 1E00 <- Tag value length: 30 (remember its little endian)
      • 3E3E3E2A2A2A5757572E534558455345584F5345582E434F4D2A2A2A2020 <- Tag value: ***WWW.EXAMPLE.COM*** (server name)

More

For more information on tags used in eMule files and protocol, check the ed2k tag documentation at the Hydranode project.