use of com.github.games647.fastlogin.core.message.ChannelMessage in project FastLogin by games647.
the class ForceLoginTask method onForceActionSuccess.
@Override
public void onForceActionSuccess(LoginSession session) {
// sub channel name
Type type = Type.LOGIN;
if (session.needsRegistration()) {
type = Type.REGISTER;
}
UUID proxyId = core.getPlugin().getProxyId();
ChannelMessage loginMessage = new LoginActionMessage(type, player.getUsername(), proxyId);
core.getPlugin().sendPluginMessage(server, loginMessage);
}
use of com.github.games647.fastlogin.core.message.ChannelMessage in project FastLogin by games647.
the class BungeeManager method sendPluginMessage.
public void sendPluginMessage(PluginMessageRecipient player, ChannelMessage message) {
if (player != null) {
ByteArrayDataOutput dataOutput = ByteStreams.newDataOutput();
message.writeTo(dataOutput);
NamespaceKey channel = new NamespaceKey(plugin.getName(), message.getChannelName());
player.sendPluginMessage(plugin, channel.getCombinedName(), dataOutput.toByteArray());
}
}
use of com.github.games647.fastlogin.core.message.ChannelMessage in project ChangeSkin by games647.
the class ChangeSkinBukkit method sendPluginMessage.
public void sendPluginMessage(PluginMessageRecipient sender, ChannelMessage message) {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
message.writeTo(out);
NamespaceKey channel = new NamespaceKey(getName(), message.getChannelName());
sender.sendPluginMessage(this, channel.getCombinedName(), out.toByteArray());
}
use of com.github.games647.fastlogin.core.message.ChannelMessage 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();
}
use of com.github.games647.fastlogin.core.message.ChannelMessage in project ChangeSkin by games647.
the class ChangeSkinBungee method sendPluginMessage.
public void sendPluginMessage(Server server, ChannelMessage message) {
if (server != null) {
ByteArrayDataOutput out = ByteStreams.newDataOutput();
message.writeTo(out);
NamespaceKey channel = new NamespaceKey(getName(), message.getChannelName());
server.sendData(channel.getCombinedName(), out.toByteArray());
}
}
Aggregations