Archiviert
1
0

Merge pull request 'Fixed Team Leader is Member' (#198) from Team_Leader_Fix into master

Reviewed-on: SteamWar/BungeeCore#198
Reviewed-by: Lixfel <lixfel@steamwar.de>
Dieser Commit ist enthalten in:
Lixfel 2021-04-14 14:24:22 +02:00
Commit 3a23ab5f36
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){