use of com.github.games647.changeskin.core.message.CheckPermMessage in project ChangeSkin by games647.
the class SharedBungeeListener method checkPermissions.
private void checkPermissions(P player, ByteArrayDataInput dataInput) {
CheckPermMessage message = new CheckPermMessage();
message.readFrom(dataInput);
UUID receiverUUID = message.getReceiverUUD();
boolean op = message.isOp();
SkinModel targetSkin = message.getTargetSkin();
UUID skinProfile = targetSkin.getProfileId();
boolean success = op || checkBungeePerms(player, receiverUUID, message.isSkinPerm(), skinProfile);
sendMessage(player, new PermResultMessage(success, targetSkin, receiverUUID));
}
use of com.github.games647.changeskin.core.message.CheckPermMessage in project ChangeSkin by games647.
the class SkinApplier method run.
@Override
public void run() {
if (!isConnected()) {
return;
}
UUID receiverUUID = receiver.getUniqueId();
if (invoker instanceof ProxiedPlayer) {
if (targetSkin != null && core.getConfig().getBoolean("bukkit-permissions")) {
Server server = ((ProxiedPlayer) invoker).getServer();
boolean skinPerm = core.getConfig().getBoolean("skinPermission");
ChannelMessage message = new CheckPermMessage(targetSkin, receiverUUID, skinPerm, bukkitOp);
plugin.sendPluginMessage(server, message);
return;
}
// uuid was successful resolved, we could now make a cooldown check
core.getCooldownService().trackPlayer(((ProxiedPlayer) invoker).getUniqueId());
}
// check if that specific player is online
UserPreference preferences = plugin.getLoginSession(receiver.getPendingConnection());
if (preferences == null) {
preferences = plugin.getStorage().getPreferences(receiverUUID);
}
save(preferences);
applySkin();
}
Aggregations