Package org.vrspace.server.api
Class Worlds
java.lang.Object
org.vrspace.server.api.ApiBase
org.vrspace.server.api.ClientControllerBase
org.vrspace.server.api.Worlds
@RestController
@RequestMapping("/vrspace/api/worlds")
public class Worlds
extends ClientControllerBase
World controller handles worlds-related operations. Currently only list and
count users, publicly available. Eventually it should allow world creation
and management for authorised users.
- Author:
- joe
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.springframework.http.ResponseEntity<String>
createWorld
(jakarta.servlet.http.HttpSession session, Worlds.CreateWorldOptions params) Create a private world, the user must be authenticated.enterWorld
(jakarta.servlet.http.HttpSession session, String worldName, Optional<String> token, Optional<Boolean> async) Enter a world, the client must be authenticated.list()
users()
Methods inherited from class org.vrspace.server.api.ClientControllerBase
findClient, findClient, getAuthorisedClient, getAuthorisedClient, isAuthenticated
Methods inherited from class org.vrspace.server.api.ApiBase
currentUserName, isAuthenticated
-
Field Details
-
PATH
- See Also:
-
-
Constructor Details
-
Worlds
public Worlds()
-
-
Method Details
-
list
-
users
-
createWorld
@PostMapping("/create") public org.springframework.http.ResponseEntity<String> createWorld(jakarta.servlet.http.HttpSession session, @RequestBody(required=true) Worlds.CreateWorldOptions params) Create a private world, the user must be authenticated. If the world already exists, owner may change isPublic or isTemporary parameters. Returns HTTP 201 CREATED for created world, or HTTP 200 OK if world already exists.- Parameters:
session
- automatically passed by frameworkparams
- world options- Returns:
- token required to enter the world, only for private worlds
-
enterWorld
@PostMapping("/enter") public String enterWorld(jakarta.servlet.http.HttpSession session, String worldName, Optional<String> token, Optional<Boolean> async) Enter a world, the client must be authenticated. REST equivalent of Enter command. This is only valid after the websocket connection has been established.- Parameters:
session
- automatically passed by frameworkworldName
- Name of the world to entertoken
- Optional token required to enter private worldasync
- If set, the Welcome answer is sent over the websocket, and this will return null- Returns:
- Welcome message containing only publicly accessible Client attributes
-