Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- First:
- /**
- * Check the username and password and make sure they match up.
- * @param user
- * The username of the person who is
- * connecting to the <code>Server</code>.
- * @param pass
- * The password of the person who is
- * connecting to the <code>Server</code>.
- * @param right
- * The rights of the person - either
- * Administrator, Moderator, or a regular
- * player.
- * @param ip
- * The IP of the player who is connecting
- * to the <code>Server</code>.
- * @param height
- * The height of the person. The height will
- * define whether or not the he/she is in
- * world one or world two.
- * @param x
- * The x coordinate of the player for where
- * he/she stands.
- * @param y
- * The y coordinate of the player for where
- * he/she stands.
- * @param id
- * The ID of the player for when they log in.
- * Each person has an ID when connecting to
- * the <code>Server</code> and once someone
- * disconnects, the ID will be removed from that
- * person and the new player will be given a
- * different ID to use.
- * @return
- * <code>true</code> if the player's username,
- * password, rights, IP, height, x, y and ID are
- * found in the Database and they all match up
- * accordingly.
- * <code>false</code> otherwise.
- */
- public static boolean checkPlayer(String user, String pass, int right, String ip, int height, int x, int y, int id) {
- try {
- if (questionStatement("SELECT username FROM members WHERE username='" + user + "' AND password='" + pass + "' AND rights='" + right + "' AND ip='" + ip + "' AND height='" + height + "' AND x='" + x + "' AND y='" + y + "' AND id='" + id + "'")) {
- return true;
- }
- return false;
- } catch (Exception e) {
- return false;
- }
- }
- Second:
- /**
- * Check the username and password and make sure they match up.
- * @param user
- * @param pass
- * @param right
- * @param ip
- * @param height
- * @param x
- * @param y
- * @param id
- */
- public static boolean checkPlayer(String user, String pass, int right, String ip, int height, int x, int y, int id) {
- try {
- if (questionStatement("SELECT username FROM members WHERE username='" + user + "' AND password='" + pass + "' AND rights='" + right + "' AND ip='" + ip + "' AND height='" + height + "' AND x='" + x + "' AND y='" + y + "' AND id='" + id + "'")) {
- return true;
- }
- return false;
- } catch (Exception e) {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement