SteamWar/BungeeCore
Archiviert
13
2

Fixed Team Leader is Member

Dieser Commit ist enthalten in:
zOnlyKroks 2021-04-14 14:23:06 +02:00
Ursprung dc49ddff4d
Commit 2a16c8c66b
2 geänderte Dateien mit 4 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -177,7 +177,7 @@ public class TeamCommand extends BasicCommand {
if(checkTeamName(player, team, args[2])) if(checkTeamName(player, team, args[2]))
return; return;
Team.create(args[1], args[2], user.getId()); Team.create(args[1], args[2], user);
user.setTeam(Team.get(args[1]).getTeamId()); user.setTeam(Team.get(args[1]).getTeamId());
Message.send("TEAM_CREATE_CREATED", player, args[2]); Message.send("TEAM_CREATE_CREATED", player, args[2]);
} }

Datei anzeigen

@ -52,8 +52,9 @@ public class Team {
this(rs.getInt("TeamID"), rs.getString("TeamKuerzel"), rs.getString("TeamName"), rs.getString("TeamColor")); this(rs.getInt("TeamID"), rs.getString("TeamKuerzel"), rs.getString("TeamName"), rs.getString("TeamColor"));
} }
public static void create(String kuerzel, String name, int leader){ public static void create(String kuerzel, String name, SteamwarUser user){
SQL.update("INSERT INTO Team (TeamKuerzel, TeamName, TeamLeader) VALUES (?, ?, ?)", kuerzel, name, leader); user.setLeader(true);
SQL.update("INSERT INTO Team (TeamKuerzel, TeamName) VALUES (?, ?)", kuerzel, name);
} }
public static Team get(int id){ public static Team get(int id){