VP CALLBACK LOGIN: Difference between revisions

From Virtual Paradise Wiki
Jump to navigation Jump to search
(Starting to work on callback page)
 
m (Changed naming)
Line 1: Line 1:
{{sdk callback page|login|Sent to the client from a call to {{sdk method|login}}.
{{sdk callback page|login|Sent to the client from a call to {{sdk method|login}}.
|returncodes=
|reasoncodes=
   {{sdk return code row|string_too_long |If any of the given string parameters exceed 255 bytes in length (when using UTF-8 encoded characters they can each be multiple bytes long)}}
   {{sdk return code row|string_too_long |If any of the given string parameters exceed 255 bytes in length (when using UTF-8 encoded characters they can each be multiple bytes long)}}
   {{sdk return code row|invalid_login  |The login credentials are incorrect}}
   {{sdk return code row|invalid_login  |The login credentials are incorrect}}

Revision as of 20:58, 30 July 2018

Callback set and handler snippet

vp_callback_set(instance, VP_CALLBACK_LOGIN, callback_login);

void callback_login(VPInstance instance, int reason_code, int reference) { }

Sent to the client in response to vp_login()

Reason code

This callback is passed a return code integer, which indicates whether the request was successful (0) or errored for any of these reasons:

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_STRING_TOO_LONG If any of the given string parameters exceed 255 bytes in length (when using UTF-8 encoded characters they can each be multiple bytes long)
VP_RC_INVALID_LOGIN The login credentials are incorrect
VP_RC_TIMEOUT Timeout
VP_RC_NOT_IN_UNIVERSE Bot is not currently connected to universe

Return attributes

Attribute Usage
VP_MY_USER_ID User id of account used to log in

Behavior

There is no special behavior for this callback

Examples

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

See also