mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-22 20:28:00 +00:00
Lowercase name -> UUID association
This commit is contained in:
parent
e316e84c2b
commit
ace0979201
@ -50,7 +50,7 @@ public class RedisBungeeConsumer implements Runnable {
|
||||
jedis.hset("player:" + event1.getPlayer().getUniqueId().toString(), "online", "0");
|
||||
jedis.hset("player:" + event1.getPlayer().getUniqueId().toString(), "ip", event1.getPlayer().getAddress().getAddress().getHostAddress());
|
||||
jedis.hset("player:" + event1.getPlayer().getUniqueId().toString(), "name", event1.getPlayer().getName());
|
||||
jedis.hset("uuids", event1.getPlayer().getName(), event1.getPlayer().getUniqueId().toString());
|
||||
jedis.hset("uuids", event1.getPlayer().getName().toLowerCase(), event1.getPlayer().getUniqueId().toString());
|
||||
} else if (event instanceof PlayerLoggedOffConsumerEvent) {
|
||||
PlayerLoggedOffConsumerEvent event1 = (PlayerLoggedOffConsumerEvent) event;
|
||||
jedis.hset("player:" + event1.getPlayer().getUniqueId().toString(), "online", String.valueOf(System.currentTimeMillis()));
|
||||
|
@ -44,7 +44,7 @@ public class UUIDTranslator {
|
||||
// Okay, it wasn't locally cached. Let's try Redis.
|
||||
Jedis jedis = plugin.getPool().getResource();
|
||||
try {
|
||||
String stored = jedis.hget("uuids", player);
|
||||
String stored = jedis.hget("uuids", player.toLowerCase());
|
||||
if (stored != null && UUID_PATTERN.matcher(stored).find()) {
|
||||
// This is it!
|
||||
uuid = UUID.fromString(stored);
|
||||
@ -108,7 +108,7 @@ public class UUIDTranslator {
|
||||
}
|
||||
|
||||
private static void storeInfo(String name, UUID uuid, Jedis jedis) {
|
||||
jedis.hset("uuids", name, uuid.toString());
|
||||
jedis.hset("uuids", name.toLowerCase(), uuid.toString());
|
||||
jedis.hset("player:" + uuid, "name", name);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user