LOGGER.debug("P5633_EncryptedRC4Key sent, adding RC4Encoder to pipeline");
RC4Encoder rc4Encoder = new RC4Encoder(rc4Key);
ctx.pipeline().addFirst("rc4EnCoder", rc4Encoder);
// Retrieve the map this user is on
MapData map = serverData.getMap();
CharacterData character = serverData.getCurrentCharacter();
P370_InstanceLoadHead instanceLoadHeader = new P370_InstanceLoadHead();
instanceLoadHeader.setUnknown1(character.isIsOutpost() ? (short) 0x3F : (short) 0x1F);
instanceLoadHeader.setUnknown2(character.isIsOutpost() ? (short) 0x3F : (short) 0x1F);
instanceLoadHeader.setUnknown3((short) 0x00);
instanceLoadHeader.setUnknown4((short) 0x00);
ctx.write(instanceLoadHeader);
P371_InstanceLoadCharName instanceLoadCharName = new P371_InstanceLoadCharName();
instanceLoadCharName.setCharName(character.getName());
ctx.write(instanceLoadCharName);
P395_InstanceLoadDistrictInfo instanceLoadDistrictInfo = new P395_InstanceLoadDistrictInfo();
instanceLoadDistrictInfo.setCharAgent(character.getLocalID());
instanceLoadDistrictInfo.setMapID(map.getGameMapID());
instanceLoadDistrictInfo.setDistrictAndRegion((character.isIsOutpost() ? map.getDistrictNumber() : 0)
| (character.isIsOutpost() ? map.getDistrictCountry() : 0));
instanceLoadDistrictInfo.setIsExplorable(character.isIsOutpost() ? (short) 1 : 0);
instanceLoadDistrictInfo.setIsObserver((byte) 0);
instanceLoadDistrictInfo.setLanguage(character.isIsOutpost() ? 0 : (short) 3);
ctx.write(instanceLoadDistrictInfo);