mirror of
https://github.com/Anime-Game-Servers/AGSLunarCore.git
synced 2024-11-23 04:19:48 +00:00
Fix issues with random stuff not loading when logging in
This commit is contained in:
parent
3eed08012c
commit
107c592522
@ -50,7 +50,7 @@ public class GameServerPacketHandler {
|
||||
if (handler != null) {
|
||||
// Check cooldown to prevent packet spam
|
||||
long timestamp = System.currentTimeMillis();
|
||||
if (session.getPacketCooldown().get(cmdId) >= timestamp) {
|
||||
if (session.getPacketCooldown().get(cmdId) >= timestamp && !CmdIdUtils.ALLOWED_FILTER_PACKETS.contains(cmdId)) {
|
||||
//LunarCore.getLogger().warn("Dropped a packet " + CmdIdUtils.getCmdIdName(cmdId));
|
||||
return;
|
||||
} else {
|
||||
|
@ -132,7 +132,7 @@ public class GameSession {
|
||||
|
||||
// Log packet
|
||||
if (LunarCore.getConfig().getLogOptions().packets) {
|
||||
if (!(LunarCore.getConfig().getLogOptions().filterLoopingPackets && CmdIdUtils.LOOP_PACKETS.contains(opcode))) {
|
||||
if (!(LunarCore.getConfig().getLogOptions().filterLoopingPackets && CmdIdUtils.IGNORED_LOG_PACKETS.contains(opcode))) {
|
||||
logPacket("RECV", opcode, data);
|
||||
}
|
||||
}
|
||||
@ -159,8 +159,8 @@ public class GameSession {
|
||||
|
||||
// Log
|
||||
if (LunarCore.getConfig().getLogOptions().packets) {
|
||||
if (!(LunarCore.getConfig().getLogOptions().filterLoopingPackets && CmdIdUtils.LOOP_PACKETS.contains(packet.getCmdId()))) {
|
||||
logPacket("RECV", packet.getCmdId(), packet.getData());
|
||||
if (!(LunarCore.getConfig().getLogOptions().filterLoopingPackets && CmdIdUtils.IGNORED_LOG_PACKETS.contains(packet.getCmdId()))) {
|
||||
logPacket("SEND", packet.getCmdId(), packet.getData());
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -177,7 +177,7 @@ public class GameSession {
|
||||
|
||||
// Log
|
||||
if (LunarCore.getConfig().getLogOptions().packets) {
|
||||
if (!(LunarCore.getConfig().getLogOptions().filterLoopingPackets && CmdIdUtils.LOOP_PACKETS.contains(cmdId))) {
|
||||
if (!(LunarCore.getConfig().getLogOptions().filterLoopingPackets && CmdIdUtils.IGNORED_LOG_PACKETS.contains(cmdId))) {
|
||||
logPacket("SEND", cmdId, Utils.EMPTY_BYTE_ARRAY);
|
||||
}
|
||||
}
|
||||
|
@ -16,13 +16,28 @@ import it.unimi.dsi.fastutil.ints.IntOpenHashSet;
|
||||
import it.unimi.dsi.fastutil.ints.IntSet;
|
||||
|
||||
public class CmdIdUtils {
|
||||
public static final IntSet LOOP_PACKETS = IntOpenHashSet.of(
|
||||
/**
|
||||
* Packet ids that will NOT be logged if "filterLoopingPackets" is true in the config
|
||||
*/
|
||||
public static final IntSet IGNORED_LOG_PACKETS = IntOpenHashSet.of(
|
||||
CmdId.PlayerHeartBeatCsReq,
|
||||
CmdId.PlayerHeartBeatScRsp,
|
||||
CmdId.SceneEntityMoveCsReq,
|
||||
CmdId.SceneEntityMoveScRsp,
|
||||
CmdId.GetQuestDataScRsp
|
||||
);
|
||||
|
||||
/**
|
||||
* Packet ids that will NOT be caught by the spam filter
|
||||
*/
|
||||
public static final IntSet ALLOWED_FILTER_PACKETS = IntOpenHashSet.of(
|
||||
CmdId.PlayerGetTokenCsReq,
|
||||
CmdId.PlayerLoginCsReq,
|
||||
CmdId.PlayerHeartBeatCsReq,
|
||||
CmdId.GetMissionStatusCsReq,
|
||||
CmdId.GetMissionStatusCsReq,
|
||||
CmdId.GetMissionEventDataCsReq
|
||||
);
|
||||
|
||||
private static Int2ObjectMap<String> cmdIdMap;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user