FIELD_NAME:
The following fields are currently defined as standard fields, but any two letters are allowed for a field name. Field names are case-sensitive.
You MUST support VP, VM and VV. You SHOULD support TT. Everything else is 100% optional.
Version Metadata
VP: Max protocol version you support. Currently, we're at version 1 here. Example: "1".
VM: The name of your RP addon. Example: "MarySue", "MyRolePlay", "ImmersionRP".
VV: The version of your RP addon. Obviously, addon-specific, and may have no specific meaning. Example: "3.1.52", "1.0b-7-g78f6272".
Names
NP: Prefix to your name. Examples: "Mr.", "Mrs.", "Miss", "Mistress", "Sir", "Lord", "Baron", "Overlord", "Crystal Dragon Princess".
NF: First name. (Note: This might not be your character's in-game name, and can be used to change that or even remove that, in which case supporting addons probably ought to display the OOC character name somewhere in the tooltip as well; doubly so if all the fields are blank.) If undefined, addons should assume that using the characters UnitName is appropriate here. Examples: "Moonbeam", "Elyissa", "Dulcamara", "" (i.e. no first name known), "?" (presumably suggesting the character's identity is mysteriously unknown), "Bob".
NM: Middle names. There may be zero, one, or more, separated with spaces or occasionally hyphens, one would assume. Examples: "Charles John", "Rebecca", "Marie-Elisabeth-Rochelle"...
NS: Suffix, i.e. last name. Appears after the middle names when written. May be more than one word. May be blank, and defaults to blank. May also be your character's UnitName, with the first name changed, i.e. Knotbrooke is actually "Mr. Knotbrooke". Examples: "Bobson", "Menethil", ", son of Durotan", "", "LeNoir"
NT: Title. Just as implemented in RSP of yore. Something that by rights would normally appear below your name. Examples: "Vampire Slayer", "Experimental Researcher".
To display a name we probably want something like this:—
local displayname = ("%s %s %s %s"):format(NP, NF or UnitName(unit), NM, NS)
displayname = string.gsub(displayname, "%s%s+", " ")
displayname = string.gsub(displayname, "%s+,%s+", ", ")
print(displayname)
Note, removing spaces before commas (to allow suffixes with commas to work cleanly) and removing runs of more than one space (because one or more field may well be empty). Note also, as a reminder, the empty string for NF is not nil, and so will override UnitName(unit).
Note: All the fields above this, when changed, should also increment the version number for the TT field below.
Tooltip
TT: Tooltip. A meta-field used as a short-cut to requesting all the fields commonly used in a tooltip. Reserved, and is blank on its own, but its version number is used. If this is requested, return the following fields (if supported/populated), in this order: TT, VP, VM, VV, NP, NF, NM, NS, NT (i.e. all the ones above this one, in this list of field names). You should increment the version number for this field every time you change one of the others this returns.
Efficient clients may wish to precalculate their reply to this, and keep it around for very quick sending, as this is likely to be a common request.