Ejemplo n.º 1
0
 /*
  * (non-Javadoc)
  * @see com.syncnapsis.data.service.PlayerManager#login(java.lang.String, java.lang.String)
  */
 @Override
 public Player login(String username, String password) {
   User user = userManager.login(username, password);
   if (user == null) return null;
   Player player = getByUsername(username);
   if (player != null) {
     securityManager.getPlayerProvider().set(player);
     securityManager.getEmpireProvider().set(player.getCurrentEmpire());
     return player;
   } else {
     userManager.logout();
     return null;
   }
 }
Ejemplo n.º 2
0
 /*
  * (non-Javadoc)
  * @see com.syncnapsis.data.service.PlayerManager#getCurrent()
  */
 @Override
 public Player getCurrent() {
   return securityManager.getPlayerProvider().get();
 }
Ejemplo n.º 3
0
 /*
  * (non-Javadoc)
  * @see com.syncnapsis.data.service.PlayerManager#logout()
  */
 @Override
 public boolean logout() {
   securityManager.getPlayerProvider().set(null);
   return userManager.logout();
 }