Sparks' v.59 Pin System (Odin)

Page 1 of 3 123 LastLast
Results 1 to 15 of 37
  1. #1
    Account Upgraded | Title Enabled! weaxer is offline
    MemberRank
    Oct 2006 Join Date
    SwedenLocation
    853Posts

    Sparks' v.59 Pin System (Odin)

    Once again: This is not mine, I do not take any credits for this (more than releasing it on RaGEZONE). I was asked by Sparks to release it for him. All credits to Sparks for writing and creating what's below. Also: This is compatible with OdinTeh.

    Well guys I finally got it working.
    I give you full permission to release this anywhere else AS LONG AS YOU GIVE CREDIT.
    Credits to Vana for their v.59 Pin Packets.

    Before you start it's very important that you add this:
    http://forum.ragezone.com/showthread...74#post3963574


    Here we go.

    First add this table to your SQL.


    PHP Code:
    ALTER TABLE `accountsADD COLUMN `pinint(4NOT NULL default '0'
    Then. In MapleClient.java

    Find:

    PHP Code:
    private int status 0
    Add below it:

    PHP Code:
    private String pin
    Find:

    PHP Code:
    private boolean autoCreate Boolean.parseBoolean(props.getProperty("net.sf.odinms.world.morethanone""false")); 
    Add below it:

    PHP Code:
    private boolean  pinActivate Boolean.parseBoolean(props.getProperty("net.sf.odinms.world.pinactivate""false")); 
    Find:

    PHP Code:
    .prepareStatement("SELECT id,password,salt,tempban,banned,gm,macs,greason,gender FROM accounts WHERE name = ?"); 
    Replace it with:

    PHP Code:
    .prepareStatement("SELECT id,password,salt,tempban,banned,gm,macs,greason,gender,pin FROM accounts WHERE name = ?"); 
    Find:

    PHP Code:
    tempban getTempBanCalendar(rs); 
    Add bellow it:

    PHP Code:
                                    gender rs.getInt("gender");
                                    if (
    gender != || gender != 1) {
                                        
    setStatus(1);
                                    }
                                    else {
                                        if (
    rs.getString("pin") == null) {
                                            
    setStatus(2);
                                        }
                                        else 
                                           
    pin rs.getString("pin");
                                    } 
    Find:

    PHP Code:
            public void setStatus(int status) {
                
    this.status status;
            } 
    Add bellow it:

    PHP Code:
            public int getPin() {
                return 
    Integer.parseInt(this.pin);
            }
            
            public 
    void setPin(int pin) {
                
    this.pin String.valueOf(pin);
            } 
    Now open notepad and make a new Java file. Name it RegisterPinHandler.java.
    Add all of this in it.

    PHP Code:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */

    package net.sf.odinms.net.login.handler;

    import java.sql.Connection;
    import java.sql.PreparedStatement;
    import java.sql.SQLException;
    import net.sf.odinms.client.MapleClient;
    import net.sf.odinms.net.AbstractMaplePacketHandler;
    import net.sf.odinms.tools.data.input.SeekableLittleEndianAccessor;
    import net.sf.odinms.database.DatabaseConnection;
    import net.sf.odinms.tools.MaplePacketCreator;
    import org.slf4j.Logger;
    import org.slf4j.LoggerFactory;
    /**
     *
     * @author akakori
     */
    public class RegisterPinHandler extends AbstractMaplePacketHandler {
        private static final 
    Logger log LoggerFactory.getLogger(MapleClient.class);
        @
    Override
            
    public void handlePacket(SeekableLittleEndianAccessor sleaMapleClient c) {
                if(
    c.status() != 2)
                    
    //hacking
                    
    return;
                if (
    slea.readByte() == 0x00) {
                    if (
    c.getPin() == -1) {
                        
    c.setStatus(2);
                }
                    
    int pin Integer.parseInt(slea.readMapleAsciiString());
                    
    Connection con DatabaseConnection.getConnection();
            
    PreparedStatement ps;
                    try {
                        
    ps con.prepareStatement("update accounts set pin = ? where id = ?");
                        
    ps.setInt(1pin);
                        
    ps.setInt(2c.getAccID());
                        
    ps.executeUpdate();
                        
    ps.close();
                        
    //c.setStatus(2);
            
    } catch (SQLException e) {
                
    log.error("ERROR"e);
            }
                    
    c.getSession().write(MaplePacketCreator.getPinAssgined());
                }
            }

    Put it in your net.sf.odinms.net.login.handler folder.

    In your PacketProcessor.java

    Find:

    PHP Code:
    import net.sf.odinms.net.channel.handler.ReportHandler
    Add this bellow it:

    PHP Code:
    import net.sf.odinms.net.login.handler.RegisterPinHandler;
    import net.sf.odinms.net.login.handler.SetGenderHandler
    Find:

    PHP Code:
    registerHandler(RecvPacketOpcode.SET_GENDER, new SetGenderHandler()); 
    Add this bellow it:

    PHP Code:
    registerHandler(RecvPacketOpcode.REGISTER_PIN, new RegisterPinHandler()); 
    Now open your SendPacketOpcode.java.

    Find:

    PHP Code:
    GENDER_SET
    Add bellow:

    PHP Code:
    PIN_ASSIGNED
    Now in your RecvPacketOpcode.java.

    Find:

    PHP Code:
    SET_GENDER
    Add bellow it:

    PHP Code:
    REGISTER_PIN
    Now open MaplePacketCreator.java.

    Find:

    PHP Code:
    /**
          * Gets a successful authentication and PIN Request packet. 
    Add ABOVE It with a space in between the both add:

    PHP Code:
            public static MaplePacket getPinAssgined() {
                
    MaplePacketLittleEndianWriter mplew = new MaplePacketLittleEndianWriter();
                
    mplew.writeShort(SendPacketOpcode.PIN_ASSIGNED.getValue());
                
    mplew.write(0);
                return 
    mplew.getPacket();
            } 
    Now open AfterLoginHandler.java.

    Find:

    PHP Code:
    // Official requests the pin here - but pins suck so we just accept 
    Add bellow it:

    PHP Code:
                        if(c.getPinActivate())
                        
    c.getSession().write(MaplePacketCreator.requestPin());
                        else 
    Find:

    PHP Code:
    if (pin.equals("1234")) { 
    Replace it with:

    PHP Code:
    if (Integer.parseInt(pin) == c.getPin()) { 
    Now open up your SetGenderHandler.java Which you created for Kori's Gender Selection.

    Find:

    PHP Code:
    @author Compaq_Owner 
    Replace it with:

    PHP Code:
    @author akakori 
    Now open recvops.properties.

    Find:

    PHP Code:
    SET_GENDER CHAR_SELECT 1 
    Add bellow it:

    PHP Code:
    REGISTER_PIN 0x0a 
    Open up sendops.properties.

    Find:

    PHP Code:
    GENDER_SET PIN_OPERATION 1 
    Add bellow:

    PHP Code:
    PIN_ASSIGNED 0x07 
    Lastly. Go to your world.properties.

    Find:

    PHP Code:
    net.sf.odinms.channel.events=lolcastle,3rdjob,ZakumPQ,KerningPQ 
    Add bellow it:

    PHP Code:
    # activate log with pins
    net.sf.odinms.world.pinactivate false
    # activate in-game account creation
    net.sf.odinms.world.autocreate false 
    Done.
    And if you want to have this for your 0.55 server, go here: http://www.evo-networks.net/index.php?showtopic=57


    Remember Evo-Networks is the place to be :P
    Last edited by weaxer; 24-08-08 at 08:36 PM.


  2. #2
    Member MapleAsia is offline
    MemberRank
    Aug 2008 Join Date
    57Posts

    Re: [Release] Sparks' v.59 Pin System (Odin)

    Hey, What This Pin System For?

  3. #3
    Account Upgraded | Title Enabled! Commie is offline
    MemberRank
    Jul 2008 Join Date
    The Coop.Location
    1,133Posts

    Re: [Release] Sparks' v.59 Pin System (Odin)

    Pins kind of suck because that's how I lose all my old accounts on gMS...

    Anyways, this is a good release as long as the person using has some way for the user to retrieve his/her pin.

  4. #4
    Valued Member thedarkop is offline
    MemberRank
    Jun 2008 Join Date
    WHAT STALKER j/kLocation
    120Posts

    Re: [Release] Sparks' v.59 Pin System (Odin)

    is there a way to get this to work for v 55?
    O.O

  5. #5
    Member MapleAsia is offline
    MemberRank
    Aug 2008 Join Date
    57Posts

    Re: [Release] Sparks' v.59 Pin System (Odin)

    Quote Originally Posted by Commie View Post
    Pins kind of suck because that's how I lose all my old accounts on gMS...

    Anyways, this is a good release as long as the person using has some way for the user to retrieve his/her pin.
    So Its Mean That? All Gm login Time Must Enter pin code ?

    Example Like Real Maple?

  6. #6
    Account Upgraded | Title Enabled! weaxer is offline
    MemberRank
    Oct 2006 Join Date
    SwedenLocation
    853Posts

    Re: [Release] Sparks' v.59 Pin System (Odin)

    Quote Originally Posted by thedarkop View Post
    is there a way to get this to work for v 55?
    O.O
    There is already a v55 pin system released by Sparks. Go look for it.

    And for those who don't know, this compatible with OdinTeh.

  7. #7
    Valued Member dir3 is offline
    MemberRank
    Apr 2008 Join Date
    IsraelLocation
    147Posts

    Re: [Release] Sparks' v.59 Pin System (Odin)

    about to test.


    *on first thing theres no such thing named as u wrote it.*

  8. #8
    Member MapleAsia is offline
    MemberRank
    Aug 2008 Join Date
    57Posts

    Re: [Release] Sparks' v.59 Pin System (Odin)

    Quote Originally Posted by weaxer View Post
    There is already a v55 pin system released by Sparks. Go look for it.

    And for those who don't know, this compatible with OdinTeh.
    Do YOu Have Any SS ? That Pin System work?

  9. #9
    Account Upgraded | Title Enabled! weaxer is offline
    MemberRank
    Oct 2006 Join Date
    SwedenLocation
    853Posts

    Re: [Release] Sparks' v.59 Pin System (Odin)

    Quote Originally Posted by MapleAsia View Post
    Do YOu Have Any SS ? That Pin System work?
    No. Bring your lazy ass and go test it yourself :]

  10. #10
    Member MapleAsia is offline
    MemberRank
    Aug 2008 Join Date
    57Posts

    Re: [Release] Sparks' v.59 Pin System (Odin)

    i am Not lazy... i just dono what this work for? =.='~

  11. #11
    Member TookTook123 is offline
    MemberRank
    Aug 2008 Join Date
    89Posts

    Re: [Release] Sparks' v.59 Pin System (Odin)

    *Remember this runs off Akakori's Gender Script*
    and where i can get this script?

  12. #12
    You've got my respect! Traitor is offline
    MemberRank
    Apr 2008 Join Date
    Portland,OregonLocation
    959Posts

    Re: [Release] Sparks' v.59 Pin System (Odin)

    Quote Originally Posted by MapleAsia View Post
    Do YOu Have Any SS ? That Pin System work?
    Why would he need to provide screenshots for the PIN system

  13. #13
    Valued Member dir3 is offline
    MemberRank
    Apr 2008 Join Date
    IsraelLocation
    147Posts

    Re: [Release] Sparks' v.59 Pin System (Odin)

    Where can i get Akakuri's Gender Script?

  14. #14
    Account Upgraded | Title Enabled! weaxer is offline
    MemberRank
    Oct 2006 Join Date
    SwedenLocation
    853Posts

    Re: [Release] Sparks' v.59 Pin System (Odin)

    Quote Originally Posted by MapleAsia View Post
    i am Not lazy... i just dono what this work for? =.='~
    Scroll up to the beginning of this thread, I wrote it there with size 4 bold text: OdinTeh v.59.

  15. #15
    Member MapleAsia is offline
    MemberRank
    Aug 2008 Join Date
    57Posts

    Re: [Release] Sparks' v.59 Pin System (Odin)

    Quote Originally Posted by weaxer View Post
    Scroll up to the beginning of this thread, I wrote it there with size 4 bold text: OdinTeh v.59.
    okay =P



Page 1 of 3 123 LastLast

Advertisement