Skip to content

Commit

Permalink
АААААААААААААААААААА
Browse files Browse the repository at this point in the history
  • Loading branch information
Даркнесс committed Feb 22, 2023
1 parent 7ae0716 commit 94b87f2
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions src/main/java/darkdustry/components/Database.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import arc.func.Cons;
import arc.func.Cons2;
import arc.util.Log;
import com.mongodb.MongoClientSettings;
import com.mongodb.client.model.ReplaceOptions;
import com.mongodb.client.result.UpdateResult;
Expand Down Expand Up @@ -37,16 +36,6 @@ public static void connect() {

playersCollection = database.getCollection("players", PlayerData.class);

var format = client.getDatabase("darkdustry");
var collection = format.getCollection("players");

Flux.from(collection.find()).doOnNext(document -> {
document.put("effects", "none");
Log.info("Processed document @ (@)", document.getString("uuid"), document.getString("name"));

Mono.from(collection.replaceOne(eq("uuid", document.getString("uuid")), document, new ReplaceOptions().upsert(true))).subscribe();
}).subscribe();

DarkdustryPlugin.info("Database connected.");
} catch (Exception e) {
DarkdustryPlugin.error("Failed to connect to the database: @", e);
Expand Down

0 comments on commit 94b87f2

Please sign in to comment.