Attempts to exit the World of Warcraft client. Results vary based on current conditions:
- If the player is in combat or under other temporary restrictions (e.g. falling), fires the
UI_ERROR_MESSAGEevent with a message indicating the player cannot log out at the moment.
- If the player is not in an inn, major city, or other "rest" area (i.e.
nil), fires the
PLAYER_QUITINGevent, causing the default UI to show a countdown, quitting WoW after a period of time if not canceled.
- If the player is in a "rest" area, quits the game immediately.
See also Client control and information functions.