code: protected ApiUser createUserAgent(User sfsUser) {
          ApiUser answer = UserAgentFactory.newUserAgent(
                  sfsUser.getName(),
                  context.getUserAgentClass(), 
                  context.getGameUserAgentClasses());
          sfsUser.setProperty(APIKey.USER, answer);
          answer.setId(sfsUser.getId());
          answer.setIp(sfsUser.getIpAddress());
          answer.setSession(new ApiSessionImpl(sfsUser.getSession()));
          answer.setCommand(context.command(UserInfo.class).user(sfsUser.getId()));
          return answer;
      }
docs: Create user agent object
  
  @param sfsUser smartfox user object
  @return user agent object