geforkt von SteamWar/BungeeCore
Fix double Discord command registration, ConnectionListener and bau member commands
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
Dieser Commit ist enthalten in:
Ursprung
0ef4fc147c
Commit
8c098841ba
@ -73,7 +73,8 @@ public class ErrorLogger extends AbstractAppender {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static final List<String> filteredMessages = List.of(
|
private static final List<String> filteredMessages = List.of(
|
||||||
"read timed out"
|
"read timed out",
|
||||||
|
"disconnected while connecting to Lobby"
|
||||||
);
|
);
|
||||||
private static final List<String> filteredStacktraces = List.of(
|
private static final List<String> filteredStacktraces = List.of(
|
||||||
"ErrorLogger",
|
"ErrorLogger",
|
||||||
|
@ -175,7 +175,7 @@ public class BauCommand extends SWCommand {
|
|||||||
return new TypeMapper<SteamwarUser>() {
|
return new TypeMapper<SteamwarUser>() {
|
||||||
@Override
|
@Override
|
||||||
public SteamwarUser map(Chatter sender, PreviousArguments previousArguments, String s) {
|
public SteamwarUser map(Chatter sender, PreviousArguments previousArguments, String s) {
|
||||||
return sender.user();
|
return SteamwarUser.get(s);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -170,10 +170,7 @@ public class DiscordBot {
|
|||||||
}
|
}
|
||||||
}).repeat(30, TimeUnit.SECONDS).schedule();
|
}).repeat(30, TimeUnit.SECONDS).schedule();
|
||||||
|
|
||||||
Guild guild = getGuild();
|
|
||||||
commandSetup(jda.retrieveCommands(), jda.updateCommands());
|
commandSetup(jda.retrieveCommands(), jda.updateCommands());
|
||||||
commandSetup(guild.retrieveCommands(), guild.updateCommands());
|
|
||||||
|
|
||||||
jda.addEventListener(
|
jda.addEventListener(
|
||||||
new DiscordTicketHandler(),
|
new DiscordTicketHandler(),
|
||||||
new DiscordTeamEvent(),
|
new DiscordTeamEvent(),
|
||||||
|
@ -22,13 +22,12 @@ package de.steamwar.velocitycore.listeners;
|
|||||||
import com.velocitypowered.api.event.Subscribe;
|
import com.velocitypowered.api.event.Subscribe;
|
||||||
import com.velocitypowered.api.event.connection.LoginEvent;
|
import com.velocitypowered.api.event.connection.LoginEvent;
|
||||||
import com.velocitypowered.api.proxy.Player;
|
import com.velocitypowered.api.proxy.Player;
|
||||||
import de.steamwar.velocitycore.commands.PunishmentCommand;
|
|
||||||
import de.steamwar.velocitycore.commands.WebpasswordCommand;
|
|
||||||
import de.steamwar.messages.Chatter;
|
import de.steamwar.messages.Chatter;
|
||||||
import de.steamwar.messages.Message;
|
import de.steamwar.messages.Message;
|
||||||
import de.steamwar.sql.BannedUserIPs;
|
import de.steamwar.sql.BannedUserIPs;
|
||||||
import de.steamwar.sql.Punishment;
|
import de.steamwar.sql.Punishment;
|
||||||
import de.steamwar.sql.SteamwarUser;
|
import de.steamwar.sql.SteamwarUser;
|
||||||
|
import de.steamwar.velocitycore.commands.PunishmentCommand;
|
||||||
import net.kyori.adventure.text.event.ClickEvent;
|
import net.kyori.adventure.text.event.ClickEvent;
|
||||||
|
|
||||||
import java.sql.Timestamp;
|
import java.sql.Timestamp;
|
||||||
@ -42,7 +41,7 @@ public class BanListener extends BasicListener {
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onLogin(LoginEvent event) {
|
public void onLogin(LoginEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
SteamwarUser user = SteamwarUser.getOrCreate(player.getUniqueId(), player.getUsername(), ConnectionListener::newPlayer, WebpasswordCommand::changeUsername);
|
SteamwarUser user = SteamwarUser.get(player.getUniqueId());
|
||||||
String ip = IPSanitizer.getTrueAddress(player).getHostAddress();
|
String ip = IPSanitizer.getTrueAddress(player).getHostAddress();
|
||||||
if (user.isPunished(Punishment.PunishmentType.Ban)) {
|
if (user.isPunished(Punishment.PunishmentType.Ban)) {
|
||||||
BannedUserIPs.banIP(user.getId(), ip);
|
BannedUserIPs.banIP(user.getId(), ip);
|
||||||
|
@ -31,10 +31,7 @@ import de.steamwar.persistent.Servertype;
|
|||||||
import de.steamwar.persistent.Subserver;
|
import de.steamwar.persistent.Subserver;
|
||||||
import de.steamwar.sql.SteamwarUser;
|
import de.steamwar.sql.SteamwarUser;
|
||||||
import de.steamwar.sql.UserPerm;
|
import de.steamwar.sql.UserPerm;
|
||||||
import de.steamwar.velocitycore.commands.ChallengeCommand;
|
import de.steamwar.velocitycore.commands.*;
|
||||||
import de.steamwar.velocitycore.commands.CheckCommand;
|
|
||||||
import de.steamwar.velocitycore.commands.ModCommand;
|
|
||||||
import de.steamwar.velocitycore.commands.MsgCommand;
|
|
||||||
import de.steamwar.velocitycore.discord.DiscordBot;
|
import de.steamwar.velocitycore.discord.DiscordBot;
|
||||||
import de.steamwar.velocitycore.discord.util.DiscordRanks;
|
import de.steamwar.velocitycore.discord.util.DiscordRanks;
|
||||||
import de.steamwar.velocitycore.mods.ModUtils;
|
import de.steamwar.velocitycore.mods.ModUtils;
|
||||||
@ -57,10 +54,10 @@ public class ConnectionListener extends BasicListener {
|
|||||||
@Subscribe
|
@Subscribe
|
||||||
public void onPermissionSetup(PermissionsSetupEvent event) {
|
public void onPermissionSetup(PermissionsSetupEvent event) {
|
||||||
event.setProvider(subject -> {
|
event.setProvider(subject -> {
|
||||||
if(!(subject instanceof Player))
|
if(!(subject instanceof Player player))
|
||||||
return perm -> Tristate.TRUE;
|
return perm -> Tristate.TRUE;
|
||||||
|
|
||||||
Set<UserPerm> perms = SteamwarUser.get(((Player) subject).getUniqueId()).perms();
|
Set<UserPerm> perms = SteamwarUser.getOrCreate(player.getUniqueId(), player.getUsername(), ConnectionListener::newPlayer, WebpasswordCommand::changeUsername).perms();
|
||||||
if(perms.contains(UserPerm.ADMINISTRATION))
|
if(perms.contains(UserPerm.ADMINISTRATION))
|
||||||
return perm -> Tristate.TRUE;
|
return perm -> Tristate.TRUE;
|
||||||
else if(perms.contains(UserPerm.TEAM))
|
else if(perms.contains(UserPerm.TEAM))
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren