Thread: vBulletin/SMF/IPB/phpBB/myBB Server Intergration

Page 3 of 59 FirstFirst 123451353 ... LastLast
Results 21 to 30 of 590
  1. #21  
    Fuckin PRO

    Tyler's Avatar
    Join Date
    Jan 2008
    Age
    33
    Posts
    6,017
    Thanks given
    46
    Thanks received
    507
    Rep Power
    3330
    Quote Originally Posted by mad turnip View Post
    Credits to james on this tut im just releaseing fixed and on this site

    Difficulty: 4 - its mysql no one at all gets it

    Classes Modified: Server, Client

    Tested Server: rune fusion, devolution, czar

    Description: vBulletin Server - Site intergration - Credits James

    Assumed Knowledge: not being a noob, setting up a database,

    Step 1: Open up Server.java add this method

    Code:
    public static String MySQLURL = "jdbc:mysql://WEBSITE/DATABASENAME"; //The MySQL URL. Change the DATABASE to your database
    	public static String MySQLUser = "DATABSEUSERNAME"; //The MySQL login name
    	public static String MySQLPassword = "PASSWORD"; //The MySQL login pass
    	public static Connection conn; //Class Connection (in java libary) is now declared
    public static void createConnection(){
    	try {
    			Class.forName("com.mysql.jdbc.Driver").newInstance();
    			conn = DriverManager.getConnection(MySQLURL, MySQLUser, MySQLPassword);
    			misc.println("mysql connected");
    		} catch(Exception e) {	
    			e.printStackTrace();
    		}
    	}
    Ok now if you havent already got a webhoster or xampp
    visit this site and register an account

    http://www.000webhost.com/order.php

    its free and it has php and phpmyadmin

    once youve set that up go mysql and set up a database username pass word etc im not gona explain ti all

    Step 2: replace all the info in the above code with your details heres an example

    public static String MySQLURL = "jdbc:mysql://rune-server.org/runeserver_forums";
    public static String MySQLUser = "kevin"; //The MySQL login name
    public static String MySQLPassword = "ihackedtheseforums"; //The MySQL login pass

    that is jsut an example and will NOT work

    Step 3: connecting your server to it while still in server.java add this
    Code:
    createConnection();
    under

    Code:
    public static void main(java.lang.String args[])
    			throws NullPointerException {
    Step 4: Open up client.java and add these methods

    Code:
    public String passHash(String in, String salt){
    		String a = new MD5(in).compute();
    		String b = new MD5(a + salt).compute();
    		return b;
    	}
    	public MD5 md5(String a) {
    		MD5 b = new MD5(a);
    		return b;
    	}
    
    public boolean Load(String Password) {
    	try{
    	Statement statement = server.conn.createStatement();
    	ResultSet group = statement.executeQuery("SELECT * FROM user WHERE username = '"+playerName+"'");
    	while(group.next()) {
    	String pass = group.getString("password");
    	String salt = group.getString("salt");
    	String passe = passHash(Password, salt);
    	if(pass.equalsIgnoreCase(passe)) {
    	} else { 
    	statement.close();
    	return false; 
    	}
    	}
    	
    	ResultSet group2 = statement.executeQuery("SELECT * FROM user WHERE username = '"+playerName+"'");
    	while(group2.next()) {
    	String groupp2 = group2.getString("usergroupid");
    	int mgroup = Integer.parseInt(groupp2);
    	if(mgroup == 6) {
    	playerRights = 2;
    	return true;
    	} else if(mgroup == 9) {
    	//Silenced = true;
    	statement.close();
    	return true;
    	} 
    	}
    	return true;
    	} catch (Exception sqlEx){
    	
    	try{
    	server.conn.close();
    	server.createConnection();
    	} catch (Exception sqlEx2){}
    	
          //System.err.println(sqlEx);
    	  return false;
        }
    	return false;
    	}
    (NOTE i have my member groups confiqured for my server with extra member groups just visit your forum and go admin usergroup manager to see the user group ids and i jsut added to to show you how it was done you can do the rest)

    Step 5: this will probally be one of the hardest parts as you will probally messs it up if your a noob

    search
    Code:
    int loadgame
    and put this below it

    Code:
    if(Load(playerPass) == true) {
    then search

    Code:
    } catch (java.lang.Exception __ex) {
    And Put this ABOVE it

    Code:
    } else {
    		returnCode = 3;
    		disconnected = true;		
    		
    			}
    this requires some basic knowledge to actally do that part right

    step 6: make a new file called MD5.java and put this in it

    Code:
    /* $Id: MD5.java,v 1.2 2000/09/14 04:42:42 otis Exp $ */
    
    
    import java.security.*;
    
    /**
     *
     */
    public class MD5
    {
        private String inStr;
        private MessageDigest md5;
    
        /**
         * Constructs the MD5 object and sets the string whose MD5 is to be computed.
         *
         * @param inStr the <code>String</code> whose MD5 is to be computed
         */
        public MD5(String inStr)
        {
    	this.inStr = inStr;
            try
    	{
    	    this.md5 = MessageDigest.getInstance("MD5");
            }
    	catch (Exception e)
    	{
    	    System.out.println(e.toString());
    	    e.printStackTrace();
            }
        }
    
        /**
         * Computes the MD5 fingerprint of a string.
         *
         * @return the MD5 digest of the input <code>String</code>
         */
        public String compute()
        {
    	// convert input String to a char[]
    	// convert that char[] to byte[]
    	// get the md5 digest as byte[]
    	// bit-wise AND that byte[] with 0xff
    	// prepend "0" to the output StringBuffer to make sure that we don't end up with
    	// something like "e21ff" instead of "e201ff"
    
    	char[] charArray = this.inStr.toCharArray();
    	
    	byte[] byteArray = new byte[charArray.length];
    	
    	for (int i=0; i<charArray.length; i++)
    	    byteArray[i] = (byte) charArray[i];
    	
    	byte[] md5Bytes = this.md5.digest(byteArray);
    
            StringBuffer hexValue = new StringBuffer();
    
    	for (int i=0; i<md5Bytes.length; i++)
    	{
    	    int val = ((int) md5Bytes[i] ) & 0xff; 
    	    if (val < 16) hexValue.append("0");
    	    hexValue.append(Integer.toHexString(val));
    	}
    
    	return hexValue.toString();
        }
        public static void main(String[] args){
    		System.out.println(new MD5(args[0]).compute());
    	}
    }
    
    
    /*
    $Log: MD5.java,v $
    Revision 1.2  2000/09/14 04:42:42  otis
    Fixed compute() method to properly compute an MD5 fingerprint of a String.
    
    Revision 1.1  2000/07/28 07:53:18  otis
    MD5.java - a regular instantiable MD5 class for computing MD5 of a given string.
    MD5Factory.java - Singleton implementation of MD5.
    
    */
    Step 7: Download these files and put them in your source folder make sure there extracted

    http://www.megaupload.com/?d=KE47I3CV
    http://rapidshare.com/files/126872804/Files.zip.html

    -thanks harvey for links

    Step 8:
    make sure u have these imports in server.java
    Code:
    import java.sql.*;
    and these imports in client.java

    Code:
    import java.sql.*;
    import java.security.*;
    Ill do smf and IBP later
    Thanks alot, i think ill use.

    Question though, if you already have like 5k+ people, could you still do this? Or does it not matter.
    Free Filehost Premium Accounts
    Click Here
     

  2. #22  
    Banned
    Join Date
    Jul 2008
    Posts
    458
    Thanks given
    5
    Thanks received
    11
    Rep Power
    0
    Wow man this is a good work and thanks for helping the community lol =] good job
     

  3. #23  
    Anubis
    Guest
    Compiles fine, but when I run:

     

  4. #24  
    iPhone Expert


    Join Date
    Jul 2007
    Posts
    614
    Thanks given
    4
    Thanks received
    3
    Rep Power
    332
    Very good. Please introduce IPB.

    Thanks,
    ~JavaBoy


     

  5. #25  
    Donator

    Evan's Avatar
    Join Date
    Aug 2007
    Age
    28
    Posts
    1,028
    Thanks given
    1
    Thanks received
    3
    Rep Power
    134
    Add my MSn please. i need to talk to you.
    Gone...
     

  6. #26  
    Banned...Not

    DJ Cheetos's Avatar
    Join Date
    Aug 2008
    Age
    29
    Posts
    859
    Thanks given
    2
    Thanks received
    4
    Rep Power
    708
    umm what is the point of making that? is it hosting my server on my website database?
     

  7. #27  
    Barragecopter
    Guest
    Code:
    client.java:279: reference to Date is ambiguous, both class java.sql.Date in jav
    a.sql and class java.util.Date in java.util match
    public String date = new SimpleDateFormat("MM/dd/yyyy").format(new Date()); //no
     need to be in process and cause extra lag
                                                                       ^
    client.java:18013: reference to Date is ambiguous, both class java.sql.Date in j
    ava.sql and class java.util.Date in java.util match
            time = new SimpleDateFormat("hh:mm:ss").format(new Date());
                                                               ^
    Note: Some input files use or override a deprecated API.
    Note: Recompile with -Xlint:deprecation for details.
    2 errors
    Finished!
    . . .
    Help me fix please... i fixed other error but this is just too weird!

    Quote Originally Posted by Anubis View Post
    Compiles fine, but when I run:

    omg same to me too, someone can fix?
    Last edited by Barragecopter; 10-23-2008 at 03:26 PM. Reason: Double posting is not allowed!
     

  8. #28  
    iPhone Expert


    Join Date
    Jul 2007
    Posts
    614
    Thanks given
    4
    Thanks received
    3
    Rep Power
    332
    Anyone? explain to me what the **** is wrong with everyones errors?

    Thanks,
    ~JavaBoy


     

  9. #29  
    Registered Member
    AMG A Bear's Avatar
    Join Date
    Jun 2008
    Posts
    1,157
    Thanks given
    27
    Thanks received
    87
    Rep Power
    945
    It is because the server won't connect to their databases.

    It happens to dumb asses. It's a common thing when dumb asses mess with grown folk coding.
     

  10. #30  
    Banned
    Join Date
    Sep 2006
    Posts
    375
    Thanks given
    0
    Thanks received
    3
    Rep Power
    0
    Nice but there is one error for me now:

    Code:
    client.java:35598: unreachable statement
            return false;
            ^
     

Page 3 of 59 FirstFirst 123451353 ... LastLast

Thread Information
Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


User Tag List

Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •