Class World

java.lang.Object
org.vrspace.server.obj.Entity
org.vrspace.server.obj.World
Direct Known Subclasses:
ServerWorld

@Node public class World extends Entity
VRObject container, contains isolated parts of space, like chat room. One default world is created on startup, others are typically created on demand, after Enter command is issued.
Author:
joe
  • Constructor Details

    • World

      public World(String name, boolean defaultWorld)
    • World

      public World()
    • World

      public World(@NonNull @NonNull String name)
      Creates a new World instance.
      Parameters:
      name - Unique world name
  • Method Details

    • enter

      public boolean enter(Client c, WorldManager wm)
      Called when client enters the world. It may change some client properties, allow entrance or not, etc. This implementation checks whether the world is private and owned, and compares the session token.
      Parameters:
      c - Client that's asking to enter
      wm - WorldManager
      Returns:
      true if client is allowed to enter
    • exit

      public void exit(Client c, WorldManager wm)
      Called after client exits the world. After the owner (if any) exits the world, invalidates the token (if any).
      Parameters:
      c - Client exiting the world
      wm - WorldManager
    • tokenName

      public String tokenName()
    • getName

      @NonNull public @NonNull String getName()
      Unique world name
    • getDescription

      public String getDescription()
      Optional description of the world
    • getThumbnail

      public String getThumbnail()
      Optional URL of world image displayed on the portal
    • isDefaultWorld

      public boolean isDefaultWorld()
      There can be only one *
    • isPublicWorld

      public boolean isPublicWorld()
      Can all users enter the world
    • isTemporaryWorld

      public boolean isTemporaryWorld()
      Temporary worlds are created on demand
    • getToken

      public String getToken()
    • getOwner

      public Client getOwner()
    • setName

      public void setName(@NonNull @NonNull String name)
      Unique world name
    • setDescription

      public void setDescription(String description)
      Optional description of the world
    • setThumbnail

      public void setThumbnail(String thumbnail)
      Optional URL of world image displayed on the portal
    • setDefaultWorld

      public void setDefaultWorld(boolean defaultWorld)
      There can be only one *
    • setPublicWorld

      public void setPublicWorld(boolean publicWorld)
      Can all users enter the world
    • setTemporaryWorld

      public void setTemporaryWorld(boolean temporaryWorld)
      Temporary worlds are created on demand
    • setToken

      public void setToken(String token)
    • setOwner

      public void setOwner(Client owner)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Entity
    • canEqual

      protected boolean canEqual(Object other)
      Overrides:
      canEqual in class Entity
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Entity
    • toString

      public String toString()
      Overrides:
      toString in class Entity