Skip to content

Commit

Permalink
Fix sur la fin de contest (#484)
Browse files Browse the repository at this point in the history
*Avez vous lu le [Code de
Conduite](https://github.com/Margouta/PluginOpenMC/blob/main/CODE_OF_CONDUCT.md)?*:
oui

*Votre code se compile t-il en local ?*: oui

*Avez-vous supprimez les imports inutilisés ?*: oui

## Decrivez vos changements
*Clairement et avec des screenshots si nécessaires*
`[18:41:56 INFO]: iambibi_ issued server command: /contest setphase 3
[18:41:56 INFO]: iambibi_ lost connection: Procédure de Fin du Contest
Cela devrait prendre quelques minutes
[18:41:56 INFO]: [-] Adiniambibi_
[18:41:57 INFO]:                                                      

CONTEST! Time over! 
Fin du Contest, retrouvez vos récompenses et le bilan de ce Contest
sous forme de livre
*/contest pour voir quand le prochain contest arrive*

                                                     
[18:41:57 INFO]: Vous avez reçu la lettre du Contest
Cliquez-ici pour ouvrir la mailbox
[18:41:57 INFO]: [AywenCraftPlugin] [CONTEST] Fermeture du Contest
[18:41:59 WARN]: Can't keep up! Is the server overloaded? Running 3299ms
or 65 ticks behind
[18:41:59 ERROR]: [AywenCraftPlugin] Failed to send broadcast message to
Discord webhook. Response code: 404
[18:41:59 ERROR]: [AywenCraftPlugin] Failed to send broadcast message to
Discord webhook. Response code: 404
[18:42:05 INFO]: UUID of player iambibi_ is
f5fa46cb-c5fb-3324-8b69-b24c004d1d13
[18:42:36 INFO]: [+] Adiniambibi_`
  • Loading branch information
MathiasDPX authored Nov 6, 2024
2 parents c0f5297 + 18bf710 commit fc957a5
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ public void initPhase3(JavaPlugin plugin, FileConfiguration eventConfig) {
String playerCampName = getOfflinePlayerCampName(player);
ChatColor playerCampColor = ColorConvertor.getReadableColor(getOfflinePlayerCampChatColor(player));

bookMetaPlayer.addPage("§8§lStatistiques Personnelles\n§0Votre camp : " + playerCampColor + playerCampName + "\n§0Votre Grade sur Le Contest §8: " + playerCampColor + getRankContestFroOffline(player) + playerCampName + "\n§0Votre Rang sur Le Contest : §8#" + getRankPlayerInContest(player) + "\n§0Points Déposés : §b" + rs1.getString("point_dep"));
bookMetaPlayer.addPage("§8§lStatistiques Personnelles\n§0Votre camp : " + playerCampColor + playerCampName + "\n§0Votre Grade sur Le Contest §8: " + playerCampColor + getRankContestFroOffline(player) + playerCampName + "\n§0Votre Rang sur Le Contest : §8#" + getRankPlayerInContest(rs1.getInt("point_dep")) + "\n§0Points Déposés : §b" + rs1.getString("point_dep"));

int money = 0;
int lucky = 0;
Expand Down Expand Up @@ -507,7 +507,7 @@ public static String getTimeUntilNextMonday() {
public Integer getPlayerPoints(Player player) {
UUID playerUUID = player.getUniqueId();

String sql = "SELECT * FROM camps WHERE minecraft_uuid = ?";
String sql = "SELECT * FROM camps WHERE minecraft_uuid = ? LIMIT 1";
try (PreparedStatement states = connection.prepareStatement(sql)) {
states.setString(1, playerUUID.toString());
ResultSet result = states.executeQuery();
Expand Down Expand Up @@ -639,10 +639,10 @@ public ChatColor getOfflinePlayerCampChatColor(OfflinePlayer player) {
return campColor;
}

public Integer getRankPlayerInContest(OfflinePlayer player) {
String sql = "SELECT COUNT(*) AS rank FROM camps WHERE point_dep > (SELECT point_dep FROM camps WHERE minecraft_uuid = ?);";
public Integer getRankPlayerInContest(Integer pointsDep) {
String sql = "SELECT COUNT(*) AS rank FROM camps WHERE point_dep > ?";
try (PreparedStatement states = connection.prepareStatement(sql)) {
states.setString(1, player.getUniqueId().toString());
states.setInt(1, pointsDep);
ResultSet result = states.executeQuery();
if (result.next()) {
return result.getInt("rank") + 1;
Expand Down

0 comments on commit fc957a5

Please sign in to comment.