Search in sources :

Example 1 with DatabaseDocument

use of de.dytanic.cloudnet.lib.database.DatabaseDocument in project CloudNet by Dytanic.

the class WrapperSessionDatabase method addSession.

public void addSession(WrapperSession session) {
    DatabaseDocument databaseDocument = new DatabaseDocument(session.getUniqueId().toString());
    databaseDocument.append("session", session);
    databaseDocument.insert(database);
}
Also used : DatabaseDocument(de.dytanic.cloudnet.lib.database.DatabaseDocument)

Example 2 with DatabaseDocument

use of de.dytanic.cloudnet.lib.database.DatabaseDocument 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;
}
Also used : DatabaseDocument(de.dytanic.cloudnet.lib.database.DatabaseDocument) OfflinePlayer(de.dytanic.cloudnet.lib.player.OfflinePlayer) Document(de.dytanic.cloudnet.lib.utility.document.Document) DatabaseDocument(de.dytanic.cloudnet.lib.database.DatabaseDocument)

Aggregations

DatabaseDocument (de.dytanic.cloudnet.lib.database.DatabaseDocument)2 OfflinePlayer (de.dytanic.cloudnet.lib.player.OfflinePlayer)1 Document (de.dytanic.cloudnet.lib.utility.document.Document)1