Projects >> Terasology >>0cd2b82ee1f732a1434197235dce824437e949b7

Chunk
Conflicting content
    @In
    private EntityManager entityManager;

<<<<<<< HEAD
    @Command(shortDescription = "Use an one time key to get op permission",
            helpText = "The config file contains a one time key which can be used to get op permission",
            runOnServer = true, requiredPermission = "")
    public String usePermissionKey(@CommandParam("key") String key, EntityRef client) {
        PermissionConfig permissionConfig = CoreRegistry.get(Config.class).getPermission();
        String expectedKey = permissionConfig.getOneTimeAuthorizationKey();

        if (expectedKey != null && !expectedKey.equals("") && key.equals(expectedKey)) {
            permissionConfig.setOneTimeAuthorizationKey("");
            ClientComponent clientComponent = client.getComponent(ClientComponent.class);
            permissionManager.addPermission(clientComponent.character, PermissionManager.OPERATOR_PERMISSION);
            return "Permission key used: You have now \"op\" rights";
        } else {
            return "Key invalid or used";
        }
    }

    @Command(shortDescription = "Gives specified permission to player",
=======
    @CommandDefinition(shortDescription = "Gives specified permission to player",
>>>>>>> b6d36783226c99f74428e5c54f76a7ec20e5795c
            helpText = "Gives specified permission to player",
            runOnServer = true)
    public String givePermission(
Solution content
    @In
    private EntityManager entityManager;

    @CommandDefinition(shortDescription = "Use an one time key to get op permission",
            helpText = "The config file contains a one time key which can be used to get op permission",
            runOnServer = true, requiredPermission = "")
    public String usePermissionKey(@CommandParameter("key") String key, EntityRef client) {
        PermissionConfig permissionConfig = CoreRegistry.get(Config.class).getPermission();
        String expectedKey = permissionConfig.getOneTimeAuthorizationKey();

        if (expectedKey != null && !expectedKey.equals("") && key.equals(expectedKey)) {
            permissionConfig.setOneTimeAuthorizationKey("");
            ClientComponent clientComponent = client.getComponent(ClientComponent.class);
            permissionManager.addPermission(clientComponent.character, PermissionManager.OPERATOR_PERMISSION);
            return "Permission key used: You have now \"op\" rights";
        } else {
            return "Key invalid or used";
        }
    }

    @CommandDefinition(shortDescription = "Gives specified permission to player",
            helpText = "Gives specified permission to player",
            runOnServer = true)
    public String givePermission(
File
PermissionCommands.java
Developer's decision
Manual
Kind of conflict
Annotation
Method declaration