DRD Search Users — Group 16, Code 142
Searches the directory by first name, last name, or both. Matching is a case-insensitive prefix match: ali finds Alice, Alison, and ALI. Open read: no authentication required.
Quick reference
| Command Group | 16 (DRD) |
| Command Code | 142 (0x8E) |
| Server function | cmd_drd_search_users in cmd_drd.c |
| Request body | Variable: challenge(16) + flags(1) + limit(1) + one or two length-prefixed names + terminator(2). Minimum 22 bytes. |
| Authentication | None — user records are public |
| Matching | Case-insensitive prefix match on each supplied name |
| Result cap | Server maximum 50 records per request |
| Success response | Status 250 + count(1) + that many user records |
Request body
Diagram shows an example searching both names with 3-byte prefixes (ALI, SMI): flags 0x03, 28 bytes total. FL/LL = name lengths; LIM = requested result limit.
| Body offset | Size | Field | Description |
|---|---|---|---|
| 0–15 | 16 | Challenge | 12 random bytes + big-endian CRC32 of them. |
| 16 | 1 | Flags | Bit 0 = first-name field present, bit 1 = last-name field present. At least one bit must be set; 0x00 → ERROR_INVALID_PARAMETER. |
| 17 | 1 | Limit | Requested maximum result count. 0 or anything over 50 is clamped to the server cap of 50. |
| 18... | 1 + len | First-name prefix | Present only when flags bit 0 is set: length byte (1–63) followed by UTF-8 bytes. |
| ... | 1 + len | Last-name prefix | Present only when flags bit 1 is set: length byte (1–63) followed by UTF-8 bytes. Must end exactly at the terminator. |
| last 2 | 2 | Terminator | Fixed 3E 3E. |
Response
The payload is a one-byte count followed by that many user records, each in the same serialization documented on the get_user page. Records are variable length; parse FL and LL to advance. When both name fields are supplied, a record must match both prefixes. Results are sorted by name; a count of 0 with status 250 means nothing matched.
Search response payload
+--------+---------------------------+---------------------------+-----+
| count | user record 1 | user record 2 | ... |
| 1 byte | 34 + FL + LL bytes | 34 + FL + LL bytes | |
+--------+---------------------------+---------------------------+-----+
Status codes
| Decimal | Hex | Symbol | Meaning |
|---|---|---|---|
| 250 | 0xFA | STATUS_SUCCESS | Search ran; payload contains 0–50 records. |
| 16 | 0x10 | ERROR_INVALID_PACKET_LENGTH | Body under 22 bytes, a declared name runs past the body, or bytes remain after the last name. |
| 198 | 0xC6 | ERROR_INVALID_PARAMETER | Flags 0x00, a zero-length name, or a name length over 63. |
| 252 | 0xFC | ERROR_INTERNAL | Database failure. |
| 254 | 0xFE | ERROR_MEMORY_ALLOC | Server allocation failure. |
Common mistakes
Expecting substring or fuzzy matching
Matching is prefix-only: lic does not find Alice. Clients wanting looser search should fetch with a shorter prefix and filter locally.
Sending wildcard characters
%, _, and \ in a search prefix are treated as literal characters, not wildcards. A prefix of 100% only matches names that literally start with 100%.
Assuming one server has everyone
Each RAIDA answers from its own directory copy. For a thorough people-search, query several RAIDAs and merge by denomination + serial number.