Skip to content

Commit

Permalink
Update syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
jacobwgillespie committed Dec 13, 2015
1 parent 4930865 commit 227c00f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class DiscourseGroupSync : JavaPlugin(), Listener {
}

fun setupPermissions(): Boolean {
val rsp: RegisteredServiceProvider<Permission> = getServer().getServicesManager().getRegistration(Permission::class.java)
val rsp: RegisteredServiceProvider<Permission> = server.servicesManager.getRegistration(Permission::class.java)
permissions = rsp.provider
return permissions != null
}
Expand Down
10 changes: 5 additions & 5 deletions src/main/kotlin/gg/obsidian/discoursegroupsync/UserManger.kt
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ class UserManager(val plugin: DiscourseGroupSync) {

val bodyString = response.body().string()
val body = JSONValue.parse(bodyString) as JSONObject
val user = body["user"] as JSONObject
val customGroups = user["custom_groups"] as JSONArray
val user = body.getRaw("user") as JSONObject
val customGroups = user.getRaw("custom_groups") as JSONArray

val discourseGroups = HashSet<Int>()

for (g in customGroups) {
val group = g as JSONObject
val id = group.get("id") as Long
val id = group.getRaw("id") as Long
discourseGroups.add(id.toInt())
}

Expand Down Expand Up @@ -82,12 +82,12 @@ class UserManager(val plugin: DiscourseGroupSync) {
}

for (group in groupsToAdd) {
plugin.logger.info("Adding " + username + " to group " + group)
plugin.logger.info("Adding $username to group $group")
plugin.permissions?.playerAddGroup(player, group)
}

for (group in groupsToRemove) {
plugin.logger.info("Removing " + username + " from group " + group)
plugin.logger.info("Removing $username from group $group")
plugin.permissions?.playerRemoveGroup(player, group)
}
}
Expand Down

0 comments on commit 227c00f

Please sign in to comment.