Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38eecd0db7 | ||
|
|
e320bafa8b | ||
|
|
754e5e61f2 | ||
|
|
afba85827a | ||
|
|
8cd5211b8b | ||
|
|
2d7525f2b4 | ||
|
|
7adb25888f | ||
|
|
b46912afcb | ||
|
|
83e436bbd2 |
@@ -19993,7 +19993,7 @@ USE `cosmic`;
|
||||
(8220015, 1452015, 1, 1, 0, 22000),
|
||||
(8220015, 1472031, 1, 1, 0, 22000),
|
||||
(8220015, 1482010, 1, 1, 0, 22000),
|
||||
(2110301, 4031568, 1, 1, 3911, 80000),
|
||||
(2100108, 4031568, 1, 1, 3911, 80000),
|
||||
(9300150, 4031774, 1, 1, 3361, 100000),
|
||||
(9300150, 4031796, 1, 1, 3362, 100000),
|
||||
(9300105, 4001118, 1, 1, 3814, 200000),
|
||||
|
||||
@@ -335,7 +335,7 @@ INSERT INTO `shopitems` ( `shopid`, `itemid`, `price`, `pitch`, `position`) VALU
|
||||
(1301000, 2000006, 620, 0, 156),
|
||||
(1301000, 2000003, 200, 0, 160),
|
||||
(1301000, 2000002, 320, 0, 164),
|
||||
(1301000, 2000015, 160, 0, 168),
|
||||
(1301000, 2000001, 160, 0, 168),
|
||||
(1301000, 2000000, 50, 0, 172);
|
||||
|
||||
# adding missing pirate items at Singapore npc's
|
||||
|
||||
@@ -39,7 +39,6 @@ import net.server.Server;
|
||||
import net.server.channel.Channel;
|
||||
import net.server.coordinator.login.LoginBypassCoordinator;
|
||||
import net.server.coordinator.session.Hwid;
|
||||
import net.server.coordinator.session.IpAddresses;
|
||||
import net.server.coordinator.session.SessionCoordinator;
|
||||
import net.server.coordinator.session.SessionCoordinator.AntiMulticlientResult;
|
||||
import net.server.guild.Guild;
|
||||
@@ -176,10 +175,7 @@ public class Client extends ChannelInboundHandlerAdapter {
|
||||
private static String getRemoteAddress(io.netty.channel.Channel channel) {
|
||||
String remoteAddress = "null";
|
||||
try {
|
||||
String hostAddress = ((InetSocketAddress) channel.remoteAddress()).getAddress().getHostAddress();
|
||||
if (hostAddress != null) {
|
||||
remoteAddress = IpAddresses.evaluateRemoteAddress(hostAddress); // thanks dyz for noticing Local/LAN/WAN connections not interacting properly
|
||||
}
|
||||
remoteAddress = ((InetSocketAddress) channel.remoteAddress()).getAddress().getHostAddress();
|
||||
} catch (NullPointerException npe) {
|
||||
log.warn("Unable to get remote address for client", npe);
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class KarmaManipulator {
|
||||
flag ^= karmaFlag;
|
||||
flag |= ItemConstants.UNTRADEABLE;
|
||||
|
||||
item.setFlag((byte) flag);
|
||||
item.setFlag(flag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -53,6 +53,6 @@ public class KarmaManipulator {
|
||||
|
||||
flag |= karmaFlag;
|
||||
flag &= (0xFFFFFFFF ^ ItemConstants.UNTRADEABLE);
|
||||
item.setFlag((byte) flag);
|
||||
item.setFlag(flag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,6 @@ import net.encryption.InitializationVector;
|
||||
import net.encryption.PacketCodec;
|
||||
import net.packet.logging.InPacketLogger;
|
||||
import net.packet.logging.OutPacketLogger;
|
||||
import net.server.coordinator.session.IpAddresses;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import tools.PacketCreator;
|
||||
@@ -35,10 +34,7 @@ public abstract class ServerChannelInitializer extends ChannelInitializer<Socket
|
||||
String getRemoteAddress(Channel channel) {
|
||||
String remoteAddress = "null";
|
||||
try {
|
||||
String hostAddress = ((InetSocketAddress) channel.remoteAddress()).getAddress().getHostAddress();
|
||||
if (hostAddress != null) {
|
||||
remoteAddress = IpAddresses.evaluateRemoteAddress(hostAddress); // thanks dyz for noticing Local/LAN/WAN connections not interacting properly
|
||||
}
|
||||
remoteAddress = ((InetSocketAddress) channel.remoteAddress()).getAddress().getHostAddress();
|
||||
} catch (NullPointerException npe) {
|
||||
log.warn("Unable to get remote address from netty Channel: {}", channel, npe);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import constants.id.ItemId;
|
||||
import constants.id.MapId;
|
||||
import net.AbstractPacketHandler;
|
||||
import net.packet.InPacket;
|
||||
import net.server.Server;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import server.Trade;
|
||||
@@ -181,7 +182,11 @@ public final class ChangeMapHandler extends AbstractPacketHandler {
|
||||
c.disconnect(false, false);
|
||||
return;
|
||||
}
|
||||
String[] socket = c.getChannelServer().getIP().split(":");
|
||||
String[] socket = Server.getInstance().getInetSocket(c, c.getWorld(), c.getChannel());
|
||||
if (socket == null) {
|
||||
c.enableCSActions();
|
||||
return;
|
||||
}
|
||||
chr.getCashShop().open(false);
|
||||
|
||||
chr.setSessionTransitionState();
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package net.server.coordinator.session;
|
||||
|
||||
import config.YamlConfig;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
@@ -16,14 +14,6 @@ public class IpAddresses {
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
public static String evaluateRemoteAddress(String inetAddress) {
|
||||
if (isLocalAddress(inetAddress) || isLanAddress(inetAddress)) {
|
||||
return YamlConfig.config.server.HOST;
|
||||
} else {
|
||||
return inetAddress;
|
||||
}
|
||||
}
|
||||
|
||||
public static boolean isLocalAddress(String inetAddress) {
|
||||
return inetAddress.startsWith("127.");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user