Skip to content

Profile

The profile is the text a player writes about their character. The client shows it with the Profile button of the paperdoll, and the player edits their own in the same window. It needs no command: the client turns the button into the profile packet (0xB8).

  • A player reads their own profile at any distance. The profile of another player can be read when both stand on the same map within 12 tiles and the viewer is not kept from seeing them: a hidden player’s profile is for staff only. The profile of an NPC cannot be read.
  • The window shows, on top, the title of the paperdoll (for example “Lord Anna, the Brave”), then the text. Under the player’s own text a line tells how old the character is: “This character is 3 day(s) old.”
  • A player edits only their own profile. The packet names a serial, but the server never trusts it: an edit that names another player changes nobody and gets no answer. The client asks again after an edit, so the server does not reply.
  • The text is cleaned before it is kept: control characters (the NUL included) and lone halves of a surrogate pair are dropped, the line breaks stay, the ends are trimmed, and it is cut at 511 characters. An empty text clears the profile.

The text is the prop profile of the character, so the world save writes it with the character and no migration is needed. A character with no profile has no prop.

The profile module reads and writes it, for a script or a staff command:

Function What it does
profile.get(player) The text of the profile; an empty string when there is none, or for an NPC or an unknown serial
profile.set(player, text) Writes the profile, cleaned and cut like a player’s edit; nil or an empty text clears it. true when it changed

0xB8 comes from the client with a mode: 0 asks to show the profile of a serial, 1 edits it (two bytes skipped, the number of characters, then the UTF-16BE text with no terminator). A request whose mode the server does not know, or an edit with no room for the count, is ignored; an edit reads the characters it really holds, whatever its count says, and a broken surrogate pair is dropped by the cleaning. Nothing in it costs the client its connection. The server answers a display request with 0xB8: the serial, the title in Latin-1, then the footer and the body in UTF-16BE. The footer comes first on the wire; the client lets the player edit the body. See Packets.

The lock of the profile that ModernUO has, a script trigger on every read or write, a limit on how often it is edited, and a filter of words.

Made with ❤️ by Tom

Buy me a coffee