Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package org.tespia;
- import java.sql.ResultSet;
- import org.bukkit.entity.Player;
- import org.bukkit.event.player.PlayerListener;
- import org.bukkit.event.player.PlayerLoginEvent;
- import lib.PatPeter.SQLibrary.*;
- public class ForumBridgePlayerListener extends PlayerListener {
- private ForumBridge plugin;
- private MySQL mysql;
- private ResultSet rs;
- private String groups;
- private Player player;
- private String sqlStatement;
- private String memberPerm;
- private Integer memberGroupID;
- private String donatorPerm;
- private Integer donatorGroupID;
- public ForumBridgePlayerListener(ForumBridge instance, String memberPerm, Integer memberGroupID, String donatorPerm, Integer donatorGroupID)
- {
- this.plugin = instance;
- this.memberPerm = memberPerm;
- this.memberGroupID = memberGroupID;
- this.donatorPerm = donatorPerm;
- this.donatorGroupID = donatorGroupID;
- try
- {
- this.mysql = new MySQL(plugin.getServer().getLogger(),"[ForumBridge]","mysql.tespia.org","3306","vbcraft_forum","tespia_sql","starchaser");
- this.mysql.open();
- }
- catch (Exception e)
- {
- plugin.getServer().broadcastMessage(e.getMessage());
- }
- }
- public void onPlayerLogin(PlayerLoginEvent event)
- {
- this.player = event.getPlayer();
- this.sqlStatement = ("SELECT secondary_group_ids FROM xf_user WHERE LOWER(username) = \"" + this.player.getName().toLowerCase() + "\";");
- try
- {
- this.rs = this.mysql.query(this.sqlStatement);
- this.groups = rs.getString("secondary_group_ids");
- System.out.println("SQL GOOD");
- }
- catch (Exception e)
- {
- e.printStackTrace();
- }
- //if (groups.contains(this.donatorGroupID.toString()))
- //{
- // plugin.getServer().broadcastMessage("GORUP ASDS");
- //}
- }
- }
Add Comment
Please, Sign In to add comment