Skip to content

Cubeside/PlayerUUIDCacheBungee

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PlayerUUIDCacheBungee

PlayerUUIDCacheBungee provides a read-only BungeeCord API for resolving player names to UUIDs and UUIDs to player names. It is intended to use the MySQL tables written by the Bukkit/Paper PlayerUUIDCache plugin.

The plugin never queries Mojang, never writes to the database and does not expose profile/property APIs.

Usage

Add this plugin to the BungeeCord proxy and configure it to point at the same MySQL database as PlayerUUIDCache.

For another BungeeCord plugin, add a dependency in bungee.yml:

depends:
  - PlayerUUIDCacheBungee

Load the API from BungeeCord's plugin manager:

Plugin plugin = ProxyServer.getInstance()
        .getPluginManager()
        .getPlugin("PlayerUUIDCacheBungee");

PlayerUUIDCacheBungeeAPI uuidCache = plugin instanceof PlayerUUIDCacheBungeeAPI api ? api : null;

CachedPlayer player = uuidCache.getPlayerFromNameOrUUID("Notch");

Alternatively, use PlayerUUIDCacheBungee.getAPI() after the plugin has been enabled.

Synchronous API calls may perform MySQL queries. Use the async methods from proxy event handlers or latency-sensitive code:

uuidCache.getPlayerAsync("Notch").thenAccept(player -> {
    if (player != null) {
        UUID uuid = player.getUUID();
    }
});

Database

The main table must match the schema used by PlayerUUIDCache:

CREATE TABLE playeruuids (
  uuid CHAR(36) NOT NULL,
  name VARCHAR(100) NOT NULL,
  lastSeen BIGINT NOT NULL DEFAULT 0,
  PRIMARY KEY (uuid),
  INDEX (name)
);

Historical name lookups use the optional namehistories and namechanges tables. If either table is missing, getCurrentAndPreviousPlayers only returns current mappings from playeruuids.

Commands

/uuidcachebungee stats shows lookup and database counters. /uuidcachebungee lookup <name|uuid> reads one mapping. /uuidcachebungee loadAll loads all rows into the memory cache. /uuidcachebungee reload reloads the configuration.

All commands require playeruuidcachebungee.admin.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages