Class WorldManager


  • @Component("world")
    public class WorldManager
    extends Object
    Main component that manages all interactions with virtual worlds.
    Author:
    joe
    • Constructor Detail

      • WorldManager

        public WorldManager()
    • Method Detail

      • init

        @PostConstruct
        public void init()
      • listClasses

        public List<Class<?>> listClasses()
      • getOrCreateWorld

        public World getOrCreateWorld​(String name)
      • getClientByName

        public Client getClientByName​(String name)
      • getClientByName

        public <T extends Client> T getClientByName​(String name,
                                                    Class<T> cls)
      • save

        public <T extends VRObject> T save​(T obj)
      • add

        public List<VRObject> add​(Client client,
                                  List<VRObject> objects)
        Add objects to client's current position
        Parameters:
        client - client adding objects
        objects - objects to add
        Returns:
        list of added objects
      • login

        @Transactional
        public Welcome login​(org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator session)
        Remote user login over websocket. Called SessionManager, after websocket session has been established. Uses session security context (principal) to identify user and fetch/create the appropriate Client object from the ClientFactory. May create a new guest client, if guest (anonymous) connections are allowed.
        Parameters:
        session - websocket session
        Returns:
        Welcome message
      • login

        public void login​(Client client)
        Stage 2 of login, executed once client has been identified. Does not depend on websocket session, can be used for internal login, e.g. bots.
        Parameters:
        client -
      • defaultWorld

        public World defaultWorld()
      • logout

        @Transactional
        public void logout​(Client client)