Plugin  Résolu Problème SQL

Discussion dans 'Support serveur et plugins' créé par IceOrange92, 27 Octobre 2018.

  1. IceOrange92

    IceOrange92 Mineur de diamant

    Inscrit:
    7 Décembre 2017
    Messages:
    24
    J'aime reçus:
    2
    Bonjour,
    J'ai récemment retravaillé un plugin spigot que je suis en train de créer. J'ai pour l'instant un problème, je n'arrive pas à communiquer avec ma base de données.

    Main.java
    Code:
    package eu.heroria.iceorange92;
    
    import java.util.HashMap;
    import java.util.Map;
    import java.util.UUID;
    
    import org.bukkit.Bukkit;
    import org.bukkit.entity.Player;
    import org.bukkit.event.EventHandler;
    import org.bukkit.event.Listener;
    import org.bukkit.event.player.PlayerJoinEvent;
    import org.bukkit.event.player.PlayerKickEvent;
    import org.bukkit.event.player.PlayerQuitEvent;
    import org.bukkit.permissions.PermissionAttachment;
    import org.bukkit.plugin.java.JavaPlugin;
    
    import eu.heroria.iceorange92.Npc.NpcListener;
    import eu.heroria.iceorange92.data.Rank;
    import eu.heroria.iceorange92.data.PlayerData;
    import eu.heroria.iceorange92.data.PlayerDataManager;
    import eu.heroria.iceorange92.data.PlayerXpManager;
    import eu.heroria.iceorange92.data.SqlConnection;
    
    public class Main extends JavaPlugin implements Listener {
        public SqlConnection sql;
        public PlayerDataManager dataManager = new PlayerDataManager(this);
        public Map<Player, PlayerData> dataPlayers = new HashMap<>();
        public Map<UUID, PermissionAttachment> playerPermission = new HashMap<>();
        
        
        public void onEnable() {
            sql = new SqlConnection(this, "jdbc:mysql://", "localhost", "heroria", "root", "");
            getServer().getPluginManager().registerEvents(new PlayerXpManager(this), this);
            getServer().getPluginManager().registerEvents(new NpcListener(this), this);
            getServer().getPluginManager().registerEvents(sql, this);
            getServer().getPluginManager().registerEvents(this, this);
        }
        
        public void onDisable() {
            for (Player all : Bukkit.getServer().getOnlinePlayers()){
                all.kickPlayer(Bukkit.getShutdownMessage());
            }
            sql.disconnect();
        }
        
        @EventHandler
        public void onJoin(PlayerJoinEvent event) {
            Player player = (Player)event.getPlayer();
            sql.createAccount(player);
            dataManager.loadPlayerData(player);
        }
        
        @EventHandler
        public void onQuit(PlayerQuitEvent event) {
            Player player = (Player)event.getPlayer();
            dataManager.savePlayerData(player);
        }
        
        @EventHandler
        public void onKick(PlayerKickEvent event) {
            Player player = (Player)event.getPlayer();
            dataManager.savePlayerData(player);
        }
        
        public void setupPermissions(Player player) {
            PermissionAttachment attachment = player.addAttachment(this);
            this.playerPermission.put(player.getUniqueId(), attachment);
            permissionSetter(player, player.getUniqueId());
        }
    
        private void permissionSetter(Player player, UUID uuid) {
            PermissionAttachment attachment = this.playerPermission.get(uuid);
            Rank rank = sql.getRank(player);
            switch(rank) {
                case VIP:
                    attachment.setPermission("minecraft.command.me", true);
                    break;
                case MODO:
                    attachment.setPermission("minecraft.command.kill", true);
                    break;
                
                case CM:
                    attachment.setPermission("minecraft.command.*", true);
                    attachment.setPermission("worldedit.selection.pos", true);
                    attachment.setPermission("worldedit.*", true);
                    break;
                    
                case DEV:
                    attachment.setPermission("worldedit.*", true);
                    attachment.setPermission("minecraft.command.*", true);
                    attachment.setPermission("worldguard.*", true);
                    attachment.setPermission("bukkit.command.restart", true);
                    break;
                    
                case ADMIN:
                    attachment.setPermission("*", true);
                    break;
                    
                default:
                    attachment.setPermission("admintools.player", true);
                    break;
            
            }
        }
    }
    
    
    SQLConnection.java
    Code:
    package eu.heroria.iceorange92.data;
    
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.PreparedStatement;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    
    import org.bukkit.entity.Player;
    import org.bukkit.event.Listener;
    
    import eu.heroria.iceorange92.Main;
    import eu.heroria.iceorange92.data.PlayerData;
    import eu.heroria.iceorange92.data.Rank;
    
    public class SqlConnection implements Listener {
        private Connection connection;
        private Main pl;
        private String urlbase, host, database, user, pass;
        
        
        public SqlConnection(Main pl, String urlbase, String host, String database, String user, String pass) {
            this.pl = pl;
            this.urlbase = urlbase;
            this.host = host;
            this.database = database;
            this.user = user;
            this.pass = pass;
        }
        
        public void connection() {
            if(!isConnected()) {
                try {
                    connection = DriverManager.getConnection(urlbase + host + "/" + database, user, pass);
                } catch (SQLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        }
        
        public void disconnect() {
            if(isConnected()) {
                try {
                    connection.close();
                    System.out.println("HeroriaCore is disconnected.");
                } catch (SQLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        }
        
        public boolean isConnected() {
            return connection != null;
        }
        
        public void createAccount(Player player) {
            if(!hasAccount(player)) {
                //INSERT
                try {
                    PreparedStatement q = connection.prepareStatement("INSERT INTO players(uuid,balance,rank,faction,xp,reputation) VALUES (?,?,?,?,?,?)");
                    q.setString(1, player.getUniqueId().toString());
                    q.setInt(2, 100);
                    q.setInt(3, Rank.JOUEUR.getPower());
                    q.setInt(4, 0);
                    q.setInt(5, 1);
                    q.setInt(6, 100);
                    q.execute();
                    q.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
        }
        
        public boolean hasAccount(Player player) {
            try {
                PreparedStatement q = connection.prepareStatement("SELECT uuid FROM players WHERE uuid = ?");
                q.setString(1, player.getUniqueId().toString());
                ResultSet resultat = q.executeQuery();
                boolean hasAccount = resultat.next();
                q.close();
                return hasAccount;
            } catch (SQLException e) {
                e.printStackTrace();
            }
          
            return false;
        }
        
        public int getBalance(Player player) {
            //SELECT
            if(pl.dataPlayers.containsKey(player)) {
                PlayerData playerData = pl.dataPlayers.get(player);
                return playerData.getBalance();
            }
            return 0;
        }
        
        public int getFaction(Player player) {
            if(pl.dataPlayers.containsKey(player)) {
                PlayerData playerData = pl.dataPlayers.get(player);
                return playerData.getFaction();
            }
            return 0;
        }
        
        public void setFaction(Player player, int faction) {
            if(pl.dataPlayers.containsKey(player)) {
                PlayerData playerData = pl.dataPlayers.get(player);
                playerData.setFaction(faction);
                pl.dataPlayers.remove(player);
                pl.dataPlayers.put(player, playerData);
            }
        }
        
        public int getXp(Player player) {
            if(pl.dataPlayers.containsKey(player)) {
                PlayerData playerData = pl.dataPlayers.get(player);
                return playerData.getXp();
            }
            return 0;
        }
        
        public void setXp(Player player, int xp) {
            if(pl.dataPlayers.containsKey(player)) {
                PlayerData playerData = pl.dataPlayers.get(player);
                playerData.setFaction(xp);
                pl.dataPlayers.remove(player);
                pl.dataPlayers.put(player, playerData);
            }
        }
        
        public int getReputation(Player player) {
            if(pl.dataPlayers.containsKey(player)) {
                PlayerData playerData = pl.dataPlayers.get(player);
                return playerData.getReputation();
            }
            return 0;
        }
        
        public void setReputation(Player player, int reputation) {
            if(pl.dataPlayers.containsKey(player)) {
                PlayerData playerData = pl.dataPlayers.get(player);
                playerData.setFaction(reputation);
                pl.dataPlayers.remove(player);
                pl.dataPlayers.put(player, playerData);
            }
        }
        
        public void setMoney(Player player, int amount) {
            if(pl.dataPlayers.containsKey(player));{
                PlayerData playerData = pl.dataPlayers.get(player);
                playerData.setBalance(amount);
                pl.dataPlayers.remove(player);
                pl.dataPlayers.put(player, playerData);
            }
        }
        
        public void addMoney(Player player, int amount) {
            if(pl.dataPlayers.containsKey(player)) {
                PlayerData playerData = pl.dataPlayers.get(player);
                int balance = playerData.getBalance();
                int newBalance = balance + amount;
                playerData.setBalance(newBalance);
                pl.dataPlayers.remove(player);
                pl.dataPlayers.put(player, playerData);
            }
        }
        
        public boolean removeMoney(Player player, int amount) {
            if(pl.dataPlayers.containsKey(player)) {
                PlayerData playerData = pl.dataPlayers.get(player);
                int balance = playerData.getBalance();
                if(balance < amount) {
                    player.sendMessage("§4[Heroria]Désolé, vous n'avez pas assez d'argent pour effectuer cette transaction. On se fait un calin ?");
                    return true;
                }
                int newBalance = balance - amount;
                playerData.setBalance(newBalance);
                pl.dataPlayers.remove(player);
                pl.dataPlayers.put(player, playerData);
            }
            return false;
        }
        
        public void setRank(Player player, Rank rank) {
            if(pl.dataPlayers.containsKey(player)) {
                PlayerData playerData = pl.dataPlayers.get(player);
                playerData.setRank(rank);
                pl.dataPlayers.remove(player);
                pl.dataPlayers.put(player, playerData);
            }
        }
        
        public Rank getRank(Player player) {
            if(pl.dataPlayers.containsKey(player)) {
                PlayerData playerData = pl.dataPlayers.get(player);
                return playerData.getRank();
            }
            return Rank.JOUEUR;
        }
        
        public PlayerData createPlayerData(Player player) {
            if(!pl.dataPlayers.containsKey(player)) {
                try {
                    PreparedStatement rs = connection.prepareStatement("SELECT balance, rank, faction, reputation FROM players WHERE uuid = ?");
                    rs.setString(1, player.getUniqueId().toString());
                    ResultSet resultats = rs.executeQuery();
                    int balance = 0;
                    int faction = 0;
                    int xp = 1;
                    int reputation = 100;
                    Rank rank = Rank.JOUEUR;
                    while(resultats.next()) {
                        faction = resultats.getInt("faction");
                        balance = resultats.getInt("balance");
                        xp = resultats.getInt("xp");
                        reputation = resultats.getInt("reputation");
                        rank = Rank.powerToRank(resultats.getInt("rank"));
                    }
                    PlayerData playerData = new PlayerData();
                    playerData.setBalance(balance);
                    playerData.setRank(rank);
                    playerData.setFaction(faction);
                    playerData.setReputation(reputation);
                    playerData.setXp(xp);
                    rs.close();
                    return playerData;
                } catch (SQLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                    return new PlayerData();
                }
            }
            return null;
        }
        
        public void updatePlayerData(Player player) {
            if(pl.dataPlayers.containsKey(player)) {
                PlayerData playerData = pl.dataPlayers.get(player);
                int balance = playerData.getBalance();
                Rank rank = playerData.getRank();
                int power = rank.getPower();
                int faction = playerData.getFaction();
                int xp = playerData.getXp();
                int reputation = playerData.getReputation();
                PreparedStatement q;
                try {
                    q = connection.prepareStatement("UPDATE players SET rank = ?, balance = ?, faction = ?, xp = ?, reputation = ? WHERE uuid = ?");
                    q.setInt(1, power);
                    q.setInt(2, balance);
                    q.setInt(3, faction);
                    q.setInt(4, xp);
                    q.setInt(5, reputation);
                    q.setString(6, player.getUniqueId().toString());
                    q.executeUpdate();
                    q.close();
                } catch (SQLException e) {
                    // TODO Auto-generated catch block
                    e.printStackTrace();
                }
            }
        }
        
        public Connection getConnection() {
            return connection;
        }
    }
    
    Je cherche d'où viens le problème depuis longtemps, j'aimerais donc savoir si quelqu'un a une idée pour régler le problème. Voici le code d'erreur:
    Code:
    [10:15:40] [Server thread/ERROR]: Could not pass event PlayerJoinEvent to HeroriaCore v1.1
    org.bukkit.event.EventException: null
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.PlayerList.onPlayerJoin(PlayerList.java:346) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.PlayerList.a(PlayerList.java:166) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.LoginListener.b(LoginListener.java:159) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.LoginListener.e(LoginListener.java:57) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.NetworkManager.a(NetworkManager.java:233) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.ServerConnection.c(ServerConnection.java:140) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:845) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_191]
    Caused by: java.lang.NullPointerException
        at eu.heroria.iceorange92.data.SqlConnection.hasAccount(SqlConnection.java:83) ~[?:?]
        at eu.heroria.iceorange92.data.SqlConnection.createAccount(SqlConnection.java:59) ~[?:?]
        at eu.heroria.iceorange92.Main.onJoin(Main.java:49) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_191]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_191]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_191]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_191]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        ... 14 more
     
  2. DiscowZombie

    DiscowZombie Dev passionné
    Staff Modérateur Support

    Inscrit:
    2 Mars 2017
    Messages:
    2 597
    J'aime reçus:
    863
    Salut,

    lorsque tu tombes sur de tel stacktrace, la difficulté est généralement de comprendre l'erreur ; la solution est plutôt évidente ensuite. Donc pour comprendre où est le problème, lisons ensemble ce stacktrace ! Ton stacktrace ici se découpe en deux parties :
    Ici on t'informe que l'event PlayerJoinEvent ne s'est pas passé correctement, il s’est rendu face à un null et c'est à cause du plugin "HeroriaCore v1.1". Bon là je t'avoue que tu n'as pas vraiment avancé, mais tu sais déjà dans quelle directement cherchée.
    C'est le deuxième stacktrace qui est intéressant :
    Ici on te dit que c'est un NPE (NullPointerException) qui a causé le problème et tu sais même précisément ou ! Je vais partir du principe que tu ne connais pas l'erreur NPE sinon tu aurais surement déjà réussi à la corriger.

    Une exception de type NullPointerException est throws lorsque tu appelles une méthode sur un null. Généralement c'est un comportement non attendu par le programme que tu n'avais pas prévu. Vu que l’explication est assez abstraite, voici un exemple (Obvious) d'une NPE :
    Code:
    Player joueur = null;
    joueur.getName();
    Ici mon "joueur" est null (bon là c'est évidemment, normalement ce n'est pas aussi gros) et j’essaie d'appeler la méthode getName() dessus. Pour le programme, c'est un Player (c'est ce que je lui ait dit) donc normalement aucun problème pour appeler la méthode getName(). Cependant, vu que j'ai eu la (mauvaise) idée de donner la valeure null à mon joueur, il ne peut donc pas appeler la méthode getName() et me sort donc cette NPE.

    Pour revenir à ton problème, on voit dans le stacktrace les lignes du problème :
    Si je vais lire les lignes, je vois respectivement :
    Code:
    79 PreparedStatement q = connection.prepareStatement("SELECT uuid FROM players WHERE uuid = ?");
    80 q.setString(1, player.getUniqueId().toString());
    81 ResultSet resultat = q.executeQuery();
    82 boolean hasAccount = resultat.next();
    83 q.close();
    Code:
    59 if(!hasAccount(player)) {
    Code:
    49 sql.createAccount(player);
    On voit donc que l'erreur a été causé par l’appelle de la méthode createAccount(), qui a elle même appelé hasAccount() et c'est ce hasAccount() à la ligne 83 qui a sorti ton erreur. Avec toutes ces informations, tu devrais être armé pour trouver la solution !
    NB: Certains vont peut-être trouver ça bizarre de ne pas livrer la solution toute cuite sur un plateau (surtout dans la section "Support") et je répondrais à ces derniers la phrase d'un de mes profs : "On ne veut pas des informations qui sachent faire, on veut des personnes qui comprennent. Et certains sont un peu payés et d'autres beaucoup.".

    Tant que j'y suis, j'en profite pour te donner un petit retour sur ton code ! Je vois que tu exécutes toutes tes requêtes de façon synchrone, ce qui n'est absolument pas la bonne manière. N'ayant pas accès au reste du code je ne peux pas trop comprendre comment ça fonctionne complètement mais a priori ton API n'a pas l'air d'être asynchrone alors que c'est la bonne manière de faire ! Le problème avec ton code actuel, c'est que tu vas bloquer toutes les actions du thread serveur le temps de ta requête Sql. Si ta requête Sql prend 500ms par exemple, le thread serveur ne fera rien pendant 500ms ce qui, à force d'être combiné, fait lag tout le serveur. En tout cas, je t'invite à te renseigner un peu sur l’asynchrone dans les plugins ! ;)

    Si tu as encore des questions code ou autres, surtout n'hésite pas !
     
    Alex Fatta et robin4002 aiment ça.
  3. IceOrange92

    IceOrange92 Mineur de diamant

    Inscrit:
    7 Décembre 2017
    Messages:
    24
    J'aime reçus:
    2
    Re-bonjour,
    D'abord, merci d'avoir pris le temps de me répondre. J'avais compris que l'erreur venais de hasAccount. Cependant, ce code à été repris d'une ancienne version de mon plugin qui n'avait pas de problème. Je pense donc qu'il s'agit d'un problème de connexion à la base de données. Je n'ai pas trouvé d'erreur dans mes identifiants, donc je ne trouve toujours pas, désolé.
     
  4. ShE3py

    ShE3py Développeur en autodidacte

    Inscrit:
    26 Septembre 2015
    Messages:
    978
    J'aime reçus:
    163
    Bonjour,

    En l’occurrence c'est car tu n'appelles nul part la méthode SqlConnection#connection() [ce serait plutôt #connect], ce qui fait qu'il ne se connecte jamais à la BDD, et que du coup quand tu fais connection#prepareStatement(String) le field n'est pas initialisé, vaut donc null et renvois un NPE.

    Cordialement,
    ShE3py.
     
  5. IceOrange92

    IceOrange92 Mineur de diamant

    Inscrit:
    7 Décembre 2017
    Messages:
    24
    J'aime reçus:
    2
    Bonjour,

    Si tu parle de mettre sql.connection(); après sql = new SqlConnection(this, "jdbc:mysql://", "localhost", "heroria", "root", ""); dans Main, et bien j'ai rajouté cette ligne (j'avais oublié de le dire).

    Merci encore de votre aide à tous.
     
  6. DiscowZombie

    DiscowZombie Dev passionné
    Staff Modérateur Support

    Inscrit:
    2 Mars 2017
    Messages:
    2 597
    J'aime reçus:
    863
    Salut,

    du coup c'est résolu ou pas ? Si c'est résolu, tu peux ajouter le préfixe "Résolu". ;)
     
  7. IceOrange92

    IceOrange92 Mineur de diamant

    Inscrit:
    7 Décembre 2017
    Messages:
    24
    J'aime reçus:
    2
    Non, ce n'est pas résolu.
     
  8. ShE3py

    ShE3py Développeur en autodidacte

    Inscrit:
    26 Septembre 2015
    Messages:
    978
    J'aime reçus:
    163
    Tu n'as pas de SQLException quelque part dans les logs ?
     
  9. IceOrange92

    IceOrange92 Mineur de diamant

    Inscrit:
    7 Décembre 2017
    Messages:
    24
    J'aime reçus:
    2
    Je n'en vois pas.
    Code:
    [11:31:04] [Server thread/INFO]: Loading properties
    [11:31:04] [Server thread/INFO]: Default game type: SURVIVAL
    [11:31:04] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-4bd94dc-bdcc7c7 (MC: 1.12.2) (Implementing API version 1.12.2-R0.1-SNAPSHOT)
    [11:31:04] [Server thread/INFO]: Debug logging is disabled
    [11:31:04] [Server thread/INFO]: Server Ping Player Sample Count: 12
    [11:31:04] [Server thread/INFO]: Using 4 threads for Netty based IO
    [11:31:04] [Server thread/INFO]: Generating keypair
    [11:31:04] [Server thread/INFO]: Starting Minecraft server on *:25565
    [11:31:04] [Server thread/INFO]: Using default channel type
    [11:31:05] [Server thread/INFO]: Set PluginClassLoader as parallel capable
    [11:31:05] [Server thread/INFO]: [HeroriaCore] Loading HeroriaCore v1.1
    [11:31:05] [Server thread/WARN]: **** SERVER IS RUNNING IN OFFLINE/INSECURE MODE!
    [11:31:05] [Server thread/WARN]: The server will make no attempt to authenticate usernames. Beware.
    [11:31:05] [Server thread/WARN]: While this makes the game possible to play without internet access, it also opens up the ability for hackers to connect with any username they choose.
    [11:31:05] [Server thread/WARN]: To change this, set "online-mode" to "true" in the server.properties file.
    [11:31:05] [Server thread/INFO]: **** Beginning UUID conversion, this may take A LONG time ****
    [11:31:05] [Server thread/INFO]: Preparing level "world"
    [11:31:05] [Server thread/INFO]: -------- World Settings For [world] --------
    [11:31:05] [Server thread/INFO]: Item Despawn Rate: 6000
    [11:31:05] [Server thread/INFO]: Item Merge Radius: 2.5
    [11:31:05] [Server thread/INFO]: Arrow Despawn Rate: 1200
    [11:31:05] [Server thread/INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [11:31:05] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
    [11:31:05] [Server thread/INFO]: View Distance: 10
    [11:31:05] [Server thread/INFO]: Experience Merge Radius: 3.0
    [11:31:05] [Server thread/INFO]: Zombie Aggressive Towards Villager: true
    [11:31:05] [Server thread/INFO]: Custom Map Seeds:  Village: 10387312 Feature: 14357617 Monument: 10387313 Slime: 987234911
    [11:31:05] [Server thread/INFO]: Mob Spawn Range: 4
    [11:31:05] [Server thread/INFO]: Hopper Transfer: 8 Hopper Check: 1 Hopper Amount: 1
    [11:31:05] [Server thread/INFO]: Random Lighting Updates: false
    [11:31:05] [Server thread/INFO]: Structure Info Saving: true
    [11:31:05] [Server thread/INFO]: Cactus Growth Modifier: 100%
    [11:31:05] [Server thread/INFO]: Cane Growth Modifier: 100%
    [11:31:05] [Server thread/INFO]: Melon Growth Modifier: 100%
    [11:31:05] [Server thread/INFO]: Mushroom Growth Modifier: 100%
    [11:31:05] [Server thread/INFO]: Pumpkin Growth Modifier: 100%
    [11:31:05] [Server thread/INFO]: Sapling Growth Modifier: 100%
    [11:31:05] [Server thread/INFO]: Wheat Growth Modifier: 100%
    [11:31:05] [Server thread/INFO]: NetherWart Growth Modifier: 100%
    [11:31:05] [Server thread/INFO]: Vine Growth Modifier: 100%
    [11:31:05] [Server thread/INFO]: Cocoa Growth Modifier: 100%
    [11:31:05] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    [11:31:05] [Server thread/INFO]: Entity Activation Range: An 32 / Mo 32 / Mi 16
    [11:31:05] [Server thread/INFO]: Max TNT Explosions: 100
    [11:31:05] [Server thread/INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [11:31:06] [Server thread/INFO]: -------- World Settings For [world_nether] --------
    [11:31:06] [Server thread/INFO]: Item Despawn Rate: 6000
    [11:31:06] [Server thread/INFO]: Item Merge Radius: 2.5
    [11:31:06] [Server thread/INFO]: Arrow Despawn Rate: 1200
    [11:31:06] [Server thread/INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [11:31:06] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
    [11:31:06] [Server thread/INFO]: View Distance: 10
    [11:31:06] [Server thread/INFO]: Experience Merge Radius: 3.0
    [11:31:06] [Server thread/INFO]: Zombie Aggressive Towards Villager: true
    [11:31:06] [Server thread/INFO]: Custom Map Seeds:  Village: 10387312 Feature: 14357617 Monument: 10387313 Slime: 987234911
    [11:31:06] [Server thread/INFO]: Mob Spawn Range: 4
    [11:31:06] [Server thread/INFO]: Hopper Transfer: 8 Hopper Check: 1 Hopper Amount: 1
    [11:31:06] [Server thread/INFO]: Random Lighting Updates: false
    [11:31:06] [Server thread/INFO]: Structure Info Saving: true
    [11:31:06] [Server thread/INFO]: Cactus Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Cane Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Melon Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Mushroom Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Pumpkin Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Sapling Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Wheat Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: NetherWart Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Vine Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Cocoa Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    [11:31:06] [Server thread/INFO]: Entity Activation Range: An 32 / Mo 32 / Mi 16
    [11:31:06] [Server thread/INFO]: Max TNT Explosions: 100
    [11:31:06] [Server thread/INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [11:31:06] [Server thread/INFO]: -------- World Settings For [world_the_end] --------
    [11:31:06] [Server thread/INFO]: Item Despawn Rate: 6000
    [11:31:06] [Server thread/INFO]: Item Merge Radius: 2.5
    [11:31:06] [Server thread/INFO]: Arrow Despawn Rate: 1200
    [11:31:06] [Server thread/INFO]: Allow Zombie Pigmen to spawn from portal blocks: true
    [11:31:06] [Server thread/INFO]: Nerfing mobs spawned from spawners: false
    [11:31:06] [Server thread/INFO]: View Distance: 10
    [11:31:06] [Server thread/INFO]: Experience Merge Radius: 3.0
    [11:31:06] [Server thread/INFO]: Zombie Aggressive Towards Villager: true
    [11:31:06] [Server thread/INFO]: Custom Map Seeds:  Village: 10387312 Feature: 14357617 Monument: 10387313 Slime: 987234911
    [11:31:06] [Server thread/INFO]: Mob Spawn Range: 4
    [11:31:06] [Server thread/INFO]: Hopper Transfer: 8 Hopper Check: 1 Hopper Amount: 1
    [11:31:06] [Server thread/INFO]: Random Lighting Updates: false
    [11:31:06] [Server thread/INFO]: Structure Info Saving: true
    [11:31:06] [Server thread/INFO]: Cactus Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Cane Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Melon Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Mushroom Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Pumpkin Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Sapling Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Wheat Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: NetherWart Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Vine Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Cocoa Growth Modifier: 100%
    [11:31:06] [Server thread/INFO]: Entity Tracking Range: Pl 48 / An 48 / Mo 48 / Mi 32 / Other 64
    [11:31:06] [Server thread/INFO]: Entity Activation Range: An 32 / Mo 32 / Mi 16
    [11:31:06] [Server thread/INFO]: Max TNT Explosions: 100
    [11:31:06] [Server thread/INFO]: Tile Max Tick Time: 50ms Entity max Tick Time: 50ms
    [11:31:06] [Server thread/INFO]: Preparing start region for level 0 (Seed: 8091180134227560537)
    [11:31:07] [Server thread/INFO]: Preparing spawn area: 8%
    [11:31:08] [Server thread/INFO]: Preparing spawn area: 57%
    [11:31:08] [Server thread/INFO]: Preparing start region for level 1 (Seed: 8091180134227560537)
    [11:31:09] [Server thread/INFO]: Preparing start region for level 2 (Seed: -5039012617705349796)
    [11:31:10] [Server thread/INFO]: [HeroriaCore] Enabling HeroriaCore v1.1
    [11:31:10] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
    [11:31:10] [Server thread/INFO]: Done (4,831s)! For help, type "help" or "?"
    [11:31:40] [User Authenticator #1/INFO]: UUID of player IceOrange92 is 564aa009-2a91-3bc0-a77e-a95bf878a102
    [11:31:40] [Server thread/INFO]: ln81SqlConnection
    [11:31:40] [Server thread/ERROR]: Could not pass event PlayerJoinEvent to HeroriaCore v1.1
    org.bukkit.event.EventException: null
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306) ~[spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:500) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:485) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.PlayerList.onPlayerJoin(PlayerList.java:346) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.PlayerList.a(PlayerList.java:166) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.LoginListener.b(LoginListener.java:159) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.LoginListener.e(LoginListener.java:57) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.NetworkManager.a(NetworkManager.java:233) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.ServerConnection.c(ServerConnection.java:140) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.MinecraftServer.D(MinecraftServer.java:845) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.DedicatedServer.D(DedicatedServer.java:406) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.MinecraftServer.C(MinecraftServer.java:679) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:577) [spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        at java.lang.Thread.run(Unknown Source) [?:1.8.0_191]
    Caused by: java.lang.NullPointerException
        at eu.heroria.iceorange92.data.SqlConnection.hasAccount(SqlConnection.java:83) ~[?:?]
        at eu.heroria.iceorange92.data.SqlConnection.createAccount(SqlConnection.java:59) ~[?:?]
        at eu.heroria.iceorange92.Main.onJoin(Main.java:49) ~[?:?]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_191]
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_191]
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_191]
        at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_191]
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot-1.12.2.jar:git-Spigot-4bd94dc-bdcc7c7]
        ... 14 more
    [11:31:40] [Server thread/INFO]: IceOrange92[/127.0.0.1:57270] logged in with entity id 322 at ([world]-14.146592487160708, 27.0, -7.168566897551463)
    [11:31:50] [Server thread/INFO]: IceOrange92 lost connection: Disconnected
    [11:31:50] [Server thread/INFO]: IceOrange92 left the game
    
    Quelqu'un saurait-il d'où vient le problème ?

    Edit: je vous rajoute mes derniers logs complets.
     
    #9 IceOrange92, 27 Octobre 2018
    Dernière édition: 28 Octobre 2018
  10. IceOrange92

    IceOrange92 Mineur de diamant

    Inscrit:
    7 Décembre 2017
    Messages:
    24
    J'aime reçus:
    2
    Bonjour, si vous pouviez m'aider, cela m'arrangerai beaucoup.
     

Partager cette page