use of de.dytanic.cloudnet.lib.player.OfflinePlayer in project CloudNet by Dytanic.
the class PlayerDatabase method updatePermissionEntity.
public PlayerDatabase updatePermissionEntity(UUID uuid, PermissionEntity permissionEntity) {
Document document = database.getDocument(uuid.toString());
OfflinePlayer offlinePlayer = document.getObject("offlinePlayer", OfflinePlayer.TYPE);
offlinePlayer.setPermissionEntity(permissionEntity);
database.insert(document);
return this;
}
use of de.dytanic.cloudnet.lib.player.OfflinePlayer in project CloudNet by Dytanic.
the class PlayerDatabase method registerPlayer.
public OfflinePlayer registerPlayer(PlayerConnection playerConnection) {
OfflinePlayer offlinePlayer = new OfflinePlayer(playerConnection.getUniqueId(), playerConnection.getName(), new Document(), System.currentTimeMillis(), System.currentTimeMillis(), playerConnection, null);
database.insert(new DatabaseDocument(playerConnection.getUniqueId().toString()).append("offlinePlayer", offlinePlayer));
return offlinePlayer;
}
use of de.dytanic.cloudnet.lib.player.OfflinePlayer in project CloudNet by Dytanic.
the class PlayerDatabase method getRegisteredPlayers.
public Map<UUID, OfflinePlayer> getRegisteredPlayers() {
database.loadDocuments();
Map<UUID, OfflinePlayer> map = new HashMap<>();
for (Document document : database.getDocs()) map.put(UUID.fromString(document.getString(Database.UNIQUE_NAME_KEY)), document.getObject("offlinePlayer", OfflinePlayer.TYPE));
return map;
}
Aggregations