Vp join: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
m Added reference number attribute |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
|parameters= | |parameters= | ||
{{sdk parameter row|int|user_id|User id}} | {{sdk parameter row|int|user_id|User id}} | ||
|attributes= | |||
{{sdk attribute row|int|reference_number|Is passed to the callback to identify for which method call it is fired}} | |||
|returncodes= | |returncodes= | ||
{{sdk return code row|NOT_IN_UNIVERSE|Bot is not currently in the universe}} | {{sdk return code row|NOT_IN_UNIVERSE|Bot is not currently in the universe}} | ||
{{sdk return code row|JOIN_DECLINED|Join request was declined}} | {{sdk return code row|JOIN_DECLINED|Join request was declined}} | ||
{{sdk return code row| | {{sdk return code row|TIMEOUT|Join request timeout (no accept/decline within 30 seconds)}} | ||
|returnattributes= | |returnattributes= | ||
{{sdk attribute row|int |JOIN_ID |Join id}} | {{sdk attribute row|int |JOIN_ID |Join id |{{code|VP_RC_JOIN_DECLINED}}}} | ||
{{sdk attribute row|int |USER_ID |User id}} | {{sdk attribute row|int |USER_ID |User id |{{code|VP_RC_JOIN_DECLINED}}}} | ||
{{sdk attribute row|string |JOIN_NAME |Name of user}} | {{sdk attribute row|string |JOIN_NAME |Name of user |{{code|VP_RC_JOIN_DECLINED}} and {{code|VP_RC_TIMEOUT}}}} | ||
{{sdk attribute row|float |JOIN_X |User x coordinate}} | {{sdk attribute row|float |JOIN_X |User x coordinate |}} | ||
{{sdk attribute row|float |JOIN_Y |User y coordinate}} | {{sdk attribute row|float |JOIN_Y |User y coordinate |}} | ||
{{sdk attribute row|float |JOIN_Z |User z coordinate}} | {{sdk attribute row|float |JOIN_Z |User z coordinate |}} | ||
{{sdk attribute row|float |JOIN_YAW |User yaw angle}} | {{sdk attribute row|float |JOIN_YAW |User yaw angle |}} | ||
{{sdk attribute row|float |JOIN_PITCH |User pitch angle}} | {{sdk attribute row|float |JOIN_PITCH |User pitch angle |}} | ||
{{sdk attribute row|string |JOIN_WORLD |World that user is in}} | {{sdk attribute row|string |JOIN_WORLD |World that user is in |}} | ||
|behavior= | |behavior= | ||
* Upon sending a request, {{sdk event|JOIN}} is triggered for the user. See {{sdk method|event_set}}. | * Upon sending a request, {{sdk event|JOIN}} is triggered for the user. See {{sdk method|event_set}}. |
Latest revision as of 23:31, 31 July 2018
Method call snippet
vp_join(instance, user_id);
Send a join request to a user.
Parameters
These are the parameters that this method requires:
Parameter | Usage |
---|---|
VPInstance instance |
Pointer to the instance this method call is intended for |
int user_id |
User id |
Used attributes
This method uses data set in these attributes when called:
Attribute | Usage | |
---|---|---|
VP_REFERENCE_NUMBER | Is passed to the callback to identify for which method call it is fired |
Returns
This method returns a return code integer, which indicates whether the call was successful or errored for any reason:
Return code | Cause |
---|---|
VP_RC_SUCCESS |
Successful call (for methods that have a registered callback, it only means the request has been sent) |
VP_RC_NOT_IN_UNIVERSE |
Bot is not currently in the universe |
VP_RC_JOIN_DECLINED |
Join request was declined |
VP_RC_TIMEOUT |
Join request timeout (no accept/decline within 30 seconds) |
The following attributes will be returned in VP_CALLBACK_JOIN
if the operation was successful:
Attribute | Usage | Also returned for |
---|---|---|
VP_JOIN_ID | Join id | VP_RC_JOIN_DECLINED
|
VP_USER_ID | User id | VP_RC_JOIN_DECLINED
|
VP_JOIN_NAME | Name of user | VP_RC_JOIN_DECLINED and VP_RC_TIMEOUT
|
VP_JOIN_X | User x coordinate | |
VP_JOIN_Y | User y coordinate | |
VP_JOIN_Z | User z coordinate | |
VP_JOIN_YAW | User yaw angle | |
VP_JOIN_PITCH | User pitch angle | |
VP_JOIN_WORLD | World that user is in |
Behavior
- Upon sending a request,
VP_EVENT_JOIN
is triggered for the user. Seevp_event_set()
.
Examples
...