Change channel transition patch

Solved an issue where players were being unable to return to the game once changing channels.
This commit is contained in:
ronancpl
2019-03-28 17:09:18 -03:00
parent 16deacb426
commit 0b6951527d
6 changed files with 14 additions and 4 deletions

View File

@@ -1768,4 +1768,7 @@ Corrigido NPC da CPQ2, saída abrupta, não retornando jogadores devidamente par
Corrigido bug na CPQ em tempo estendido não mostrando devidamente o efeito visual de fim de partida.
27 Março 2019,
Corrigido possibilidade de bloqueio de volta do jogador ao jogo, ao utilizar o sistema de MTS/Cash Shop. Problema ocorria devido a mudanças concorrentes de login states ao fazer a transição de volta ao jogo.
Corrigido possibilidade de bloqueio de volta do jogador ao jogo, ao utilizar o sistema de MTS/Cash Shop. Problema ocorria devido a mudanças concorrentes de login states ao fazer a transição de volta ao jogo.
28 Março 2019,
Corrigido possibilidade de congelamento de tela ao tentar trocar de canais. Problema ocorria devido a mudanças concorrentes de login states ao fazer a transição de volta ao jogo.

View File

@@ -487,7 +487,6 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
}
public void setAwayFromChannelWorld() {
client.getSession().setAttribute(MapleClient.CLIENT_CASH_SHOP);
setAwayFromChannelWorld(false);
}
@@ -505,6 +504,10 @@ public class MapleCharacter extends AbstractMapleCharacterObject {
}
}
public void setSessionTransitionState() {
client.getSession().setAttribute(MapleClient.CLIENT_TRANSITION);
}
public long getPetLootCd() {
return petLootCd;
}

View File

@@ -91,7 +91,7 @@ public class MapleClient {
public static final String CLIENT_HWID = "HWID";
public static final String CLIENT_NIBBLEHWID = "HWID2";
public static final String CLIENT_REMOTE_ADDRESS = "REMOTE_IP";
public static final String CLIENT_CASH_SHOP = "CASH_SHOP";
public static final String CLIENT_TRANSITION = "TRANSITION";
private MapleAESOFB send;
private MapleAESOFB receive;
private final IoSession session;
@@ -1474,6 +1474,7 @@ public class MapleClient {
player.unregisterChairBuff();
server.getPlayerBuffStorage().addBuffsToStorage(player.getId(), player.getAllBuffs());
server.getPlayerBuffStorage().addDiseasesToStorage(player.getId(), player.getAllDiseases());
player.setSessionTransitionState();
player.setDisconnectedFromChannelWorld();
player.notifyMapTransferToPartner(-1);
player.removeIncomingInvites();

View File

@@ -150,7 +150,8 @@ public class MapleServerHandler extends IoHandlerAdapter {
MapleClient client = (MapleClient) session.getAttribute(MapleClient.CLIENT_KEY);
if (client != null) {
try {
if (!session.containsAttribute(MapleClient.CLIENT_CASH_SHOP)) {
// client freeze issues on session transition states found thanks to yolinlin, Omo Oppa, Nozphex
if (!session.containsAttribute(MapleClient.CLIENT_TRANSITION)) {
client.disconnect(false, false);
}
} catch (Throwable t) {

View File

@@ -65,6 +65,7 @@ public class EnterCashShopHandler extends AbstractMaplePacketHandler {
mc.unregisterChairBuff();
Server.getInstance().getPlayerBuffStorage().addBuffsToStorage(mc.getId(), mc.getAllBuffs());
Server.getInstance().getPlayerBuffStorage().addDiseasesToStorage(mc.getId(), mc.getAllDiseases());
mc.setSessionTransitionState();
mc.setAwayFromChannelWorld();
mc.notifyMapTransferToPartner(-1);
mc.removeIncomingInvites();

View File

@@ -91,6 +91,7 @@ public final class EnterMTSHandler extends AbstractMaplePacketHandler {
chr.unregisterChairBuff();
Server.getInstance().getPlayerBuffStorage().addBuffsToStorage(chr.getId(), chr.getAllBuffs());
Server.getInstance().getPlayerBuffStorage().addDiseasesToStorage(chr.getId(), chr.getAllDiseases());
chr.setSessionTransitionState();
chr.setAwayFromChannelWorld();
chr.notifyMapTransferToPartner(-1);
chr.removeIncomingInvites();