VP CALLBACK LOGIN: Difference between revisions

From Virtual Paradise Wiki
Jump to navigation Jump to search
Sleepy E (talk | contribs)
m Changed template
Sleepy E (talk | contribs)
m Removed reason codes that aren't passed to callback
 
Line 3: Line 3:
   {{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}}
  {{sdk return code row|timeout        |Timeout}}
  {{sdk return code row|not_in_universe |Bot is not currently connected to universe}}
|returnattributes=
|returnattributes=
   {{sdk attribute row|int|my_user_id|User id of account used to log in}}
   {{sdk attribute row|int|my_user_id|User id of account used to log in}}

Latest revision as of 21:17, 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

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