is no longer needed, it is now imported from KraCore
parent
c31641701d
commit
84ade4ac37
|
@ -1,40 +0,0 @@
|
|||
package net.krakatoa.proxy.mongo;
|
||||
|
||||
import com.mongodb.async.client.MongoClient;
|
||||
import com.mongodb.async.client.MongoClients;
|
||||
import com.mongodb.async.client.MongoCollection;
|
||||
import com.mongodb.async.client.MongoDatabase;
|
||||
import lombok.Getter;
|
||||
import org.bson.Document;
|
||||
|
||||
public class MongoManager {
|
||||
|
||||
private final String hostname;
|
||||
private final int port;
|
||||
private final String username;
|
||||
private final String password;
|
||||
|
||||
// TODO: search for replacements for deprecated methods
|
||||
@Getter
|
||||
private MongoDatabase mongoDatabase;
|
||||
@Getter
|
||||
private MongoClient mongoClient;
|
||||
@Getter
|
||||
private MongoCollection<Document> players;
|
||||
|
||||
public MongoManager(String hostname, int port, String username, String password) {
|
||||
this.hostname = hostname;
|
||||
this.port = port;
|
||||
this.username = username;
|
||||
this.password = password;
|
||||
}
|
||||
|
||||
public void connect(String database) {
|
||||
mongoClient = MongoClients.create(
|
||||
"mongodb://" + username + ":" + password + "@" + hostname + ":" + port + "/?authSource="
|
||||
+ database);
|
||||
|
||||
mongoDatabase = mongoClient.getDatabase(database);
|
||||
players = mongoDatabase.getCollection("players");
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
package net.krakatoa.proxy.redis;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class PlayerTest {
|
||||
|
||||
private String name;
|
||||
private int money;
|
||||
private String car;
|
||||
|
||||
public PlayerTest(String name, int money, String car) {
|
||||
this.name = name;
|
||||
this.money = money;
|
||||
this.car = car;
|
||||
}
|
||||
|
||||
}
|
|
@ -1,37 +0,0 @@
|
|||
package net.krakatoa.proxy.redis;
|
||||
|
||||
import lombok.Data;
|
||||
import org.redisson.Redisson;
|
||||
import org.redisson.api.RedissonClient;
|
||||
import org.redisson.config.Config;
|
||||
|
||||
@Data
|
||||
public class RedisManager {
|
||||
|
||||
private final String connectionUri;
|
||||
|
||||
private Config config;
|
||||
private RedissonClient redissonClient;
|
||||
|
||||
//private StatefulRedisConnection<String, String> connection;
|
||||
//private RedisStringCommands<String, String> commands;
|
||||
//private RedisKeyReactiveCommands<String, String> keyReactiveCommands;
|
||||
|
||||
|
||||
public void connect() {
|
||||
this.config = new Config();
|
||||
//this.config.setCodec(new MsgPackJacksonCodec());
|
||||
this.config.useSingleServer().setAddress(this.connectionUri);
|
||||
|
||||
this.redissonClient = Redisson.create(this.config);
|
||||
|
||||
//this.connection = client.connect();
|
||||
//this.commands = connection.sync();
|
||||
//this.keyReactiveCommands = this.connection.reactive();
|
||||
}
|
||||
|
||||
public void close() {
|
||||
this.redissonClient.shutdown();
|
||||
}
|
||||
}
|
||||
// RedisKeyReactiveCommands
|
|
@ -1,19 +0,0 @@
|
|||
package net.krakatoa.proxy.util;
|
||||
|
||||
import java.math.BigInteger;
|
||||
import java.util.UUID;
|
||||
|
||||
public class Formatter {
|
||||
|
||||
public String formatUuid(String uuid) {
|
||||
return uuid.replaceAll("-", "");
|
||||
}
|
||||
|
||||
public UUID stringToUuid(String s) {
|
||||
BigInteger bigInteger = new BigInteger(s.substring(0, 16), 16);
|
||||
BigInteger bigInteger1 = new BigInteger(s.substring(16, 32), 16);
|
||||
|
||||
return new UUID(bigInteger.longValue(), bigInteger1.longValue());
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue