Class Worlds


@RestController @RequestMapping("/vrspace/api/worlds") public class Worlds extends ClientControllerBase
World controller handles worlds-related operations.
Author:
joe
  • Field Details

  • Constructor Details

    • Worlds

      public Worlds()
  • Method Details

    • listExisting

      @GetMapping("/listExisting") public List<World> listExisting()
      List worlds currently existing on the server, i.e. all worlds in the database.
      Returns:
      list of existing worlds
    • listAvailable

      @GetMapping("/listAvailable") public List<World> listAvailable()
      List worlds available on the server, ones found in the content/worlds directory, that can be created on demand. Some temporary worlds may be existing at the moment, these have id, while non-existing ones do not.
      Returns:
      list of available worlds.
    • users

      @GetMapping("/users") public List<WorldStatus> users()
      List worlds, and number users/clients currently in them. Number of clients includes bots etc, totals include disconnected clients that are still in the world.
      Returns:
    • 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 framework
      params - 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 framework
      worldName - Name of the world to enter
      token - Optional token required to enter private world
      async - If set, the Welcome answer is sent over the websocket, and this will return null
      Returns:
      Welcome message containing only publicly accessible Client attributes