Difference between revisions of "Server.met file"

From AMule Project FAQ
Jump to: navigation, search
Line 14: Line 14:
  
 
== Format ==
 
== Format ==
 +
 +
=== File Format ===
  
 
This file's fields are written in [[little endian]] order.
 
This file's fields are written in [[little endian]] order.
Line 27: Line 29:
 
**Block of Tags: Each [[server]] can have a list of associated tags with the format bellow.
 
**Block of Tags: Each [[server]] can have a list of associated tags with the format bellow.
  
== Tags Format ==
+
=== Tags Format ===
  
There are two tag identifiers: a name (string) or an ID (1 Byte)
+
==== General tags format ====
  
Which one is used depends on the tag value type given or on the size of the tag name; if tag name length = 1 , an ID is used.
+
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 value type (1 Byte)
 
*Tag Name Length (2 Bytes)
 
*Tag Name Length (2 Bytes)
 
*Tag Name (size given above)
 
*Tag Name (size given above)
*Tag value (size depends on tag type)
+
*Tag value (size depends on [[#Tag_value_types|tag type]])
 
+
== Tag value types ==
+
 
+
*TAGTYPE_STRING (0x02) - Defines a string tag.
+
 
+
IMPORTANT: systens 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.
+
 
+
*TAGTYPE_UINT32 (0x03) - Defines a numeric tag.
+
 
+
== Tag IDs ==
+
 
+
ID (code) - tag value type
+
 
+
*ST_SERVERNAME (0x01) - TAGTYPE_STRING
+
 
+
*ST_DESCRIPTION (0x0B) - TAGTYPE_STRING
+
 
+
*ST_PING (0x0C) - TAGTYPE_UINT32
+
 
+
*ST_FAIL (0x0D) - TAGTYPE_UINT32
+
 
+
*ST_PREFERENCE (0x0E) - TAGTYPE_UINT32
+
 
+
*ST_DYNIP (0x85) - TAGTYPE_STRING
+
 
+
*ST_MAXUSERS (0x87) - TAGTYPE_UINT32
+
 
+
*ST_SOFTFILES (0x88) - TAGTYPE_UINT32
+
 
+
*ST_HARDFILES (0x89) - TAGTYPE_UINT32
+
 
+
*ST_LASTPING (0x90) - TAGTYPE_UINT32
+
 
+
*ST_VERSION (0x91) - TAGTYPE_STRING | TAGTYPE_UINT32
+
 
+
*ST_UDPFLAGS (0x92) - TAGTYPE_UINT32
+
  
*ST_AUXPORTSLIST (0x93) - TAGTYPE_STRING
+
==== Tag value types ====
  
*ST_LOWIDUSERS (0x94) - TAGTYPE_UINT32
+
{|
 +
|+ Tag types
 +
| '''Tag type (''Code'')'''  || '''Explanation'''
 +
|-
 +
| TAGTYPE_STRING (''0x02'') (*) || Defines a string tag.
 +
|-
 +
| TAGTYPE_UINT32 (''0x03'') || Defines a numeric tag.
 +
|}
  
== Tag Names ==
+
'''(*):''' Systems with [http://www.unicode.org Unicode] enabled have the same tag string defined twice, the first in [http://www.unicode.org Unicode], and the second in plain [http://www.asciitable.com ASCII], which will be ignored by [http://www.unicode.org Unicode] enabled [[client]]s, and used by non-[http://www.unicode.org Unicode] ones.
  
There are at the moment two tag names recognized by aMule:
+
==== Tag IDs ====
  
Tag Name - Tag Value
+
{|
 +
|+ Tag IDs
 +
| ''ID ('''code''')'' || ''Tag value type''
 +
|-
 +
| ST_SERVERNAME (''0x01'') || TAGTYPE_STRING
 +
|-
 +
| ST_DESCRIPTION (''0x0B'') || TAGTYPE_STRING
 +
|-
 +
| ST_PING (''0x0C'') || TAGTYPE_UINT32
 +
|-
 +
| ST_FAIL (''0x0D'') || TAGTYPE_UINT32
 +
|-
 +
| ST_PREFERENCE (''0x0E'') || TAGTYPE_UINT32
 +
|-
 +
| ST_DYNIP (''0x85'') || TAGTYPE_STRING
 +
|-
 +
| ST_MAXUSERS (''0x87'') || TAGTYPE_UINT32
 +
|-
 +
| ST_SOFTFILES (''0x88'') || TAGTYPE_UINT32
 +
|-
 +
| ST_HARDFILES (''0x89'') || TAGTYPE_UINT32
 +
|-
 +
| ST_LASTPING (''0x90'') || TAGTYPE_UINT32
 +
|-
 +
| ST_VERSION (''0x91'') || TAGTYPE_STRING | TAGTYPE_UINT32
 +
|-
 +
| ST_UDPFLAGS (''0x92'') || TAGTYPE_UINT32
 +
|-
 +
| ST_AUXPORTSLIST (''0x93'') || TAGTYPE_STRING
 +
|-
 +
| ST_LOWIDUSERS (''0x94'') || TAGTYPE_UINT32
 +
|}
  
*"files" - TAGTYPE_UINT32 - Shows the number of files registered in the server
+
==== Tag Names ====
  
*"users" - TAGTYPE_UINT32 - Shows the number of users registered in the server
+
{| border=0
 +
|+ There are at the moment two tag names recognized by [[aMule]]:
 +
| width="100px" | '''Tag Name''' || '''Tag Value'''
 +
|-
 +
| "files" || TAGTYPE_UINT32 || Shows the number of [[file]]s registered in the [[server]]
 +
|-
 +
|"users" || TAGTYPE_UINT32 || Shows the number of [[user]]s registered in the [[server]]
 +
|}

Revision as of 22:55, 7 June 2005

File

Name: server.met

Location: ~/.aMule/

Description

Binary file containing the list of servers known to aMule.

Because its 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, 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 (size depends on tag type)

Tag value types

Tag types
Tag type (Code) Explanation
TAGTYPE_STRING (0x02) (*) Defines a string tag.
TAGTYPE_UINT32 (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
ST_SERVERNAME (0x01) TAGTYPE_STRING
ST_DESCRIPTION (0x0B) TAGTYPE_STRING
ST_PING (0x0C) TAGTYPE_UINT32
ST_FAIL (0x0D) TAGTYPE_UINT32
ST_PREFERENCE (0x0E) TAGTYPE_UINT32
ST_DYNIP (0x85) TAGTYPE_STRING
ST_MAXUSERS (0x87) TAGTYPE_UINT32
ST_SOFTFILES (0x88) TAGTYPE_UINT32
ST_HARDFILES (0x89) TAGTYPE_UINT32
ST_LASTPING (0x90) TAGTYPE_UINT32
ST_VERSION (0x91) TAGTYPE_UINT32
ST_UDPFLAGS (0x92) TAGTYPE_UINT32
ST_AUXPORTSLIST (0x93) TAGTYPE_STRING
ST_LOWIDUSERS (0x94) TAGTYPE_UINT32

Tag Names

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