Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > MapleStory
You last visited: Today at 08:37

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Tut]Auto Register

Discussion on [Tut]Auto Register within the MapleStory forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 150
Join Date: Dec 2007
Posts: 1,860
Received Thanks: 567
[Tut]Auto Register

Open Up MySQL Querry Browser.
Click File>NewTab and Execute this file:

ALTER TABLE `accounts` ADD COLUMN `lastknownip` VARCHAR(30) NOT NULL DEFAULT '' AFTER `macs`;

Now, open up Auto-Register.java.
Scroll down until you find this:

private static final boolean autoRegister = true; //enable = true or disable = false

Change it to this if you want to enable Auto-Register

private static final boolean autoRegister = true; //enable = true or disable = true

Go up one line and you'll see

private static final int ACCOUNTS_PER_IP = 1; //change the value to the amount of accounts you want allowed for each ip

Change the 1 to w/e you like. This will allow how many accounts per an IP.

Save like Duh?

Open Up LoginCrypto.java which is in src>net>sf>odinms>client

Hit Ctr + F and put this in:
private static String hexSha1(String in) {

Replace that with :
public static String hexSha1(String in) {

Save obviously.

Now, open LoginPasswordHandler. Which is in src>net>sf>odinms>net>login>handler.

Add this import to it:
import net.sf.odinms.client.AutoRegister;

Then find: loginok = c.login(login, pwd, ipBan || macBan);

Replace it with:

Code:
if (AutoRegister.getAccountExists(login) != false) {
loginok = c.login(login, pwd, ipBan || macBan);
} else if (AutoRegister.autoRegister != false && (!ipBan || !macBan)) {
AutoRegister.createAccount(login, pwd, c.getSession().getRemoteAddress().toString());
if (AutoRegister.success != false) {
loginok = c.login(login, pwd, ipBan || macBan);
}
}

SAVE!!!

Open up MapleClient which is in src>net>sf>odinms>client.

Replace:

public int login(String login, String pwd, boolean ipMacBanned) {
int loginok = 5;
Connection con = DatabaseConnection.getConnection();
try {
PreparedStatement ps = con
.prepareStatement("SELECT id,password,salt,tempban,banned,gm,macs,greason FROM accounts WHERE name = ?");
ps.setString(1, login);
ResultSet rs = ps.executeQuery();
if (rs.next()) {
int banned = rs.getInt("banned");
accId = rs.getInt("id");
int igm = rs.getInt("gm");
String passhash = rs.getString("password");
String salt = rs.getString("salt");
gm = igm > 0;
greason = rs.getByte("greason");
tempban = getTempBanCalendar(rs);
if ((banned == 0 && !ipMacBanned) || banned == -1) {
PreparedStatement ips = con.prepareStatement("INSERT INTO iplog (accountid, ip) VALUES (?, ?)");
ips.setInt(1, accId);
String sockAddr = session.getRemoteAddress().toString();
ips.setString(2, sockAddr.substring(1, sockAddr.lastIndexOf(':')));
ips.executeUpdate();
ips.close();
}

// do NOT track ALL mac addresses ever used
/*String[] macData = rs.getString("macs").split(", ");
for (String mac : macData) {
if (!mac.equals(""))
macs.add(mac);
}*/
ps.close();
// if (gm > 0) {
// session.write(MaplePacketCreator.getAuthSuccessReq uestPin(getAccountName()));
// return finishLogin(true);
// }
if (banned == 1) {
loginok = 3;
} else {
// this is to simplify unbanning
// all known ip and mac bans associated with the current
// client
// will be deleted
if (banned == -1)
unban();
if (getLoginState() > MapleClient.LOGIN_NOTLOGGEDIN) { // already
// loggedin
loggedIn = false;
loginok = 7;
} else {
boolean updatePasswordHash = false;
// Check if the passwords are correct here. :B
if (LoginCryptoLegacy.isLegacyPassword(passhash) && LoginCryptoLegacy.checkPassword(pwd, passhash)) {
// Check if a password upgrade is needed.
loginok = 0;
updatePasswordHash = true;
} else if (salt == null && LoginCrypto.checkSha1Hash(passhash, pwd)) {
loginok = 0;
updatePasswordHash = true;
} else if (LoginCrypto.checkSaltedSha512Hash(passhash, pwd, salt)) {
loginok = 0;
} else {
loggedIn = false;
loginok = 4;
}
if (updatePasswordHash) {
PreparedStatement pss = con.prepareStatement("UPDATE `accounts` SET `password` = ?, `salt` = ? WHERE id = ?");
try {
String newSalt = LoginCrypto.makeSalt();
pss.setString(1, LoginCrypto.makeSaltedSha512Hash(pwd, newSalt));
pss.setString(2, newSalt);
pss.setInt(3, accId);
pss.executeUpdate();
} finally {
pss.close();
}
}
}
}
}
rs.close();
ps.close();
} catch (SQLException e) {
log.error("ERROR", e);
}
return loginok;
}

With:

public int login(String login, String pwd, boolean ipMacBanned) {
int loginok = 5;
Connection con = DatabaseConnection.getConnection();
try {
PreparedStatement ps = con
.prepareStatement("SELECT id,password,salt,tempban,banned,gm,macs,lastknowni p,greason FROM accounts WHERE name = ?");
ps.setString(1, login);
ResultSet rs = ps.executeQuery();
if (rs.next()) {
int banned = rs.getInt("banned");
accId = rs.getInt("id");
int igm = rs.getInt("gm");
String passhash = rs.getString("password");
String salt = rs.getString("salt");
gm = igm > 0;
greason = rs.getByte("greason");
tempban = getTempBanCalendar(rs);
if ((banned == 0 && !ipMacBanned) || banned == -1) {
PreparedStatement ips = con.prepareStatement("INSERT INTO iplog (accountid, ip) VALUES (?, ?)");
ips.setInt(1, accId);
ips.setString(2, session.getRemoteAddress().toString());
ips.executeUpdate();
ips.close();
}

//update the lastknownip for the player on a successful login if the ip changes
if (!rs.getString("lastknownip").equals(session.getRe moteAddress().toString())) {
PreparedStatement lkip = con.prepareStatement("UPDATE accounts SET lastknownip = ? where id = ?");
String sockAddr = session.getRemoteAddress().toString();
lkip.setString(1, sockAddr.substring(1, sockAddr.lastIndexOf(':')));
lkip.setInt(2, accId);
lkip.executeUpdate();
lkip.close();
}

// do NOT track ALL mac addresses ever used
/*String[] macData = rs.getString("macs").split(", ");
for (String mac : macData) {
if (!mac.equals(""))
macs.add(mac);
}*/
ps.close();
// if (gm > 0) {
// session.write(MaplePacketCreator.getAuthSuccessReq uestPin(getAccountName()));
// return finishLogin(true);
// }
if (banned == 1) {
loginok = 3;
} else {
// this is to simplify unbanning
// all known ip and mac bans associated with the current
// client
// will be deleted
if (banned == -1)
unban();
if (getLoginState() > MapleClient.LOGIN_NOTLOGGEDIN) { // already loggedin
loggedIn = false;
loginok = 7;
} else {
boolean updatePasswordHash = false;
// Check if the passwords are correct here. :B
if (LoginCryptoLegacy.isLegacyPassword(passhash) && LoginCryptoLegacy.checkPassword(pwd, passhash)) {
// Check if a password upgrade is needed.
loginok = 0;
updatePasswordHash = true;
} else if (salt == null && LoginCrypto.checkSha1Hash(passhash, pwd)) {
loginok = 0;
updatePasswordHash = true;
} else if (LoginCrypto.checkSaltedSha512Hash(passhash, pwd, salt)) {
loginok = 0;
} else {
loggedIn = false;
loginok = 4;
}
if (updatePasswordHash) {
PreparedStatement pss = con.prepareStatement("UPDATE `accounts` SET `password` = ?, `salt` = ? WHERE id = ?");
try {
String newSalt = LoginCrypto.makeSalt();
pss.setString(1, LoginCrypto.makeSaltedSha512Hash(pwd, newSalt));
pss.setString(2, newSalt);
pss.setInt(3, accId);
pss.executeUpdate();
} finally {
pss.close();
}
}
}
}
}
rs.close();
ps.close();
} catch (SQLException e) {
log.error("ERROR", e);
}
return loginok;
}
Save it!!!
Now, Compile it with w/e you use. NetBeans etc. If you dunno how, Go on my Channel and you'll see a Video called How to Edit GM Hat and Compile etc.

Then it should work perfectly!!!

Enjoy your Server with Non-Registration Page needed.


or i you dont cant do it download it

.SketchBear is offline  
Reply


Similar Threads Similar Threads
[Release]S4 League Auto Register Bot [by StylerKoko]
06/30/2011 - S4 League Hacks, Bots, Cheats & Exploits - 58 Replies
The Bot Video is made by ZeroTheAprendice http://www.youtube.com/watch?v=eyMaMFdMB0I 1.8 UPDATED +Auto Login after Active Code & Multilingual Ein dickes Lob an das Coder Team ! Was ist neu?
[AD] ImpulseMS 500/200/4 Hamachi v62 /Auto Register Need Players & GMs
03/02/2010 - MapleStory - 1 Replies
/
Auto Register...
01/04/2010 - S4 League Hacks, Bots, Cheats & Exploits - 2 Replies
hello can any1 send me the link for dw the auto register program? o_o , or where is the thread ._. i can't find it,sry if this is not here but idk where to post >,<
what about an auto register for SJSRO?
04/17/2009 - SRO Private Server - 8 Replies
Hey,someone can say me if is possible to do an script or a program,to automaticaly get in sjro registration web and put the id,email and pw that u want and create it? :p it could help a lot of people right? :S



All times are GMT +2. The time now is 08:37.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.