Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(tag.equals("01")) {
- rs.close();
- rs = ps.executeQuery(String.format("SELECT name, word FROM toplisten where name != 'timeDay'"));
- while(rs.next()) {
- String name = rs.getString("name");
- String word = rs.getString("word");
- String month = rs.getString("month");
- String year = rs.getString("year");
- Client n = Server.get().getClient(name);
- Statement p = con.createStatement();
- ResultSet r = p.executeQuery(String.format("SELECT name,career FROM accounts where name != '%s' order by %s desc limit 3", Server.get().getButler().getName(), name));
- int platz = 1;
- while(r.next()) {
- String nick = r.getString("name");
- String career = r.getString("career");
- String text = String.format("%s. Platz Top-%s im %s / %s", platz, word, month, year);
- Client ns = Server.get().getClient(nick);
- if(ns != null) {
- ns.setCareer(String.format("%s|%s %s|", ns.getCareer(), datum, text));
- } else {
- Server.get().query(String.format("update accounts set career='%s|%s %s|' where name='%s'", career, datum, text, nick));
- }
- Server.get().newMessage(Server.get().getButler().getName(), nick, word, String.format("Hallo %s,##diesen Monat hast du den %s. Platz auf der Topliste %s geschafft.#Diese besondere Leistung wurde in Form eines Career Eintrags bei dir dokumentiert.##dein James", nick, platz, word), time);
- platz++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement