Vp destroy: Difference between revisions

From Virtual Paradise Wiki
Jump to navigation Jump to search
m (Added caveats)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
<C>int vp_destroy(VPInstance instance)</C>
{{sdk method page|destroy|Destroys an existing SDK instance.
 
|behavior=If the destroyed instance was connected to a [[world]] and/or a [[universe]], it will be disconnected from both. This is the only way to disconnect a bot from a universe.
== Description ==
|caveats=
Destroys new VP SDK instance.
  This method will '''always''' return {{code|VP_RC_SUCCESS}} even when passed a NULL pointer. However, passing an invalid instance pointer will crash the bot due to a memory access violation.
 
|seealso=
== Callback ==
* {{sdk method|create}}
None
}}
 
== Notes ==
None
 
== Arguments ==
;instance:The SDK instance to destroy.
 
== Argument attributes ==
None
 
== Return values ==
;[[SDK_Reason_Codes#VP_RC_SUCCESS|VP_RC_SUCCESS]]
;[[SDK_Reason_Codes#VP_NO_INSTANCE|VP_NO_INSTANCE]]:Invalid instance passed.
 
== Returned attributes ==
None
 
== Example ==
<C>// ...
int rc;
if(rc = vp_destroy(instance))
    printf("Error destroying VP API (reason %d)\n", rc);</C>
 
== See also ==
* [[vp_connect_universe]]
* [[vp_create]]
* [[vp_wait]]
 
[[Category: SDK]]

Latest revision as of 19:32, 1 August 2018

Method call snippet vp_destroy(instance);

Destroys an existing SDK instance.

Parameters

These are the parameters that this method requires:

Parameter Usage
VPInstance
instance
Pointer to the instance this method call is intended for

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)

Behavior

If the destroyed instance was connected to a world and/or a universe, it will be disconnected from both. This is the only way to disconnect a bot from a universe.

Caveats

This method will always return VP_RC_SUCCESS even when passed a NULL pointer. However, passing an invalid instance pointer will crash the bot due to a memory access violation.

Examples

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

See also