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 Group16 (DRD)
Command Code142 (0x8E)
Server functioncmd_drd_search_users in cmd_drd.c
Request bodyVariable: challenge(16) + flags(1) + limit(1) + one or two length-prefixed names + terminator(2). Minimum 22 bytes.
AuthenticationNone — user records are public
MatchingCase-insensitive prefix match on each supplied name
Result capServer maximum 50 records per request
Success responseStatus 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.

Challenge random (12 bytes, part 1 of 2) 0 7 Challenge random (part 2) 8 11 Challenge CRC32 (BE) 12 15 FLAGS 16 LIM 17 FL 18 First-name prefix (ex. 3) 19 21 LL 22 La... 23 Last (cont.) 24 25 3E 3E (term) 26 27
Body offsetSizeFieldDescription
0–1516Challenge12 random bytes + big-endian CRC32 of them.
161FlagsBit 0 = first-name field present, bit 1 = last-name field present. At least one bit must be set; 0x00ERROR_INVALID_PARAMETER.
171LimitRequested maximum result count. 0 or anything over 50 is clamped to the server cap of 50.
18...1 + lenFirst-name prefixPresent only when flags bit 0 is set: length byte (1–63) followed by UTF-8 bytes.
...1 + lenLast-name prefixPresent only when flags bit 1 is set: length byte (1–63) followed by UTF-8 bytes. Must end exactly at the terminator.
last 22TerminatorFixed 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

DecimalHexSymbolMeaning
2500xFASTATUS_SUCCESSSearch ran; payload contains 0–50 records.
160x10ERROR_INVALID_PACKET_LENGTHBody under 22 bytes, a declared name runs past the body, or bytes remain after the last name.
1980xC6ERROR_INVALID_PARAMETERFlags 0x00, a zero-length name, or a name length over 63.
2520xFCERROR_INTERNALDatabase failure.
2540xFEERROR_MEMORY_ALLOCServer 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.