Search in sources :

Example 1 with UserData

use of mage.players.net.UserData in project mage by magefree.

the class RandomString method connectAdmin.

public void connectAdmin() {
    this.isAdmin = true;
    User user = managerFactory.userManager().createUser("Admin", host, null).orElse(managerFactory.userManager().getUserByName("Admin").get());
    UserData adminUserData = UserData.getDefaultUserDataView();
    adminUserData.setGroupId(UserGroup.ADMIN.getGroupId());
    user.setUserData(adminUserData);
    if (!managerFactory.userManager().connectToSession(sessionId, user.getId())) {
        logger.info("Error connecting Admin!");
    } else {
        user.setUserState(User.UserState.Connected);
    }
    this.userId = user.getId();
}
Also used : UserData(mage.players.net.UserData)

Aggregations

UserData (mage.players.net.UserData)1