Welcome to Bukkit France

Inscrivez-vous maintenant pour profiter d'un accès total à tout le contenu offert par la meilleur communauté Bukkit française ! Une fois inscrit et connecté, vous pourrez contribuez à la communauté en postant vos propres sujets et questions ou en répondant à ceux existants. Vous pourrez aussi customiser votre profil, recevoir des points de réputations, communiquer avec les autres membres via le chat, et plus encore! 

scorshull

Membres
  • Compteur de contenus

    2
  • Inscription

  • Dernière visite

Réputation sur la communauté

0 Neutre

À propos de scorshull

  • Rang
    Nouveau
  1. Launcher en java

    Bonjour,   Je n'ai pas d'erreur, je clique sur connection puis rien ne se passe.  
  2. Launcher en java

    Bonjours, Quand le lance le launcher, la bar de téléchargement reste sur "cliquer sur connection", pas de téléchargement rien. J'ai pourtant bien suivis le tuto de TheShark34. J'aimerais si possible une réponse rapide et détaillé pour m'ameliorer. Cordialement,   Administrateur scorshull of ZenoriaMC     Launcher.java : package fr.scorshull.zenoriamc.launcher; import java.io.File; import java.io.IOException; import fr.theshark34.openauth.AuthPoints; import fr.theshark34.openauth.AuthenticationException; import fr.theshark34.openauth.Authenticator; import fr.theshark34.openauth.model.AuthAgent; import fr.theshark34.openauth.model.response.AuthResponse; import fr.theshark34.openlauncherlib.launcher.AuthInfos; import fr.theshark34.openlauncherlib.launcher.GameFolder; import fr.theshark34.openlauncherlib.launcher.GameInfos; import fr.theshark34.openlauncherlib.launcher.GameLauncher; import fr.theshark34.openlauncherlib.launcher.GameTweak; import fr.theshark34.openlauncherlib.launcher.GameType; import fr.theshark34.openlauncherlib.launcher.GameVersion; import fr.theshark34.supdate.BarAPI; import fr.theshark34.supdate.SUpdate; import fr.theshark34.swinger.Swinger; public class Launcher { public static final GameVersion SC_VERSION = new GameVersion ("1.8", GameType.V1_8_HIGHER); public static final GameInfos SC_INFOS = new GameInfos("ZenoriaMC V1.0", SC_VERSION, true, new GameTweak[] {GameTweak.OPTIFINE}); public static final File SC_DIR = SC_INFOS.getGameDir(); public static GameFolder SC_FOLDER = new GameFolder("resources/assets", "resources/libraries", "./", "jar/"); private static AuthInfos authInfos; private static Thread updateThread; public static void auth(String username, String password) throws AuthenticationException { Authenticator authenticator = new Authenticator(Authenticator.MOJANG_AUTH_URL, AuthPoints.NORMAL_AUTH_POINTS); AuthResponse response = authenticator.authenticate(AuthAgent.MINECRAFT, username, password, ""); authInfos = new AuthInfos(response.getSelectedProfile().getName(), response.getAccessToken(), response.getSelectedProfile().getId()); } public static void update() throws Exception { SUpdate su = new SUpdate("http://zenoriamc.fr/NEPASTOUCHER/resources/", SC_DIR); updateThread = new Thread () { private int val; private int max; @Override public void run() { while(!this.isInterrupted()) { if(BarAPI.getNumberOfFileToDownload() == 0) { LauncherFrame.getInstance().getLauncherPanel().setInfoText("Verification des fichiers"); continue; } val = (int) (BarAPI.getNumberOfTotalDownloadedBytes() / 1000); max = (int) (BarAPI.getNumberOfTotalBytesToDownload() / 1000); LauncherFrame.getInstance().getLauncherPanel().getProgressBar().setMaximum(max); LauncherFrame.getInstance().getLauncherPanel().getProgressBar().setValue(val); LauncherFrame.getInstance().getLauncherPanel().setInfoText("Telechargement des fichiers " + BarAPI.getNumberOfDownloadedFiles() + "/" + BarAPI.getNumberOfFileToDownload() + Swinger.percentage(val, max) + "%"); } } }; updateThread.start(); su.start(); updateThread.interrupt(); } public static void launch() throws IOException { GameLauncher gameLauncher= new GameLauncher(SC_INFOS, GameFolder.BASIC, authInfos); Process p = gameLauncher.launch(); try { Thread.sleep(5000L); }catch (InterruptedException e) { } LauncherFrame.getInstance().setVisible(false); try { p.waitFor(); }catch (InterruptedException e) { } System.exit(0); } public static void interruptThread() { updateThread.interrupt(); } } LauncherPanel.java : package fr.scorshull.zenoriamc.launcher; import java.awt.Color; import java.awt.Graphics; import java.awt.Image; import javax.swing.JFrame; import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.JTextField; import javax.swing.SwingConstants; import fr.theshark34.openauth.AuthenticationException; import fr.theshark34.openlauncherlib.launcher.util.UsernameSaver; import fr.theshark34.swinger.Swinger; import fr.theshark34.swinger.colored.SColoredBar; import fr.theshark34.swinger.event.SwingerEvent; import fr.theshark34.swinger.event.SwingerEventListener; import fr.theshark34.swinger.textured.STexturedButton; @SuppressWarnings("serial") public class LauncherPanel extends JPanel implements SwingerEventListener { private Image background = Swinger.getResource("background.png"); private UsernameSaver saver = new UsernameSaver(Launcher.SC_INFOS); private JTextField usernameField = new JTextField(saver.getUsername("")); private JTextField passwordField = new JTextField(); private STexturedButton playButton = new STexturedButton(Swinger.getResource("play.png")); private STexturedButton quitButton = new STexturedButton(Swinger.getResource("quit.png")); private STexturedButton hideButton = new STexturedButton(Swinger.getResource("hide.png")); private SColoredBar progressBar = new SColoredBar (new Color(255, 255, 255, 15), (new Color(255, 255, 255, 20))); private JLabel infoLabel = new JLabel("Cliquer sur connection !", SwingConstants.CENTER); public LauncherPanel() { this.setLayout(null); usernameField.setForeground(Color.GRAY); usernameField.setFont(usernameField.getFont().deriveFont(20F)); usernameField.setCaretColor(Color.GRAY); usernameField.setOpaque(false); usernameField.setBorder(null); usernameField.setBounds(584, 292, 239, 42); this.add(usernameField); passwordField.setForeground(Color.GRAY); passwordField.setFont(usernameField.getFont()); passwordField.setCaretColor(Color.GRAY); passwordField.setOpaque(false); passwordField.setBorder(null); passwordField.setBounds(623, 395, 237, 38); this.add(passwordField); playButton.setBounds(26, 308, 491 ,130); playButton.addEventListener(this); this.add(playButton); quitButton.setBounds(925, 11, 45,45); quitButton.addEventListener(this); this.add(quitButton); hideButton.setBounds(925, 61, 45, 45); hideButton.addEventListener(this); this.add(hideButton); progressBar.setBounds(154, 210, 671, 14); this.add(progressBar); infoLabel.setBounds(154, 210, 671, 19); this.add(infoLabel); } @Override public void onEvent(SwingerEvent e) { if (e.getSource() == playButton) { setFieldsEnabled(false); if(usernameField.getText().replaceAll(" ", " ").length() == 0 || passwordField.getText().length() == 0) { JOptionPane.showMessageDialog(this, "Erreur veuillez entrer un pseudo valide et un mot de passe valide", "Erreur", JOptionPane.ERROR_MESSAGE); setFieldsEnabled(true); return; } Thread t = new Thread() { @Override public void run() { try { Launcher.auth(usernameField.getText(), passwordField.getText()); } catch (AuthenticationException e) { JOptionPane.showMessageDialog(LauncherPanel.this, "Erreur, impossible de se connecter : " + e.getErrorModel().getErrorMessage(), "Erreur", JOptionPane.ERROR_MESSAGE); setFieldsEnabled(true); return; } } }; t.start(); } else if(e.getSource() == quitButton) System.exit(0); else if(e.getSource() == hideButton) LauncherFrame.getInstance().setState(JFrame.ICONIFIED); } public void paintComponent(Graphics g) { super.paintComponent(g); g.drawImage(background, 0, 0, this.getWidth(), this.getHeight(), this); } private void setFieldsEnabled(boolean enabled) { usernameField.setEnabled(enabled); playButton.setEnabled(enabled); } public SColoredBar getProgressBar() { return progressBar; } public void setInfoText(String text) { infoLabel.setText(text); } } LauncherFrame.java : package fr.scorshull.zenoriamc.launcher; import javax.swing.JFrame; import fr.theshark34.swinger.Swinger; import fr.theshark34.swinger.util.WindowMover; @SuppressWarnings("serial") public class LauncherFrame extends JFrame { private static LauncherFrame instance; private LauncherPanel launcherPanel; public LauncherFrame() { this.setTitle("ZenoriaMC V0.1"); this.setSize(975, 625); this.setDefaultCloseOperation(EXIT_ON_CLOSE); this.setLocationRelativeTo(null); this.setUndecorated(true); this.setIconImage(Swinger.getResource("icon.png")); this.setContentPane(launcherPanel = new LauncherPanel()); WindowMover mover = new WindowMover(this); this.addMouseListener(mover); this.addMouseMotionListener(mover); this.setVisible(true); } public static void main(String[] args) { Swinger.setSystemLookNFeel(); Swinger.setResourcePath("/fr/scorshull/zenoriamc/launcher/resources/"); instance = new LauncherFrame(); } public static LauncherFrame getInstance() { return instance; } public LauncherPanel getLauncherPanel() { return this.launcherPanel; } }