VP_EVENT_CHAT

From Virtual Paradise Wiki
Revision as of 05:40, 25 August 2013 by Roy Curtis (talk | contribs) (+caveat on console message security)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search
Event set and handler snippet

vp_event_set(instance, VP_EVENT_CHAT, event_chat);

void event_chat(VPInstance instance) { }

This event may be received when:

  • A chat message is sent to the world from a vp_say() call
  • When a console message is received from a vp_console_message() call

Attributes

Attribute Usage
VP_CHAT_TYPE Type of chat received
VP_AVATAR_SESSION Source session ID of the chat message
VP_AVATAR_NAME Source or custom associated name of the chat message
VP_CHAT_MESSAGE Chat message itself
If VP_CHAT_TYPE == VP_CHAT_CONSOLE_MESSAGE...
VP_CHAT_EFFECTS Console message text effects bitfield
VP_CHAT_COLOR_RED Console message red color component
VP_CHAT_COLOR_GREEN Console message green color component
VP_CHAT_COLOR_BLUE Console message blue color component

Behavior

  • Clients will not receive their own chat messages
  • Clients however will receive their own console messages if they are sent to all sessions (0)
  • For console messages, it is possible and valid for VP_AVATAR_NAME to be an empty string

Caveats

Clients may send console messages with any VP_AVATAR_NAME string, including names of other clients. Care should be taken to identify console messages that impersonate other users, at least by ignoring console messages or only using VP_AVATAR_SESSION as the source's identity.

Examples

This event has no usage examples; please add at least one to this page