VP EVENT TELEPORT: Difference between revisions
Jump to navigation
Jump to search
Roy Curtis (talk | contribs) m subst example |
Roy Curtis (talk | contribs) m oops |
||
Line 13: | Line 13: | ||
* The teleport is not enforced by the server; the client may ignore the event | * The teleport is not enforced by the server; the client may ignore the event | ||
|examples= | |examples= | ||
:''This is a minimal program example which contains no error checking'' | |||
<c> | |||
#include <vpsdk/VP.h> | |||
#include <stdio.h> | |||
#include <stdlib.h> | |||
#define Username "User" | |||
#define Password "1234" | |||
#define World "VP-Build" | |||
int main(int argc, char ** argv) | |||
{ | |||
vp_init(VPSDK_VERSION); | |||
VPInstance sdk = vp_create(); | |||
vp_connect_universe(sdk, "universe.virtualparadise.org", 57000); | |||
vp_login(sdk, Username, Password, "VPBot"); | |||
vp_enter(sdk, World); | |||
vp_state_change(sdk); | |||
while(vp_wait(sdk, 1000) == 0){} | |||
return 0; | |||
} | |||
</c> | |||
|seealso= | |seealso= | ||
}} | }} |
Revision as of 04:09, 25 August 2013
Event set and handler snippet
vp_event_set(instance, VP_EVENT_TELEPORT, event_teleport);
void event_teleport(VPInstance instance) { }
A request for the receiving client to teleport to a location, sent to the client from a vp_teleport()
call.
Attributes
Attribute | Usage | |
---|---|---|
VP_AVATAR_SESSION | Source session ID of the teleport request | |
VP_TELEPORT_X | Destination X coordinate | |
VP_TELEPORT_Y | Destination Y coordinate | |
VP_TELEPORT_Z | Destination Z coordinate | |
VP_TELEPORT_PITCH | Destination pitch rotation | |
VP_TELEPORT_YAW | Destination yaw rotation | |
VP_TELEPORT_WORLD | Destination world |
Behavior
- If VP_TELEPORT_WORLD is a blank string, it should be assumed that the client use its current world
- This event is only broadcasted to the target session; no other sessions will see it
- The teleport is not enforced by the server; the client may ignore the event
Examples
- This is a minimal program example which contains no error checking
<c>
- include <vpsdk/VP.h>
- include <stdio.h>
- include <stdlib.h>
- define Username "User"
- define Password "1234"
- define World "VP-Build"
int main(int argc, char ** argv) {
vp_init(VPSDK_VERSION);
VPInstance sdk = vp_create();
vp_connect_universe(sdk, "universe.virtualparadise.org", 57000); vp_login(sdk, Username, Password, "VPBot"); vp_enter(sdk, World); vp_state_change(sdk); while(vp_wait(sdk, 1000) == 0){} return 0;
} </c>