VP_EVENT_AVATAR_DELETE

From Virtual Paradise Wiki
Revision as of 09:28, 25 August 2013 by Roy Curtis (talk | contribs) (Created page with "{{sdk event page|avatar_delete|Received when a client leaves the currently connected world |attributes= {{sdk attribute row|int |avatar_session|Session ID of leaving clien...")
(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_AVATAR_DELETE, event_avatar_delete);

void event_avatar_delete(VPInstance instance) { }

Received when a client leaves the currently connected world

Attributes

Attribute Usage
VP_AVATAR_SESSION Session ID of leaving client
VP_AVATAR_NAME Name of leaving client

Behavior

Contrary to VP_EVENT_AVATAR_ADD's behavior when entering a world, this event is not fired for every client in the world if:

  • The world is changed with vp_enter() or left with vp_leave()
  • There is an unexpected disconnection from the world or universe server
  • The instance is destroyed with vp_destroy()

Caveats

Due to the above behavior, bots that are keeping track of clients through a list along with VP_EVENT_AVATAR_ADD and VP_EVENT_AVATAR_DELETE should clear it if any of the above occur. Otherwise, the bot's list may become out-of-sync with the server's list. For example:

  • Bot enters the world
  • Client A enters the world; Bot adds it to internal list
  • Client B enters the world; Bot adds it to internal list
  • Bot unexpectedly disconnects from the world
  • Client A leaves the world
  • Bot reconnects to the world
  • Bot sees Client B "enter" again and adds it to internal list
  • Bot's list now consists of: Client A, Client B, Client B

Examples

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