VPSDK
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Structures | Macros | Typedefs | Enumerations | Functions
VP.h File Reference

Go to the source code of this file.

Data Structures

struct  vp_terrain_cell_t
 

Macros

#define VPSDK_API   extern
 
#define VPSDK_VERSION   2
 
#define VP_PACK_TERRAIN_ATTRIBUTES(tex, rotation, visible)
 
#define VP_UNPACK_TERRAIN_VISIBILITY(x)   ((x & 0x8000) >> 15)
 
#define VP_UNPACK_TERRAIN_ROTATION(x)   ((x & 0x6000) >> 13)
 
#define VP_UNPACK_TERRAIN_TEXTURE(x)   (x & 0x0FFF)
 

Typedefs

typedef enum vp_event_t vp_event_t
 Events can be registered using vp_event_set.
 
typedef enum vp_callback_t vp_callback_t
 
typedef enum vp_int_attribute_t vp_int_attribute_t
 
typedef enum vp_float_attribute_t vp_float_attribute_t
 
typedef enum vp_string_attribute_t vp_string_attribute_t
 
typedef enum vp_data_attribute_t vp_data_attribute_t
 
typedef enum vp_proxy_type_t vp_proxy_type_t
 Proxy types.
 
typedef enum vp_url_target_t vp_url_target_t
 
typedef void * vp_instance_t
 
typedef vp_instance_t VPInstance
 
typedef void(* VPEventHandler )(VPInstance)
 
typedef void(* VPCallbackHandler )(VPInstance, int, int)
 
typedef struct vp_terrain_cell_t vp_terrain_cell_t
 

Enumerations

enum  vp_event_t {
  VP_EVENT_CHAT, VP_EVENT_AVATAR_ADD, VP_EVENT_AVATAR_CHANGE, VP_EVENT_AVATAR_DELETE,
  VP_EVENT_OBJECT, VP_EVENT_OBJECT_CHANGE, VP_EVENT_OBJECT_DELETE, VP_EVENT_OBJECT_CLICK,
  VP_EVENT_WORLD_LIST, VP_EVENT_WORLD_SETTING, VP_EVENT_WORLD_SETTINGS_CHANGED, VP_EVENT_FRIEND,
  VP_EVENT_WORLD_DISCONNECT, VP_EVENT_UNIVERSE_DISCONNECT, VP_EVENT_USER_ATTRIBUTES, VP_EVENT_CELL_END,
  VP_EVENT_TERRAIN_NODE, VP_EVENT_AVATAR_CLICK, VP_EVENT_TELEPORT, VP_EVENT_URL,
  VP_EVENT_OBJECT_BUMP_BEGIN, VP_EVENT_OBJECT_BUMP_END, VP_HIGHEST_EVENT
}
 Events can be registered using vp_event_set. More...
 
enum  vp_callback_t {
  VP_CALLBACK_OBJECT_ADD, VP_CALLBACK_OBJECT_CHANGE, VP_CALLBACK_OBJECT_DELETE, VP_CALLBACK_GET_FRIENDS,
  VP_CALLBACK_FRIEND_ADD, VP_CALLBACK_FRIEND_DELETE, VP_CALLBACK_TERRAIN_QUERY, VP_CALLBACK_TERRAIN_NODE_SET,
  VP_CALLBACK_OBJECT_GET, VP_HIGHEST_CALLBACK
}
 
enum  vp_int_attribute_t {
  VP_AVATAR_SESSION, VP_AVATAR_TYPE, VP_MY_TYPE, VP_OBJECT_ID,
  VP_OBJECT_TYPE, VP_OBJECT_TIME, VP_OBJECT_USER_ID, VP_WORLD_STATE,
  VP_WORLD_USERS, VP_REFERENCE_NUMBER, VP_CALLBACK, VP_USER_ID,
  VP_USER_REGISTRATION_TIME, VP_USER_ONLINE_TIME, VP_USER_LAST_LOGIN, VP_FRIEND_ID,
  VP_FRIEND_USER_ID, VP_FRIEND_ONLINE, VP_MY_USER_ID, VP_PROXY_TYPE,
  VP_PROXY_PORT, VP_CELL_X, VP_CELL_Z, VP_TERRAIN_TILE_X,
  VP_TERRAIN_TILE_Z, VP_TERRAIN_NODE_X, VP_TERRAIN_NODE_Z, VP_TERRAIN_NODE_REVISION,
  VP_CLICKED_SESSION, VP_CHAT_TYPE, VP_CHAT_COLOR_RED, VP_CHAT_COLOR_GREEN,
  VP_CHAT_COLOR_BLUE, VP_CHAT_EFFECTS, VP_DISCONNECT_ERROR_CODE, VP_URL_TARGET,
  VP_CURRENT_EVENT, VP_CURRENT_CALLBACK, VP_HIGHEST_INT
}
 
enum  vp_float_attribute_t {
  VP_AVATAR_X, VP_AVATAR_Y, VP_AVATAR_Z, VP_AVATAR_YAW,
  VP_AVATAR_PITCH, VP_MY_X, VP_MY_Y, VP_MY_Z,
  VP_MY_YAW, VP_MY_PITCH, VP_OBJECT_X, VP_OBJECT_Y,
  VP_OBJECT_Z, VP_OBJECT_ROTATION_X, VP_OBJECT_ROTATION_Y, VP_OBJECT_ROTATION_Z,
  VP_OBJECT_YAW = VP_OBJECT_ROTATION_X, VP_OBJECT_PITCH = VP_OBJECT_ROTATION_Y, VP_OBJECT_ROLL = VP_OBJECT_ROTATION_Z, VP_OBJECT_ROTATION_ANGLE,
  VP_TELEPORT_X, VP_TELEPORT_Y, VP_TELEPORT_Z, VP_TELEPORT_YAW,
  VP_TELEPORT_PITCH, VP_CLICK_HIT_X, VP_CLICK_HIT_Y, VP_CLICK_HIT_Z,
  VP_HIGHEST_FLOAT
}
 
enum  vp_string_attribute_t {
  VP_AVATAR_NAME, VP_CHAT_MESSAGE, VP_OBJECT_MODEL, VP_OBJECT_ACTION,
  VP_OBJECT_DESCRIPTION, VP_WORLD_NAME, VP_USER_NAME, VP_USER_EMAIL,
  VP_WORLD_SETTING_KEY, VP_WORLD_SETTING_VALUE, VP_FRIEND_NAME, VP_PROXY_HOST,
  VP_TELEPORT_WORLD, VP_URL, VP_HIGHEST_STRING
}
 
enum  vp_data_attribute_t { VP_OBJECT_DATA, VP_TERRAIN_NODE_DATA, VP_HIGHEST_DATA }
 
enum  vp_proxy_type_t { VP_PROXY_TYPE_NONE, VP_PROXY_TYPE_SOCKS4A }
 Proxy types. More...
 
enum  vp_url_target_t { VP_URL_TARGET_BROWSER, VP_URL_TARGET_OVERLAY }
 
enum  vp_chat_type { VP_CHAT_NORMAL, VP_CHAT_CONSOLE_MESSAGE, VP_CHAT_PRIVATE }
 Chat message types. More...
 
enum  vp_text_effect { VP_TEXT_EFFECT_BOLD = 1, VP_TEXT_EFFECT_ITALIC = 2 }
 Text effect flags. More...
 

Functions

VPSDK_API int vp_init (int version)
 Initialize the Virtual Paradise SDK API.
 
VPSDK_API VPInstance vp_create (void)
 Create a new instance.
 
VPSDK_API int vp_destroy (VPInstance instance)
 Destroy a Virtual Paradise SDK instance.
 
VPSDK_API int vp_connect_universe (VPInstance instance, const char *host, int port)
 Connect to a universe server.
 
VPSDK_API int vp_login (VPInstance instance, const char *username, const char *password, const char *botname)
 Login to the universe server.
 
VPSDK_API int vp_wait (VPInstance instance, int milliseconds)
 Process incoming and outgoing data.
 
VPSDK_API int vp_enter (VPInstance instance, const char *worldname)
 Enter a world, the current world will be left.
 
VPSDK_API int vp_leave (VPInstance instance)
 Leave the current world.
 
VPSDK_API int vp_say (VPInstance instance, const char *message)
 Send a simple message to everyone in the current world.
 
VPSDK_API int vp_console_message (VPInstance instance, int session, const char *name, const char *message, int effects, unsigned char red, unsigned char green, unsigned char blue)
 Send a console message.
 
VPSDK_API int vp_event_set (VPInstance instance, vp_event_t eventname, VPEventHandler event)
 Register an event handler.
 
VPSDK_API int vp_callback_set (VPInstance instance, vp_callback_t callbackname, VPCallbackHandler callback)
 Register a callback function.
 
VPSDK_API void * vp_user_data (VPInstance instance)
 Retrieve the pointer to user-defined data for this instance.
 
VPSDK_API void vp_user_data_set (VPInstance instance, void *data)
 Sets a pointer to user-defined data for this instance.
 
VPSDK_API int vp_state_change (VPInstance instance)
 Update avatar.
 
VPSDK_API int vp_int (VPInstance instance, vp_int_attribute_t name)
 
VPSDK_API float vp_float (VPInstance instance, vp_float_attribute_t name)
 
VPSDK_API const char * vp_string (VPInstance instance, vp_string_attribute_t name)
 
VPSDK_API const char * vp_data (VPInstance instance, vp_data_attribute_t name, int *length)
 
VPSDK_API int vp_int_get (VPInstance instance, vp_int_attribute_t name, int *value)
 
VPSDK_API int vp_float_get (VPInstance instance, vp_float_attribute_t name, float *value)
 
VPSDK_API int vp_string_get (VPInstance instance, vp_string_attribute_t name, char **value)
 
VPSDK_API int vp_int_set (VPInstance instance, vp_int_attribute_t name, int value)
 
VPSDK_API int vp_float_set (VPInstance instance, vp_float_attribute_t name, float value)
 
VPSDK_API void vp_string_set (VPInstance instance, vp_string_attribute_t name, const char *str)
 
VPSDK_API int vp_data_set (VPInstance instance, vp_data_attribute_t name, int length, char *data)
 
VPSDK_API int vp_query_cell (VPInstance instance, int x, int z)
 Query the objects in a single cell Each object will be sent in a VP_EVENT_OBJECT event.
 
VPSDK_API int vp_object_add (VPInstance instance)
 Builds a new object.
 
VPSDK_API int vp_object_bump_begin (vp_instance_t instance, int object_id, int session_to)
 Send a object contact begin event to other users in the world.
 
VPSDK_API int vp_object_bump_end (vp_instance_t instance, int object_id, int session_to)
 Send a object contact end event to other users in the world.
 
VPSDK_API int vp_object_change (VPInstance instance)
 Changes an existing object.
 
VPSDK_API int vp_object_click (VPInstance instance, int object_id, int session_to, float hit_x, float hit_y, float hit_z)
 Sends an object click event to other users in the world.
 
VPSDK_API int vp_object_delete (VPInstance instance, int object_id)
 Delete an object.
 
VPSDK_API int vp_object_get (VPInstance instance, int object_id)
 Request the attributes of a single object.
 
VPSDK_API int vp_world_list (VPInstance instance, int time)
 Request the world list.
 
VPSDK_API int vp_user_attributes_by_id (VPInstance instance, int user_id)
 Request user attributes by user ID.
 
VPSDK_API int vp_user_attributes_by_name (VPInstance instance, const char *name)
 Get user attributes by user name.
 
VPSDK_API int vp_friends_get (VPInstance instance)
 
VPSDK_API int vp_friend_add_by_name (VPInstance instance, const char *name)
 
VPSDK_API int vp_friend_delete (VPInstance instance, int friend_id)
 
VPSDK_API int vp_terrain_query (VPInstance instance, int tile_x, int tile_z, int revision[][4])
 Query a terrain tile.
 
VPSDK_API int vp_terrain_node_set (VPInstance instance, int tile_x, int tile_z, int node_x, int node_z, struct vp_terrain_cell_t *cells)
 Replace terrain node data.
 
VPSDK_API int vp_avatar_click (VPInstance instance, int avatar_session)
 Send an avatar click event to other users in the world.
 
VPSDK_API int vp_teleport_avatar (VPInstance instance, int target_session, const char *world, float x, float y, float z, float yaw, float pitch)
 Request that another avatar teleports to a new location.
 
VPSDK_API int vp_url_send (VPInstance instance, int session_id, const char *url, vp_url_target_t url_target)
 Send a URL to a user.
 

Macro Definition Documentation

#define VP_PACK_TERRAIN_ATTRIBUTES (   tex,
  rotation,
  visible 
)
Value:
((tex & 0x1FFF) | \
(visible << 15) | \
(rotation << 13))
#define VP_UNPACK_TERRAIN_ROTATION (   x)    ((x & 0x6000) >> 13)
#define VP_UNPACK_TERRAIN_TEXTURE (   x)    (x & 0x0FFF)
#define VP_UNPACK_TERRAIN_VISIBILITY (   x)    ((x & 0x8000) >> 15)
#define VPSDK_API   extern
#define VPSDK_VERSION   2

Typedef Documentation

typedef enum vp_event_t vp_event_t

Events can be registered using vp_event_set.

typedef void* vp_instance_t

Proxy types.

typedef void(* VPCallbackHandler)(VPInstance, int, int)
typedef void(* VPEventHandler)(VPInstance)

Enumeration Type Documentation

Enumerator:
VP_CALLBACK_OBJECT_ADD 

The attribute VP_OBJECT_ID is set to the object ID of the new object.

VP_CALLBACK_OBJECT_CHANGE 

VP_OBJECT_ID attribute is set to the changed object ID

VP_CALLBACK_OBJECT_DELETE 

VP_OBJECT_ID attribute is set to the deleted object ID

VP_CALLBACK_GET_FRIENDS 
VP_CALLBACK_FRIEND_ADD 
VP_CALLBACK_FRIEND_DELETE 
VP_CALLBACK_TERRAIN_QUERY 
VP_CALLBACK_TERRAIN_NODE_SET 
VP_CALLBACK_OBJECT_GET 

Reason codes:

Attributes:

VP_HIGHEST_CALLBACK 

Chat message types.

Enumerator:
VP_CHAT_NORMAL 
VP_CHAT_CONSOLE_MESSAGE 
VP_CHAT_PRIVATE 
Enumerator:
VP_OBJECT_DATA 
VP_TERRAIN_NODE_DATA 
VP_HIGHEST_DATA 
enum vp_event_t

Events can be registered using vp_event_set.

Enumerator:
VP_EVENT_CHAT 

Called when a user in the same world the instance is in sends a message.

Attributes:

VP_EVENT_AVATAR_ADD 

Called when a user enters the world Attributes:

VP_EVENT_AVATAR_CHANGE 

Called when a users' avatar changes shape or position Attributes:

VP_EVENT_AVATAR_DELETE 

Called when a user leaves the world.

Attributes:

VP_EVENT_OBJECT 

Called when a new object is created or sent as a result to a query.

The following attributes are set when the event is called:

VP_EVENT_OBJECT_CHANGE 

Called when an object is changed by another user.

The following attributes are set when the event is called:

VP_EVENT_OBJECT_DELETE 

Called when an object is deleted another user.

The VP_OBJECT_ID attribute is set when the event is called. Attributes:

VP_EVENT_OBJECT_CLICK 

Called when an object is clicked by another user.

The following attributes are set when the event is called:

VP_EVENT_WORLD_LIST 

Attributes: Called when a world changes state or when the world list is requested using vp_world_list.

VP_EVENT_WORLD_SETTING 

Attributes:

VP_EVENT_WORLD_SETTINGS_CHANGED 

Attributes: Called when the server is done sending world settings.

VP_EVENT_FRIEND 
VP_EVENT_WORLD_DISCONNECT 

Attributes:

VP_EVENT_UNIVERSE_DISCONNECT 

Attributes:

VP_EVENT_USER_ATTRIBUTES 

Attributes:

VP_EVENT_CELL_END 

Attributes:

VP_EVENT_TERRAIN_NODE 

Attributes:

VP_EVENT_AVATAR_CLICK 

Attributes:

VP_EVENT_TELEPORT 

Attributes:

  • VP_AVATAR_SESSION
  • VP_TELEPORT_X
  • VP_TELEPORT_Y
  • VP_TELEPORT_Z
  • VP_TELEPORT_YAW
  • VP_TELEPORT_PITCH
  • VP_TELEPORT_WORLD
VP_EVENT_URL 

Attributes:

  • VP_AVATAR_SESSION
  • VP_URL
  • VP_URL_TARGET
VP_EVENT_OBJECT_BUMP_BEGIN 

Attributes:

  • VP_AVATAR_SESSION
  • VP_OBJECT_ID
VP_EVENT_OBJECT_BUMP_END 

Attributes:

  • VP_AVATAR_SESSION
  • VP_OBJECT_ID
VP_HIGHEST_EVENT 
Enumerator:
VP_AVATAR_X 
VP_AVATAR_Y 
VP_AVATAR_Z 
VP_AVATAR_YAW 
VP_AVATAR_PITCH 
VP_MY_X 
VP_MY_Y 
VP_MY_Z 
VP_MY_YAW 
VP_MY_PITCH 
VP_OBJECT_X 
VP_OBJECT_Y 
VP_OBJECT_Z 
VP_OBJECT_ROTATION_X 
VP_OBJECT_ROTATION_Y 
VP_OBJECT_ROTATION_Z 
VP_OBJECT_YAW 

Only works correctly when VP_OBJECT_ROTATION_ANGLE is set to infinity.

Deprecated:
Use VP_OBJECT_ROTATION_X, VP_OBJECT_ROTATION_Y, VP_OBJECT_ROTATION_Z and VP_OBJECT_ROTATION_ANGLE
VP_OBJECT_PITCH 

Only works correctly when VP_OBJECT_ROTATION_ANGLE is set to infinity.

Deprecated:
Use VP_OBJECT_ROTATION_X, VP_OBJECT_ROTATION_Y, VP_OBJECT_ROTATION_Z and VP_OBJECT_ROTATION_ANGLE
VP_OBJECT_ROLL 

Only works correctly when VP_OBJECT_ROTATION_ANGLE is set to infinity.

Deprecated:
Use VP_OBJECT_ROTATION_X, VP_OBJECT_ROTATION_Y, VP_OBJECT_ROTATION_Z and VP_OBJECT_ROTATION_ANGLE
VP_OBJECT_ROTATION_ANGLE 
VP_TELEPORT_X 
VP_TELEPORT_Y 
VP_TELEPORT_Z 
VP_TELEPORT_YAW 
VP_TELEPORT_PITCH 
VP_CLICK_HIT_X 
VP_CLICK_HIT_Y 
VP_CLICK_HIT_Z 
VP_HIGHEST_FLOAT 
Enumerator:
VP_AVATAR_SESSION 
VP_AVATAR_TYPE 
VP_MY_TYPE 
VP_OBJECT_ID 
VP_OBJECT_TYPE 
VP_OBJECT_TIME 
VP_OBJECT_USER_ID 
VP_WORLD_STATE 
VP_WORLD_USERS 
VP_REFERENCE_NUMBER 
VP_CALLBACK 
VP_USER_ID 
VP_USER_REGISTRATION_TIME 
VP_USER_ONLINE_TIME 
VP_USER_LAST_LOGIN 
VP_FRIEND_ID 
VP_FRIEND_USER_ID 
VP_FRIEND_ONLINE 
VP_MY_USER_ID 
VP_PROXY_TYPE 
VP_PROXY_PORT 
VP_CELL_X 
VP_CELL_Z 
VP_TERRAIN_TILE_X 
VP_TERRAIN_TILE_Z 
VP_TERRAIN_NODE_X 
VP_TERRAIN_NODE_Z 
VP_TERRAIN_NODE_REVISION 
VP_CLICKED_SESSION 
VP_CHAT_TYPE 
VP_CHAT_COLOR_RED 
VP_CHAT_COLOR_GREEN 
VP_CHAT_COLOR_BLUE 
VP_CHAT_EFFECTS 
VP_DISCONNECT_ERROR_CODE 
VP_URL_TARGET 
VP_CURRENT_EVENT 
VP_CURRENT_CALLBACK 
VP_HIGHEST_INT 

Proxy types.

Enumerator:
VP_PROXY_TYPE_NONE 
VP_PROXY_TYPE_SOCKS4A 
Enumerator:
VP_AVATAR_NAME 
VP_CHAT_MESSAGE 
VP_OBJECT_MODEL 
VP_OBJECT_ACTION 
VP_OBJECT_DESCRIPTION 
VP_WORLD_NAME 
VP_USER_NAME 
VP_USER_EMAIL 
VP_WORLD_SETTING_KEY 
VP_WORLD_SETTING_VALUE 
VP_FRIEND_NAME 
VP_PROXY_HOST 
VP_TELEPORT_WORLD 
VP_URL 
VP_HIGHEST_STRING 

Text effect flags.

Can be combined with bitwise OR operator.

Enumerator:
VP_TEXT_EFFECT_BOLD 
VP_TEXT_EFFECT_ITALIC 
Enumerator:
VP_URL_TARGET_BROWSER 
VP_URL_TARGET_OVERLAY 

Function Documentation

VPSDK_API int vp_avatar_click ( VPInstance  instance,
int  avatar_session 
)

Send an avatar click event to other users in the world.

Uses the following attributes:

Parameters
avatar_sessionThe session id of the clicked avatar
Returns
VP_RC_SUCCESS
VP_RC_NOT_IN_WORLD
VPSDK_API int vp_callback_set ( VPInstance  instance,
vp_callback_t  callbackname,
VPCallbackHandler  callback 
)

Register a callback function.

Returns
Zero when successful, otherwise nonzero. See RC.h
VPSDK_API int vp_connect_universe ( VPInstance  instance,
const char *  host,
int  port 
)

Connect to a universe server.

Parameters
instance
hostHost address of server to connect to.
portTCP port of remote server.
Returns
Zero when successful, otherwise nonzero. See RC.h
VPSDK_API int vp_console_message ( VPInstance  instance,
int  session,
const char *  name,
const char *  message,
int  effects,
unsigned char  red,
unsigned char  green,
unsigned char  blue 
)

Send a console message.

Parameters
sessionThe session ID to send the message to. Zero to send to everyone
nameThe name to use for the chat message. Empty string to hide name.
messageChat message contents
effectsText effects (combination of #VPTextEffect flags)
redRed component of the text color(0-255)
greenGreen component of the text color(0-255)
blueBlue component of the text color(0-255)
Returns
VP_RC_SUCCESS
VP_RC_NOT_IN_WORLD
VP_RC_STRING_TOO_LONG
VPSDK_API VPInstance vp_create ( void  )

Create a new instance.

Returns
New instance or NULL on failure.
VPSDK_API const char* vp_data ( VPInstance  instance,
vp_data_attribute_t  name,
int *  length 
)
VPSDK_API int vp_data_set ( VPInstance  instance,
vp_data_attribute_t  name,
int  length,
char *  data 
)
VPSDK_API int vp_destroy ( VPInstance  instance)

Destroy a Virtual Paradise SDK instance.

VPSDK_API int vp_enter ( VPInstance  instance,
const char *  worldname 
)

Enter a world, the current world will be left.

Warning
This function uses vp_wait internally, the same warnings apply.
Returns
VP_RC_SUCCESS if successful
VP_RC_STRING_TOO_LONG
VP_RC_CONNECTION_ERROR
VP_RC_WORLD_NOT_FOUND
VP_RC_WORLD_LOGIN_ERROR
VP_RC_TIMEOUT
VP_RC_NOT_IN_UNIVERSE
VPSDK_API int vp_event_set ( VPInstance  instance,
vp_event_t  eventname,
VPEventHandler  event 
)

Register an event handler.

Returns
Zero when successful, otherwise nonzero. See RC.h
VPSDK_API float vp_float ( VPInstance  instance,
vp_float_attribute_t  name 
)
VPSDK_API int vp_float_get ( VPInstance  instance,
vp_float_attribute_t  name,
float *  value 
)
VPSDK_API int vp_float_set ( VPInstance  instance,
vp_float_attribute_t  name,
float  value 
)
VPSDK_API int vp_friend_add_by_name ( VPInstance  instance,
const char *  name 
)
VPSDK_API int vp_friend_delete ( VPInstance  instance,
int  friend_id 
)
VPSDK_API int vp_friends_get ( VPInstance  instance)
VPSDK_API int vp_init ( int  version = VPSDK_VERSION)

Initialize the Virtual Paradise SDK API.

This function should be called before calling any other VPSDK functions.

Parameters
version
Returns
VP_RC_SUCCESS if successful
VP_RC_VERSION_MISMATCH if the header version does not match the library version
VP_RC_ALREADY_INITIALIZED if the API has already been initialized
VPSDK_API int vp_int ( VPInstance  instance,
vp_int_attribute_t  name 
)
VPSDK_API int vp_int_get ( VPInstance  instance,
vp_int_attribute_t  name,
int *  value 
)
VPSDK_API int vp_int_set ( VPInstance  instance,
vp_int_attribute_t  name,
int  value 
)
VPSDK_API int vp_leave ( VPInstance  instance)

Leave the current world.

Returns
VP_RC_SUCCESS
VP_RC_NOT_IN_WORLD
VPSDK_API int vp_login ( VPInstance  instance,
const char *  username,
const char *  password,
const char *  botname 
)

Login to the universe server.

Parameters
instance
username
password
botname
Returns
VP_RC_SUCCESS
VP_RC_STRING_TOO_LONG
VP_RC_INVALID_LOGIN
VP_RC_TIMEOUT
VP_RC_NOT_IN_UNIVERSE
VPSDK_API int vp_object_add ( VPInstance  instance)
VPSDK_API int vp_object_bump_begin ( vp_instance_t  instance,
int  object_id,
int  session_to 
)

Send a object contact begin event to other users in the world.

Parameters
object_id
session_toSession ID to send a bump event to, or 0 to send to everyone
VPSDK_API int vp_object_bump_end ( vp_instance_t  instance,
int  object_id,
int  session_to 
)

Send a object contact end event to other users in the world.

Parameters
object_id
session_toSession ID to send a bump event to, or 0 to send to everyone
VPSDK_API int vp_object_change ( VPInstance  instance)
VPSDK_API int vp_object_click ( VPInstance  instance,
int  object_id,
int  session_to,
float  hit_x,
float  hit_y,
float  hit_z 
)

Sends an object click event to other users in the world.

Parameters
object_idObject ID of the clicked object
session_toTarget session, or 0 to send to everyone
hit_x,hit_y,hit_zPosition where the object was hit
Returns
VP_RC_SUCCESS
VP_RC_NOT_IN_WORLD
VPSDK_API int vp_object_delete ( VPInstance  instance,
int  object_id 
)

Delete an object.

Parameters
object_idID of the object to be deleted
VPSDK_API int vp_object_get ( VPInstance  instance,
int  object_id 
)

Request the attributes of a single object.

The result will be returned in the VP_CALLBACK_OBJECT_GET callback.

VPSDK_API int vp_query_cell ( VPInstance  instance,
int  x,
int  z 
)

Query the objects in a single cell Each object will be sent in a VP_EVENT_OBJECT event.

After all the objects for the cell have been sent, a VP_EVENT_CELL_END event will be raised.

VPSDK_API int vp_say ( VPInstance  instance,
const char *  message 
)

Send a simple message to everyone in the current world.

Parameters
messageThe message to send.
Returns
VP_RC_SUCCESS
VP_RC_NOT_IN_WORLD
VP_RC_STRING_TOO_LONG
VPSDK_API int vp_state_change ( VPInstance  instance)
VPSDK_API const char* vp_string ( VPInstance  instance,
vp_string_attribute_t  name 
)
VPSDK_API int vp_string_get ( VPInstance  instance,
vp_string_attribute_t  name,
char **  value 
)
VPSDK_API void vp_string_set ( VPInstance  instance,
vp_string_attribute_t  name,
const char *  str 
)
VPSDK_API int vp_teleport_avatar ( VPInstance  instance,
int  target_session,
const char *  world,
float  x,
float  y,
float  z,
float  yaw,
float  pitch 
)

Request that another avatar teleports to a new location.

Note
this is only a request and receiving client can choose to ignore it
Parameters
target_sessionsession ID of the avatar to teleport
worlddestination world, empty string to teleport avatar in current world
x,y,zavatar position
yaw,pitchavatar rotation
Returns
VP_RC_SUCCESS
VP_RC_NOT_IN_WORLD (this is about the bot instance, not the avatar to be teleported)
VPSDK_API int vp_terrain_node_set ( VPInstance  instance,
int  tile_x,
int  tile_z,
int  node_x,
int  node_z,
struct vp_terrain_cell_t cells 
)

Replace terrain node data.

Parameters
tile_x
tile_z
node_x
node_z
cellsPointer to 64 cells (8x8: cells[z*8+x])
Returns
VP_RC_SUCCESS
VP_RC_NOT_IN_WORLD
VPSDK_API int vp_terrain_query ( VPInstance  instance,
int  tile_x,
int  tile_z,
int  revision[][4] 
)

Query a terrain tile.

Parameters
tile_x
tile_z
revision16 node revision numbers (4x4: revision[z][x])
Returns
VP_RC_SUCCESS
VP_RC_NOT_IN_WORLD
VPSDK_API int vp_url_send ( VPInstance  instance,
int  session_id,
const char *  url,
vp_url_target_t  url_target 
)

Send a URL to a user.

Parameters
session_idtarget session id
urlthe URL to send to the target session ID
url_targetWhere to open the URL, see vp_url_target_t
VPSDK_API int vp_user_attributes_by_id ( VPInstance  instance,
int  user_id 
)

Request user attributes by user ID.

The user attributes will be returned in the VP_EVENT_USER_ATTRIBUTES event.

Returns
Zero when successful, otherwise nonzero
VPSDK_API int vp_user_attributes_by_name ( VPInstance  instance,
const char *  name 
)

Get user attributes by user name.

Not implemented.

Returns
VP_RC_NOT_IMPLEMENTED
VPSDK_API void* vp_user_data ( VPInstance  instance)

Retrieve the pointer to user-defined data for this instance.

Returns
Pointer to user-defined data.
VPSDK_API void vp_user_data_set ( VPInstance  instance,
void *  data 
)

Sets a pointer to user-defined data for this instance.

This pointer is not accessed in any way, allocating and freeing it is the responsibility of the application programmer.

Parameters
dataThe pointer to your user-defined data.
VPSDK_API int vp_wait ( VPInstance  instance,
int  milliseconds 
)

Process incoming and outgoing data.

Waits for connection to be ready for sending or receiving. This function needs to be called for events to fire.

Parameters
millisecondsThe maximum time to wait in milliseconds.
Warning
Not reentrant when used with the same instance, may not be called from event handlers unless it is for a different instance.
Returns
Zero when successful, otherwise nonzero. See RC.h
VPSDK_API int vp_world_list ( VPInstance  instance,
int  time 
)

Request the world list.

The worlds will be listed in the VP_EVENT_WORLD_LIST event. See vp_event_set().

Parameters
timeTime since your last update. This is not used yet, the whole list will be requested.