Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: incorrect imports #22

Merged
merged 1 commit into from
Nov 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import com.velocitypowered.api.event.connection.PostLoginEvent;
import com.velocitypowered.api.event.connection.PreLoginEvent;
import com.velocitypowered.api.proxy.Player;
import io.v4guard.plugin.bungee.v4GuardBungee;
import io.v4guard.plugin.core.check.CheckProcessor;
import io.v4guard.plugin.core.check.common.CheckStatus;
import io.v4guard.plugin.core.check.common.VPNCheck;
Expand Down Expand Up @@ -98,7 +97,7 @@ public void complete(boolean nameIsValid) {
if(nameIsValid){


Document privacySettings = (Document) v4GuardBungee.getCoreInstance().getBackendConnector().getSettings().getOrDefault("privacy", new Document());
Document privacySettings = (Document) v4GuardVelocity.getCoreInstance().getBackendConnector().getSettings().getOrDefault("privacy", new Document());
boolean anonVirtualHost = privacySettings.getBoolean("anonVirtualHost", true);

String virtualHost = "notFound";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import com.velocitypowered.api.proxy.Player;
import com.velocitypowered.api.proxy.messages.LegacyChannelIdentifier;
import com.velocitypowered.api.proxy.messages.MinecraftChannelIdentifier;
import io.v4guard.plugin.bungee.v4GuardBungee;
import io.v4guard.plugin.core.accounts.auth.AuthType;
import io.v4guard.plugin.core.accounts.auth.Authentication;
import io.v4guard.plugin.core.accounts.messaging.MessageReceiver;
Expand All @@ -29,7 +28,7 @@ public VelocityMessageReceiver(v4GuardVelocity plugin) {

@Subscribe(order = PostOrder.FIRST)
public void onMessage(PluginMessageEvent e){
boolean invalidatedCache = (boolean) v4GuardBungee.getCoreInstance().getBackendConnector().getSettings().getOrDefault("invalidateCache", false);
boolean invalidatedCache = (boolean) v4GuardVelocity.getCoreInstance().getBackendConnector().getSettings().getOrDefault("invalidateCache", false);
if(invalidatedCache) return;
if (!e.getIdentifier().getId().equals(MessageReceiver.VELOCITY_CHANNEL)) {
return;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,12 @@
import com.velocitypowered.api.proxy.Player;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.Unpooled;
import io.v4guard.plugin.bungee.v4GuardBungee;
import io.v4guard.plugin.core.tasks.types.CompletableMCBrandTask;
import io.v4guard.plugin.core.utils.StringUtils;
import io.v4guard.plugin.velocity.v4GuardVelocity;
import net.md_5.bungee.api.plugin.Listener;
import org.bson.Document;

public class PluginMessagingListener implements Listener {
public class PluginMessagingListener {

@Subscribe(order = PostOrder.FIRST)
public void onMessage(PluginMessageEvent e){
Expand All @@ -23,12 +21,12 @@ public void onMessage(PluginMessageEvent e){
if(e.getSource() instanceof Player){
if(e.getIdentifier().getId().equals("MC|Brand") || e.getIdentifier().getId().equals("minecraft:brand")){
Player player = (Player) e.getSource();
CompletableMCBrandTask task = v4GuardBungee.getCoreInstance().getCompletableTaskManager().getBrandTask(player.getUsername());
CompletableMCBrandTask task = v4GuardVelocity.getCoreInstance().getCompletableTaskManager().getBrandTask(player.getUsername());
if(task == null) task = new CompletableMCBrandTask(player.getUsername());
task.addData(new String(e.getData()));
} else if (e.getIdentifier().getId().equals("LMC") || e.getIdentifier().getId().equals("labymod3:main")){
Player player = (Player) e.getSource();
CompletableMCBrandTask task = v4GuardBungee.getCoreInstance().getCompletableTaskManager().getBrandTask(player.getUsername());
CompletableMCBrandTask task = v4GuardVelocity.getCoreInstance().getCompletableTaskManager().getBrandTask(player.getUsername());
if(task == null) task = new CompletableMCBrandTask(player.getUsername());
ByteBuf buf = Unpooled.wrappedBuffer(e.getData());
String key = StringUtils.readString(buf, Short.MAX_VALUE);
Expand Down