Thread: Account Creation Tutorial - Dementhium

Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1 Account Creation Tutorial - Dementhium 
    Banned
    Join Date
    Oct 2011
    Posts
    16
    Thanks given
    0
    Thanks received
    6
    Rep Power
    0
    Decided to do a tutorial on this since, I rewrote the ForumIntegration to work correctly and, I don't use it anymore.
    Lets get started.

    Live Demo

    Requirements:
    A brain..
    Webhost

    Spoiler for Website Stuff:

    First you'll need these files:
    AcountCreation.rar
    Once you download those files go to config.php and edit the user/pass and the database.
    Once you've done that go into your webhost and create a database name it anything you want
    Then go to your phpmyadmin and
    Go to the database you just created and run these SQL queries
    Code:
    CREATE TABLE `temp_members_db` (
    `id` int(4) NOT NULL auto_increment,
    `confirm_code` varchar(65) NOT NULL default '',
    `username` varchar(65) NOT NULL default '',
    `email` varchar(65) NOT NULL default '',
    `password` varchar(65) NOT NULL default '',
    `ip` char(65) NOT NULL default '',
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    Code:
    CREATE TABLE `users` (
    `id` int(4) NOT NULL auto_increment,
    `username` varchar(65) NOT NULL default '',
    `password` varchar(65) NOT NULL default '',
    `ip` char(65) NOT NULL default '',
    PRIMARY KEY (`id`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1;
    Once you've done all that just change the names and the logo.
    Oh and change the email that's sent to the player.


    Spoiler for Server Stuff:

    Go to org > dementhium > mysql and make a new class named "AccountLoader.java"
    Ofcourse you'll have to change the host/db etc.
    Add this into it:
    Code:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package org.dementhium.mysql;
    
    import java.sql.Connection;
    import java.sql.DriverManager;
    import java.sql.ResultSet;
    import java.sql.SQLException;
    import java.sql.Statement;
    
    /**
     *
     * @author James <[email protected]>
     * Created on Nov 6, 2011
     */
    public class AccountLoader {
    
        public static Connection con = null;
        private static String host = "";
        private static String database = "";
        private static String user = "";
        private static String password = "";
    
        public static void createConnection() {
            try {
                Class.forName("com.mysql.jdbc.Driver").newInstance();
                con = DriverManager.getConnection("jdbc:mysql://" + host + "/" + database, user, password);
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
    
        public static boolean checkAccount(String playerName, String password) {
            try {
                Statement statement = con.createStatement();
                String query = "SELECT * FROM users WHERE username = '" + playerName + "'";
                ResultSet results = statement.executeQuery(query);
                while (results.next()) {
                    String pass = results.getString("password");
                    if (password.equalsIgnoreCase(pass)) {
                        return true;
                    }
                }
            } catch (SQLException e) {
                e.printStackTrace();
            }
            return false;
        }
    
        /*
         * I didn't test this, you can try it if you want.
         */
        public static void changeAccountPass(String userName, String newPass) {
            try {
                Statement statement = con.createStatement();
                String query = "UPDATE users SET password = '" + newPass + "' WHERE username = '" + userName + "'";
                ResultSet results = statement.executeQuery(query);
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }
    Once you add that go into RS2ServerBootstrap.java and find this
    Code:
    ForumIntegration.init();
    Change it to
    Code:
    AccountLoader.createConnection();
    Then add this import
    Code:
    import org.dementhium.mysql.AccountLoader;
    Now go to dementhium > io > PlayerLoader.java
    Find something like
    Code:
    boolean first = ForumIntegration.verify(def.getName(), def.getPassword());
    boolean second = ForumIntegration.verify(def.getName(), def.getPassword());
    Just change it to
    Code:
    boolean first = AccountLoader.checkAccount(def.getName(), def.getPassword());
    boolean second = AccountLoader.checkAccount(def.getName(), def.getPassword());
    Then add this import
    Code:
    import org.dementhium.mysql.AccountLoader;


    That should be everything, just post if I missed anything.

    Credits:
    The dementhium team
    Emperial, For the original website stuff
    Me
    Reply With Quote  
     

  2. #2  
    Donator
    Zᴀᴄʜ's Avatar
    Join Date
    Aug 2009
    Age
    26
    Posts
    999
    Thanks given
    111
    Thanks received
    64
    Rep Power
    13
    nice link it dont work l0l replace the link
    Reply With Quote  
     

  3. #3  
    Banned
    Join Date
    Oct 2011
    Posts
    16
    Thanks given
    0
    Thanks received
    6
    Rep Power
    0
    Quote Originally Posted by blacksabathy View Post
    nice link it dont work l0l replace the link
    I might just leave it the way it is, because of you. Why don't you actually learn how to do things instead of leeching shit. I bet if he uses this, he will forget to change the logo.

    @OT: I fixed the link, typed it wrong sorry.
    Reply With Quote  
     

  4. #4  
    Banned

    Join Date
    Nov 2010
    Age
    29
    Posts
    2,682
    Thanks given
    824
    Thanks received
    404
    Rep Power
    0
    Nice although Cell I think has released a similar one.
    Reply With Quote  
     

  5. #5  
    Officially Retired


    Join Date
    Oct 2007
    Age
    30
    Posts
    5,454
    Thanks given
    558
    Thanks received
    122
    Rep Power
    1364
    i added all this..but i try to run my client and never register it still can log in..how to fix?
    Reply With Quote  
     

  6. #6  
    Officially Retired

    Huey's Avatar
    Join Date
    Jan 2008
    Age
    22
    Posts
    16,478
    Thanks given
    3,385
    Thanks received
    7,727
    Rep Power
    5000
    Quote Originally Posted by Xeas View Post
    Nice although Cell I think has released a similar one.
    Not me i rarely release anything

    Quote Originally Posted by Zotic View Post
    i added all this..but i try to run my client and never register it still can log in..how to fix?
    It's not done correctly.
    Attached image
    Listen children don't become this guy.
    Quote Originally Posted by Owner Spikey View Post
    Why can I attack lower level npc's in a matter of a mouse hover but for a higher level npc the only choice to attack is by right clicking option attack?

    Reply With Quote  
     

  7. #7  
    Officially Retired


    Join Date
    Oct 2007
    Age
    30
    Posts
    5,454
    Thanks given
    558
    Thanks received
    122
    Rep Power
    1364
    aw..idk how to make it load on my mysql.
    Reply With Quote  
     

  8. #8  
    Registered Member izaazkothawala's Avatar
    Join Date
    Aug 2011
    Age
    27
    Posts
    633
    Thanks given
    39
    Thanks received
    40
    Rep Power
    8
    anyway to remove the confirmation crap?
    Reply With Quote  
     

  9. #9  
    Donator


    Join Date
    Sep 2011
    Posts
    1,086
    Thanks given
    390
    Thanks received
    406
    Rep Power
    327
    @izzablah Use my old release both my new and old one can be found here
    http://www.rune-server.org/runescape...ion-1-1-a.html
    Edit it to Emperia not Emperial lol
    Reply With Quote  
     

  10. #10  
    Banned
    Join Date
    Oct 2011
    Posts
    16
    Thanks given
    0
    Thanks received
    6
    Rep Power
    0
    Quote Originally Posted by Emperia View Post
    @izzablah Use my old release both my new and old one can be found here
    http://www.rune-server.org/runescape...ion-1-1-a.html
    Edit it to Emperia not Emperial lol
    Says Emperial because I got this off runelocus, name was Emperial there lol.
    Reply With Quote  
     

Page 1 of 2 12 LastLast

Thread Information
Users Browsing this Thread

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


User Tag List

Similar Threads

  1. [Dementhium 639] Account Creation [Version 1.1]
    By Aphelion in forum Snippets
    Replies: 19
    Last Post: 03-26-2012, 04:16 AM
  2. [Dementhium 639] Account Creation
    By Aphelion in forum Buying
    Replies: 1
    Last Post: 09-29-2011, 06:47 AM
  3. Dementhium 639 Account Creation [Unfinished]
    By IngeniousPentaSquid in forum Snippets
    Replies: 12
    Last Post: 09-28-2011, 08:09 PM
  4. [613] Account Creation
    By 03data in forum Tutorials
    Replies: 32
    Last Post: 08-30-2010, 04:29 AM
  5. account creation
    By coolv1994 in forum Help
    Replies: 2
    Last Post: 06-29-2010, 12:35 AM
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •