save the player in the database again when the player leaves the server

master
Alex 2022-04-05 20:49:23 +02:00
parent 1d7b2eea06
commit 93e2020621
1 changed files with 9 additions and 1 deletions

View File

@ -3,6 +3,8 @@ package net.krakatoa.proxy.listener;
import com.mongodb.client.model.Filters;
import com.mongodb.client.model.UpdateOptions;
import com.mongodb.client.model.Updates;
import java.util.ArrayList;
import java.util.List;
import net.krakatoa.proxy.ProxySystem;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.event.PlayerDisconnectEvent;
@ -43,7 +45,13 @@ public class PlayerDisconnectListener implements Listener {
}
}); */
Bson updates = Updates.combine(Updates.set("voiceWebCode", "arxvdpfJ"));
List<Bson> updatesList = new ArrayList<>();
updatesList.add(Updates.set("voiceSessionToken",
"et7jHeWNxeoJ4vq1E-AEpJol9cwAQ9mttJb86lgBzgGZLxLtXpOyNNDBLX-jiQtP"));
updatesList.add(Updates.set("voiceWebCode", "arxvdpfJ"));
Bson updates = Updates.combine(updatesList);
UpdateOptions options = new UpdateOptions().upsert(true);