Merge branch 'pr/427'
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -124,6 +124,7 @@ public class MapleClient {
|
||||
private int visibleWorlds;
|
||||
private long lastNpcClick;
|
||||
private long sessionId;
|
||||
private int lingua = 0;
|
||||
|
||||
static {
|
||||
for (int i = 0; i < 200; i++) {
|
||||
@@ -269,8 +270,9 @@ public class MapleClient {
|
||||
}
|
||||
|
||||
public boolean hasBannedHWID() {
|
||||
if(hwid == null)
|
||||
return false;
|
||||
if(hwid == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean ret = false;
|
||||
PreparedStatement ps = null;
|
||||
@@ -509,7 +511,9 @@ public class MapleClient {
|
||||
}
|
||||
|
||||
public boolean checkPic(String other) {
|
||||
if(!(ServerConstants.ENABLE_PIC && !canBypassPic())) return true;
|
||||
if (!(ServerConstants.ENABLE_PIC && !canBypassPic())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
picattempt++;
|
||||
if (picattempt > 5) {
|
||||
@@ -538,7 +542,7 @@ public class MapleClient {
|
||||
ResultSet rs = null;
|
||||
try {
|
||||
con = DatabaseConnection.getConnection();
|
||||
ps = con.prepareStatement("SELECT id, password, gender, banned, pin, pic, characterslots, tos FROM accounts WHERE name = ?");
|
||||
ps = con.prepareStatement("SELECT id, password, gender, banned, pin, pic, characterslots, tos, lingua FROM accounts WHERE name = ?");
|
||||
ps.setString(1, login);
|
||||
rs = ps.executeQuery();
|
||||
if (rs.next()) {
|
||||
@@ -556,6 +560,7 @@ public class MapleClient {
|
||||
pic = rs.getString("pic");
|
||||
gender = rs.getByte("gender");
|
||||
characterSlots = rs.getByte("characterslots");
|
||||
lingua = rs.getInt("lingua");
|
||||
String passhash = rs.getString("password");
|
||||
byte tos = rs.getByte("tos");
|
||||
|
||||
@@ -888,6 +893,10 @@ public class MapleClient {
|
||||
if (eim != null) {
|
||||
eim.playerDisconnected(player);
|
||||
}
|
||||
|
||||
if (player.getMonsterCarnival() != null) {
|
||||
player.getMonsterCarnival().playerDisconnected(getPlayer().getId());
|
||||
}
|
||||
}
|
||||
|
||||
if (player.getMap() != null) {
|
||||
@@ -985,7 +994,9 @@ public class MapleClient {
|
||||
FilePrinter.printError(FilePrinter.ACCOUNT_STUCK, e);
|
||||
} finally {
|
||||
if (!this.serverTransition) {
|
||||
if(chrg != null) chrg.setCharacter(null);
|
||||
if(chrg != null) {
|
||||
chrg.setCharacter(null);
|
||||
}
|
||||
wserv.removePlayer(player);
|
||||
//getChannelServer().removePlayer(player); already being done
|
||||
|
||||
@@ -1533,4 +1544,12 @@ public class MapleClient {
|
||||
public boolean canBypassPic() {
|
||||
return MapleLoginBypassCoordinator.getInstance().canLoginBypass(getNibbleHWID(), accId, true);
|
||||
}
|
||||
}
|
||||
|
||||
public int getLingua() {
|
||||
return lingua;
|
||||
}
|
||||
|
||||
public void setLingua(int lingua) {
|
||||
this.lingua = lingua;
|
||||
}
|
||||
}
|
||||
@@ -21,34 +21,34 @@
|
||||
*/
|
||||
package client;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import tools.Randomizer;
|
||||
|
||||
public enum MapleDisease {
|
||||
NULL(0x0),
|
||||
SLOW(0x1),
|
||||
SEDUCE(0x80),
|
||||
SLOW(0x1, 126),
|
||||
SEDUCE(0x80, 128),
|
||||
FISHABLE(0x100),
|
||||
ZOMBIFY(0x4000),
|
||||
CONFUSE(0x80000),
|
||||
STUN(0x2000000000000L),
|
||||
POISON(0x4000000000000L),
|
||||
SEAL(0x8000000000000L),
|
||||
DARKNESS(0x10000000000000L),
|
||||
WEAKEN(0x4000000000000000L),
|
||||
CURSE(0x8000000000000000L);
|
||||
STUN(0x2000000000000L, 123),
|
||||
POISON(0x4000000000000L, 125),
|
||||
SEAL(0x8000000000000L, 120),
|
||||
DARKNESS(0x10000000000000L, 121),
|
||||
WEAKEN(0x4000000000000000L, 122),
|
||||
CURSE(0x8000000000000000L, 124);
|
||||
|
||||
private long i;
|
||||
private boolean first;
|
||||
private int disease;
|
||||
|
||||
private MapleDisease(long i) {
|
||||
this.i = i;
|
||||
this.first = false;
|
||||
}
|
||||
|
||||
private MapleDisease(long i, boolean first) {
|
||||
private MapleDisease(long i, int disease) {
|
||||
this.i = i;
|
||||
this.first = first;
|
||||
this.disease = disease;
|
||||
}
|
||||
|
||||
public long getValue() {
|
||||
@@ -58,6 +58,10 @@ public enum MapleDisease {
|
||||
public boolean isFirst() {
|
||||
return first;
|
||||
}
|
||||
|
||||
public int getDisease() {
|
||||
return disease;
|
||||
}
|
||||
|
||||
public static MapleDisease ordinal(int ord) {
|
||||
try {
|
||||
@@ -66,4 +70,24 @@ public enum MapleDisease {
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
public static final MapleDisease getRandom() {
|
||||
while (true) {
|
||||
for (MapleDisease dis : MapleDisease.values()) {
|
||||
if (Randomizer.nextInt(MapleDisease.values().length) == 0) {
|
||||
return dis;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static final MapleDisease getBySkill(final int skill) {
|
||||
for (MapleDisease d : MapleDisease.values()) {
|
||||
if (d.getDisease() == skill && d.getDisease() != 0) {
|
||||
return d;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -186,6 +186,7 @@ public class CommandsExecutor {
|
||||
addCommand("uptime", UptimeCommand.class);
|
||||
addCommand("gacha", GachaCommand.class);
|
||||
addCommand("dispose", DisposeCommand.class);
|
||||
addCommand("changel", ChangeLinguaCommand.class);
|
||||
addCommand("equiplv", EquipLvCommand.class);
|
||||
addCommand("showrates", ShowRatesCommand.class);
|
||||
addCommand("rates", RatesCommand.class);
|
||||
|
||||
42
src/client/command/commands/gm0/ChangeLinguaCommand.java
Normal file
42
src/client/command/commands/gm0/ChangeLinguaCommand.java
Normal file
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
This file is part of the HeavenMS MapleStory Server, commands OdinMS-based
|
||||
Copyleft (L) 2016 - 2018 RonanLana
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation version 3 as published by
|
||||
the Free Software Foundation. You may not use, modify or distribute
|
||||
this program under any other version of the GNU Affero General Public
|
||||
License.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/*
|
||||
@Author: Arthur L - Refactored command content into modules
|
||||
*/
|
||||
package client.command.commands.gm0;
|
||||
|
||||
import client.command.Command;
|
||||
import client.MapleClient;
|
||||
|
||||
public class ChangeLinguaCommand extends Command {
|
||||
{
|
||||
setDescription("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void execute(MapleClient c, String[] params) {
|
||||
if (params.length < 1) {
|
||||
c.getPlayer().yellowMessage("Syntax: !changel <0=ptb, 1=esp, 2=eng>");
|
||||
return;
|
||||
}
|
||||
c.setLingua(Integer.parseInt(params[0]));
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ import tools.MaplePacketCreator;
|
||||
import java.awt.*;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import tools.packets.Wedding;
|
||||
|
||||
public class DebugCommand extends Command {
|
||||
private final static String debugTypes[] = {"monster", "packet", "portal", "spawnpoint", "pos", "map", "mobsp", "event", "areas", "reactors", "servercoupons", "playercoupons", "timer", "marriage", ""};
|
||||
|
||||
Reference in New Issue
Block a user