Remove configurable language feature

This commit is contained in:
P0nk
2024-09-14 15:34:01 +02:00
parent 4778482cdd
commit f8726640c3
10 changed files with 54 additions and 205 deletions

View File

@@ -7074,7 +7074,6 @@ public class Character extends AbstractCharacterObject {
retClient.setAccountName(rs.getString("name"));
retClient.setCharacterSlots(rs.getByte("characterslots"));
retClient.setLanguage(rs.getInt("language")); // thanks Zein for noticing user language not overriding default once player is in-game
}
}
}
@@ -11082,23 +11081,6 @@ public class Character extends AbstractCharacterObject {
return this.ariantPoints;
}
public void setLanguage(int num) {
getClient().setLanguage(num);
try (Connection con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("UPDATE accounts SET language = ? WHERE id = ?")) {
ps.setInt(1, num);
ps.setInt(2, getClient().getAccID());
ps.executeUpdate();
} catch (SQLException e) {
e.printStackTrace();
}
}
public int getLanguage() {
return getClient().getLanguage();
}
public boolean isChasing() {
return chasing;
}

View File

@@ -129,7 +129,6 @@ public class Client extends ChannelInboundHandlerAdapter {
private Calendar tempBanCalendar;
private long lastNpcClick;
private long lastPacket = System.currentTimeMillis();
private int lang = 0;
public enum Type {
LOGIN,
@@ -523,7 +522,7 @@ public class Client extends ChannelInboundHandlerAdapter {
}
try (Connection con = DatabaseConnection.getConnection();
PreparedStatement ps = con.prepareStatement("SELECT id, password, gender, banned, pin, pic, characterslots, tos, language FROM accounts WHERE name = ?")) {
PreparedStatement ps = con.prepareStatement("SELECT id, password, gender, banned, pin, pic, characterslots, tos FROM accounts WHERE name = ?")) {
ps.setString(1, login);
try (ResultSet rs = ps.executeQuery()) {
@@ -541,7 +540,6 @@ public class Client extends ChannelInboundHandlerAdapter {
pic = rs.getString("pic");
gender = rs.getByte("gender");
characterSlots = rs.getByte("characterslots");
lang = rs.getInt("language");
String passhash = rs.getString("password");
byte tos = rs.getByte("tos");
@@ -1125,12 +1123,4 @@ public class Client extends ChannelInboundHandlerAdapter {
public boolean canBypassPic() {
return LoginBypassCoordinator.getInstance().canLoginBypass(hwid, accId, true);
}
public int getLanguage() {
return lang;
}
public void setLanguage(int lingua) {
this.lang = lingua;
}
}

View File

@@ -24,7 +24,6 @@
package client.command;
import client.Client;
import client.command.commands.gm0.ChangeLanguageCommand;
import client.command.commands.gm0.DisposeCommand;
import client.command.commands.gm0.DropLimitCommand;
import client.command.commands.gm0.EnableAuthCommand;
@@ -345,7 +344,6 @@ public class CommandsExecutor {
addCommand("uptime", UptimeCommand.class);
addCommand("gacha", GachaCommand.class);
addCommand("dispose", DisposeCommand.class);
addCommand("changel", ChangeLanguageCommand.class);
addCommand("equiplv", EquipLvCommand.class);
addCommand("showrates", ShowRatesCommand.class);
addCommand("rates", RatesCommand.class);

View File

@@ -1,43 +0,0 @@
/*
This file is part of the HeavenMS MapleStory Server, commands OdinMS-based
Copyleft (L) 2016 - 2019 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.Client;
import client.command.Command;
import client.command.CommandContext;
public class ChangeLanguageCommand extends Command {
{
setDescription("Change language settings.");
}
@Override
public void execute(Client c, String[] params, CommandContext ctx) {
if (params.length < 1) {
c.getPlayer().yellowMessage("Syntax: !changel <0=ptb, 1=esp, 2=eng>");
return;
}
c.setLanguage(Integer.parseInt(params[0]));
}
}