User:Roy Curtis/sample/SDK method
Jump to navigation
Jump to search
Method call snippet
vp_sdk_method(instance, intValue, stringValue, floatValue);
Makes the SDK do something either to the VP universe, world or local state.
Parameters
These are the parameters that this method requires:
Parameter | Usage |
---|---|
VPInstance instance |
Pointer to the instance this method call is intended for |
int intValue |
Integer value directly used by this method |
string stringValue |
String value directly used by this method |
float floatValue |
Float value directly used by this method |
Used attributes
This method uses data set in these attributes when called:
Attribute | Usage | |
---|---|---|
VP_INT_VALUE | Used int value sent to server | |
VP_FLOAT_VALUE | Used float value sent to server | |
VP_STRING_VALUE | Used string value sent to server | |
VP_DATA_VALUE | Used data value sent to server |
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_FAILURE |
General failure |
The following attributes will be returned in VP_CALLBACK_SDK_METHOD
if the operation was successful:
Attribute | Usage | Also returned for |
---|---|---|
VP_INT_RET_VALUE | Returned by successful method call | |
VP_FLOAT_RET_VALUE | Returned by successful method call | |
VP_STRING_RET_VALUE | Returned by successful method call |
Behavior
- This is the behavior of this SDK method (e.g. when and why it should be used)
Caveats
- This is a common pitfall, missing expected functionality or otherwise something to look out for when calling this method
Examples
- This is where a minimal example would go for using this method
See also
- Related SDK methods
- Related SDK stuff