Adding proper credits system
Added a script for visually improving credit view. Tracked back the server sources before with respective owners. It possibly still needs to be updated.
This commit is contained in:
@@ -198,7 +198,7 @@ function writeSolaxiaCommandsLv0() { //Common
|
|||||||
|
|
||||||
addCommand("commands", "");
|
addCommand("commands", "");
|
||||||
addCommand("time", "");
|
addCommand("time", "");
|
||||||
addCommand("staff", "");
|
addCommand("credits", "");
|
||||||
addCommand("uptime", "");
|
addCommand("uptime", "");
|
||||||
addCommand("gacha", "");
|
addCommand("gacha", "");
|
||||||
addCommand("whatdropsfrom", "");
|
addCommand("whatdropsfrom", "");
|
||||||
|
|||||||
138
scripts/npc/credits.js
Normal file
138
scripts/npc/credits.js
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
/* @Author Ronan
|
||||||
|
Name: Heracle
|
||||||
|
Map(s): Guild Headquarters
|
||||||
|
Info: Hall of Fame
|
||||||
|
Script: credits.js
|
||||||
|
*/
|
||||||
|
|
||||||
|
var status;
|
||||||
|
|
||||||
|
var name_tree = [];
|
||||||
|
var role_tree = [];
|
||||||
|
var name_cursor, role_cursor;
|
||||||
|
|
||||||
|
var servers = ["HeavenMS", "MapleSolaxia", "MoopleDEV", "MetroMS", "BubblesDEV", "ThePackII", "OdinMS"];
|
||||||
|
var servers_history = [];
|
||||||
|
|
||||||
|
function addPerson(name, role) {
|
||||||
|
name_cursor.push(name);
|
||||||
|
role_cursor.push(role);
|
||||||
|
}
|
||||||
|
|
||||||
|
function setHistory(from, to) {
|
||||||
|
servers_history.push([from, to]);
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeServerStaff_HeavenMS() {
|
||||||
|
addPerson("Ronan", "Developer");
|
||||||
|
addPerson("Vcoc", "Freelance Developer");
|
||||||
|
|
||||||
|
setHistory(2015, 2017);
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeServerStaff_MapleSolaxia() {
|
||||||
|
addPerson("Aria", "Administrator");
|
||||||
|
addPerson("Twdtwd", "Administrator");
|
||||||
|
addPerson("Exorcist", "Developer");
|
||||||
|
addPerson("SharpAceX", "Developer");
|
||||||
|
addPerson("Zygon", "Freelance Developer");
|
||||||
|
addPerson("SourMjolk", "Game Master");
|
||||||
|
addPerson("Kanade", "Game Master");
|
||||||
|
addPerson("Kitsune", "Game Master");
|
||||||
|
|
||||||
|
setHistory(2014, 2015);
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeServerStaff_MoopleDEV() {
|
||||||
|
addPerson("kevintjuh93", "Developer");
|
||||||
|
setHistory(2010, 2010);
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeServerStaff_MetroMS() {
|
||||||
|
addPerson("Moongra", "Developer");
|
||||||
|
setHistory(2009, 2010);
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeServerStaff_BubblesDEV() {
|
||||||
|
addPerson("Deagan", "Developer");
|
||||||
|
setHistory(2009, 2009);
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeServerStaff_ThePackII() {
|
||||||
|
addPerson("Hofer", "Developer");
|
||||||
|
setHistory(2008, 2009);
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeServerStaff_OdinMS() {
|
||||||
|
addPerson("Serpendiem", "Developer");
|
||||||
|
setHistory(2007, 2008);
|
||||||
|
}
|
||||||
|
|
||||||
|
function writeAllServerStaffs() {
|
||||||
|
for(var i = 0; i < servers.length; i++) {
|
||||||
|
name_cursor = [];
|
||||||
|
role_cursor = [];
|
||||||
|
|
||||||
|
var srvName = servers[i];
|
||||||
|
eval("writeServerStaff_" + srvName)(); // make sure the server names are lexicograffically EQUALS to the correspondent function.
|
||||||
|
|
||||||
|
name_tree.push(name_cursor);
|
||||||
|
role_tree.push(role_cursor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function start() {
|
||||||
|
status = -1;
|
||||||
|
writeAllServerStaffs();
|
||||||
|
action(1, 0, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
function action(mode, type, selection) {
|
||||||
|
if (mode == -1) {
|
||||||
|
cm.dispose();
|
||||||
|
} else {
|
||||||
|
if (mode == 0 && type > 0) {
|
||||||
|
cm.dispose();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (mode == 1)
|
||||||
|
status++;
|
||||||
|
else
|
||||||
|
status--;
|
||||||
|
|
||||||
|
if (status == 0) {
|
||||||
|
var sendStr = "There is the history tree of all participating parties on the build of this server:\r\n\r\n";
|
||||||
|
for(var i = 0; i < servers.length; i++) {
|
||||||
|
var hist = servers_history[i];
|
||||||
|
|
||||||
|
if(hist.length > 0) {
|
||||||
|
sendStr += "#L" + i + "##b" + servers[i] + "#k -- " + ((hist[0] != hist[1]) ? hist[0] + " ~ " + hist[1] : hist[0]) + "#l\r\n";
|
||||||
|
} else {
|
||||||
|
sendStr += "#L" + i + "#" + servers[i] + "#l\r\n";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
cm.sendSimple(sendStr);
|
||||||
|
} else if(status == 1) {
|
||||||
|
var lvName, lvRole;
|
||||||
|
|
||||||
|
for(var i = 0; i < servers.length; i++) {
|
||||||
|
if(selection == i) {
|
||||||
|
lvName = name_tree[i];
|
||||||
|
lvRole = role_tree[i];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var sendStr = "The staff of #b" + servers[selection] + "#k:\r\n\r\n";
|
||||||
|
for(var i = 0; i < lvName.length; i++) {
|
||||||
|
sendStr += " #L" + i + "# " + lvName[i] + " - " + lvRole[i];
|
||||||
|
sendStr += "#l\r\n";
|
||||||
|
}
|
||||||
|
|
||||||
|
cm.sendPrev(sendStr);
|
||||||
|
} else {
|
||||||
|
cm.dispose();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -532,7 +532,7 @@ public class MapleClient {
|
|||||||
if (getLoginState() > LOGIN_NOTLOGGEDIN) { // already loggedin
|
if (getLoginState() > LOGIN_NOTLOGGEDIN) { // already loggedin
|
||||||
loggedIn = false;
|
loggedIn = false;
|
||||||
loginok = 7;
|
loginok = 7;
|
||||||
} else if (pwd.charAt(0) == '$' && pwd.charAt(1) == '2' && BCrypt.checkpw(pwd, passhash)) {
|
} else if (passhash.charAt(0) == '$' && passhash.charAt(1) == '2' && BCrypt.checkpw(pwd, passhash)) {
|
||||||
loginok = (tos == 0) ? 23 : 0;
|
loginok = (tos == 0) ? 23 : 0;
|
||||||
} else if (pwd.equals(passhash) || checkHash(passhash, "SHA-1", pwd) || checkHash(passhash, "SHA-512", pwd + salt)) {
|
} else if (pwd.equals(passhash) || checkHash(passhash, "SHA-1", pwd) || checkHash(passhash, "SHA-512", pwd + salt)) {
|
||||||
loginok = (tos == 0) ? -23 : -10; // migrate to bcrypt
|
loginok = (tos == 0) ? -23 : -10; // migrate to bcrypt
|
||||||
|
|||||||
@@ -356,20 +356,9 @@ public class Commands {
|
|||||||
player.yellowMessage("Solaxia Server Time: " + dateFormat.format(new Date()));
|
player.yellowMessage("Solaxia Server Time: " + dateFormat.format(new Date()));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "credits":
|
||||||
case "staff":
|
case "staff":
|
||||||
player.yellowMessage("HeavenMS (MapleSolaxiaV2) Staff");
|
c.getAbstractPlayerInteraction().openNpc(2010007, "credits");
|
||||||
player.yellowMessage("Ronan - Developer");
|
|
||||||
player.yellowMessage("Vcoc - Freelance Developer");
|
|
||||||
player.yellowMessage("");
|
|
||||||
player.yellowMessage("MapleSolaxia Staff");
|
|
||||||
player.yellowMessage("Aria - Administrator");
|
|
||||||
player.yellowMessage("Twdtwd - Administrator");
|
|
||||||
player.yellowMessage("Exorcist - Developer");
|
|
||||||
player.yellowMessage("SharpAceX - Developer");
|
|
||||||
player.yellowMessage("Zygon - Freelance Developer");
|
|
||||||
player.yellowMessage("SourMjolk - Game Master");
|
|
||||||
player.yellowMessage("Kanade - Game Master");
|
|
||||||
player.yellowMessage("Kitsune - Game Master");
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "lastrestart":
|
case "lastrestart":
|
||||||
|
|||||||
@@ -48,7 +48,6 @@ public final class LoginPasswordHandler implements MaplePacketHandler {
|
|||||||
|
|
||||||
String login = slea.readMapleAsciiString();
|
String login = slea.readMapleAsciiString();
|
||||||
String pwd = slea.readMapleAsciiString();
|
String pwd = slea.readMapleAsciiString();
|
||||||
String bcryptedpass = BCrypt.hashpw(pwd, BCrypt.gensalt(12));
|
|
||||||
c.setAccountName(login);
|
c.setAccountName(login);
|
||||||
|
|
||||||
int loginok = c.login(login, pwd);
|
int loginok = c.login(login, pwd);
|
||||||
@@ -61,7 +60,7 @@ public final class LoginPasswordHandler implements MaplePacketHandler {
|
|||||||
con = DatabaseConnection.getConnection();
|
con = DatabaseConnection.getConnection();
|
||||||
ps = con.prepareStatement("INSERT INTO accounts (name, password) VALUES (?, ?);");
|
ps = con.prepareStatement("INSERT INTO accounts (name, password) VALUES (?, ?);");
|
||||||
ps.setString(1, login);
|
ps.setString(1, login);
|
||||||
ps.setString(2, bcryptedpass);
|
ps.setString(2, BCrypt.hashpw(pwd, BCrypt.gensalt(12)));
|
||||||
ps.executeUpdate();
|
ps.executeUpdate();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -75,7 +74,7 @@ public final class LoginPasswordHandler implements MaplePacketHandler {
|
|||||||
try {
|
try {
|
||||||
con = DatabaseConnection.getConnection();
|
con = DatabaseConnection.getConnection();
|
||||||
ps = con.prepareStatement("UPDATE accounts SET password = ? WHERE name = ?;");
|
ps = con.prepareStatement("UPDATE accounts SET password = ? WHERE name = ?;");
|
||||||
ps.setString(1, bcryptedpass);
|
ps.setString(1, BCrypt.hashpw(pwd, BCrypt.gensalt(12)));
|
||||||
ps.setString(2, login);
|
ps.setString(2, login);
|
||||||
ps.executeUpdate();
|
ps.executeUpdate();
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
|
|||||||
Reference in New Issue
Block a user