mirror of
https://github.com/proxiodev/RedisBungee.git
synced 2024-11-23 04:28:01 +00:00
Merge pull request #33 from ItsHarry/master
Fix getNameFromUUID returning names in lowercase
This commit is contained in:
commit
0d98dac6ef
@ -81,7 +81,7 @@ public class RedisBungeeListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Pipeline pipeline = jedis.pipelined();
|
Pipeline pipeline = jedis.pipelined();
|
||||||
plugin.getUuidTranslator().persistInfo(event.getConnection().getName().toLowerCase(), event.getConnection().getUniqueId(), pipeline);
|
plugin.getUuidTranslator().persistInfo(event.getConnection().getName(), event.getConnection().getUniqueId(), pipeline);
|
||||||
RedisUtil.createPlayer(event.getConnection(), pipeline, false);
|
RedisUtil.createPlayer(event.getConnection(), pipeline, false);
|
||||||
// We're not publishing, the API says we only publish at PostLoginEvent time.
|
// We're not publishing, the API says we only publish at PostLoginEvent time.
|
||||||
pipeline.sync();
|
pipeline.sync();
|
||||||
|
@ -101,7 +101,7 @@ public final class UUIDTranslator {
|
|||||||
}
|
}
|
||||||
for (Map.Entry<String, UUID> entry : uuidMap1.entrySet()) {
|
for (Map.Entry<String, UUID> entry : uuidMap1.entrySet()) {
|
||||||
if (entry.getKey().equalsIgnoreCase(player)) {
|
if (entry.getKey().equalsIgnoreCase(player)) {
|
||||||
persistInfo(entry.getKey().toLowerCase(), entry.getValue(), jedis);
|
persistInfo(entry.getKey(), entry.getValue(), jedis);
|
||||||
return entry.getValue();
|
return entry.getValue();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -161,7 +161,7 @@ public final class UUIDTranslator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (name != null) {
|
if (name != null) {
|
||||||
persistInfo(name.toLowerCase(), player, jedis);
|
persistInfo(name, player, jedis);
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,13 +175,13 @@ public final class UUIDTranslator {
|
|||||||
public final void persistInfo(String name, UUID uuid, Jedis jedis) {
|
public final void persistInfo(String name, UUID uuid, Jedis jedis) {
|
||||||
addToMaps(name, uuid);
|
addToMaps(name, uuid);
|
||||||
String json = RedisBungee.getGson().toJson(uuidToNameMap.get(uuid));
|
String json = RedisBungee.getGson().toJson(uuidToNameMap.get(uuid));
|
||||||
jedis.hmset("uuid-cache", ImmutableMap.of(name, json, uuid.toString(), json));
|
jedis.hmset("uuid-cache", ImmutableMap.of(name.toLowerCase(), json, uuid.toString(), json));
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void persistInfo(String name, UUID uuid, Pipeline jedis) {
|
public final void persistInfo(String name, UUID uuid, Pipeline jedis) {
|
||||||
addToMaps(name, uuid);
|
addToMaps(name, uuid);
|
||||||
String json = RedisBungee.getGson().toJson(uuidToNameMap.get(uuid));
|
String json = RedisBungee.getGson().toJson(uuidToNameMap.get(uuid));
|
||||||
jedis.hmset("uuid-cache", ImmutableMap.of(name, json, uuid.toString(), json));
|
jedis.hmset("uuid-cache", ImmutableMap.of(name.toLowerCase(), json, uuid.toString(), json));
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
Loading…
Reference in New Issue
Block a user