use of com.github.games647.fastlogin.core.message.LoginActionMessage.Type in project ChangeSkin by games647.
the class CheckPermissionListener method handlePayload.
@Override
public void handlePayload(ChannelBuf data, RemoteConnection connection, Type side) {
ByteArrayDataInput dataInput = ByteStreams.newDataInput(data.array());
CheckPermMessage checkMessage = new CheckPermMessage();
checkMessage.readFrom(dataInput);
CheckPermMessage message = new CheckPermMessage();
message.readFrom(dataInput);
checkPermissions((Player) connection, message);
}
use of com.github.games647.fastlogin.core.message.LoginActionMessage.Type 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.LoginActionMessage.Type in project FastLogin by games647.
the class BungeeListener method readMessage.
private void readMessage(Player player, LoginActionMessage message) {
String playerName = message.getPlayerName();
Type type = message.getType();
InetSocketAddress address = player.getAddress();
plugin.getLog().info("Player info {} command for {} from proxy", type, playerName);
if (type == Type.LOGIN) {
onLoginMessage(player, playerName, address);
} else if (type == Type.REGISTER) {
onRegisterMessage(player, playerName, address);
} else if (type == Type.CRACKED) {
// we don't start a force login task here so update it manually
plugin.getPremiumPlayers().put(player.getUniqueId(), PremiumStatus.CRACKED);
}
}
use of com.github.games647.fastlogin.core.message.LoginActionMessage.Type in project ChangeSkin by games647.
the class UpdateSkinListener method handlePayload.
@Override
public void handlePayload(ChannelBuf data, RemoteConnection connection, Type side) {
ByteArrayDataInput dataInput = ByteStreams.newDataInput(data.array());
SkinUpdateMessage updateMessage = new SkinUpdateMessage();
updateMessage.readFrom(dataInput);
String playerName = updateMessage.getPlayerName();
Optional<Player> receiver = Sponge.getServer().getPlayer(playerName);
if (receiver.isPresent()) {
Runnable skinUpdater = new SkinApplier(plugin, (CommandSource) connection, receiver.get(), null, false);
Task.builder().execute(skinUpdater).submit(plugin);
}
}
use of com.github.games647.fastlogin.core.message.LoginActionMessage.Type 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 = UUID.fromString(ProxyServer.getInstance().getConfig().getUuid());
ChannelMessage loginMessage = new LoginActionMessage(type, player.getName(), proxyId);
core.getPlugin().sendPluginMessage(server, loginMessage);
}
Aggregations