SetUserPositionRequest Class |
Namespace: Sfs2X.Requests.MMO
public class SetUserPositionRequest : BaseRequest
Name | Description | |
---|---|---|
SetUserPositionRequest(Vec3D) |
See SetUserPositionRequest(Vec3D, Room) constructor.
| |
SetUserPositionRequest(Vec3D, Room) |
Creates a new SetUserPositionRequest instance.
|
private void UpdatePlayerPosition(int px, int py) { var newPos = new Vec3D(px, py); sfs.Send(new SetUserPositionRequest(newPos)); } private void OnProximityListUpdate(BaseEvent evt) { var added = (List<User>) evt.params["addedUsers"]; var removed = (List<User>) evt.params["removedUsers"]; // Add users that entered the proximity list foreach (User user in added) { // Obtain the coordinates at which the user "appeared" in our range Vec3D entryPoint = user.AoiEntryPoint; // Add new avatar in the scene var avatarSprite = new AvatarSprite(); avatarSprite.x = entryPoint.px; avatarSprite.y = entryPoint.py; ... } // Remove users that left the proximity list foreach (User user in removed) { // Remove the avatar from the scene ... } }