mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-08 08:23:11 +00:00
@@ -19,7 +19,7 @@ public class Lineage2Connection {
|
||||
private L2Character character;
|
||||
private Lineage2Session session;
|
||||
private ConnectionState state = ConnectionState.CONNECTED;
|
||||
|
||||
|
||||
public enum ConnectionState {
|
||||
CONNECTED, AUTHENTICATED, IN_GAME;
|
||||
}
|
||||
|
||||
@@ -36,13 +36,15 @@ public class Lineage2PipelineFactory implements ChannelPipelineFactory {
|
||||
new Lineage2Encrypter());
|
||||
pipeline.addLast(Lineage2Decrypter.HANDLER_NAME,
|
||||
new Lineage2Decrypter());
|
||||
|
||||
pipeline.addLast("logger-hex", new LoggingHandler(InternalLogLevel.DEBUG, true));
|
||||
|
||||
pipeline.addLast("logger-hex", new LoggingHandler(
|
||||
InternalLogLevel.DEBUG, true));
|
||||
|
||||
pipeline.addLast("packet.writer", new Lineage2PacketWriter());
|
||||
pipeline.addLast("packet.reader", new Lineage2PacketReader(injector));
|
||||
|
||||
pipeline.addLast("logger", new LoggingHandler(InternalLogLevel.DEBUG, true));
|
||||
|
||||
pipeline.addLast("logger", new LoggingHandler(InternalLogLevel.DEBUG,
|
||||
true));
|
||||
|
||||
pipeline.addLast("packet.handler", new Lineage2PacketHandler());
|
||||
|
||||
|
||||
@@ -53,8 +53,8 @@ public class AuthLoginPacket extends AbstractClientPacket {
|
||||
|
||||
final List<L2Character> chars = characterDao.selectByAccount(conn
|
||||
.getSession().getUsername());
|
||||
// conn.write(CharacterSelectionListPacket.fromL2Session(
|
||||
// conn.getSession(), chars.toArray(new L2Character[0])));
|
||||
// conn.write(CharacterSelectionListPacket.fromL2Session(
|
||||
// conn.getSession(), chars.toArray(new L2Character[0])));
|
||||
conn.write(new CharacterEnterWorldPacket(chars.get(0), playKey1));
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ public class CharacterCreatePacket extends AbstractClientPacket {
|
||||
private int strength;
|
||||
private int concentration;
|
||||
private int mentality;
|
||||
private int dextry;
|
||||
private int dexterity;
|
||||
private int witness;
|
||||
|
||||
private CharacterHairStyle hairStyle;
|
||||
@@ -80,7 +80,7 @@ public class CharacterCreatePacket extends AbstractClientPacket {
|
||||
strength = buffer.readInt();
|
||||
concentration = buffer.readInt();
|
||||
mentality = buffer.readInt();
|
||||
dextry = buffer.readInt();
|
||||
dexterity = buffer.readInt();
|
||||
witness = buffer.readInt();
|
||||
|
||||
hairStyle = CharacterHairStyle.fromOption(buffer.readInt());
|
||||
|
||||
@@ -41,11 +41,10 @@ public class ProtocolVersionPacket extends AbstractClientPacket {
|
||||
// generate a new key
|
||||
final byte[] key = conn.getDecrypter().enable();
|
||||
log.debug("Decrypter has been enabled");
|
||||
|
||||
|
||||
log.debug("Client protocol version: {}", version);
|
||||
if (L2JConstants.SUPPORTED_PROTOCOL != version) {
|
||||
log.info(
|
||||
"Incorrect protocol version: {0}. Only {1} is supported.",
|
||||
log.info("Incorrect protocol version: {0}. Only {1} is supported.",
|
||||
version, L2JConstants.SUPPORTED_PROTOCOL);
|
||||
// notify wrong protocol and close connection
|
||||
conn.write(new KeyPacket(key, false)).addListener(
|
||||
|
||||
@@ -30,7 +30,7 @@ public class RequestManorList extends AbstractClientPacket {
|
||||
|
||||
@Override
|
||||
public void process(final Lineage2Connection conn) {
|
||||
conn.write(new ManorListPacket("gludio", "dion", "giran", "oren", "aden",
|
||||
"innadril", "goddard", "rune", "schuttgart"));
|
||||
conn.write(new ManorListPacket("gludio", "dion", "giran", "oren",
|
||||
"aden", "innadril", "goddard", "rune", "schuttgart"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class CharacterEnterWorldPacket extends AbstractServerPacket {
|
||||
buffer.writeInt(character.getAttributes().getStrength()); // STR
|
||||
buffer.writeInt(character.getAttributes().getConcentration()); // CON
|
||||
buffer.writeInt(character.getAttributes().getMentality()); // MEN
|
||||
buffer.writeInt(character.getAttributes().getDextry()); // DEX
|
||||
buffer.writeInt(character.getAttributes().getDexterity()); // DEX
|
||||
buffer.writeInt(character.getAttributes().getWitness()); // WIT
|
||||
|
||||
buffer.writeInt(250); // game time
|
||||
|
||||
@@ -47,7 +47,7 @@ public class CharacterSelectionListPacket extends AbstractServerPacket {
|
||||
buffer.writeInt(0x07); // max chars
|
||||
buffer.writeByte(0x00);
|
||||
|
||||
//int i = 0;
|
||||
// int i = 0;
|
||||
for (final L2Character character : characters) {
|
||||
BufferUtils.writeString(buffer, character.getName());
|
||||
buffer.writeInt(character.getID().getID());
|
||||
@@ -128,13 +128,13 @@ public class CharacterSelectionListPacket extends AbstractServerPacket {
|
||||
// buffer.writeInt(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_BELT));
|
||||
|
||||
// hair style
|
||||
//buffer.writeInt(character.getAppearance().getHairStyle().option);
|
||||
// buffer.writeInt(character.getAppearance().getHairStyle().option);
|
||||
buffer.writeInt(0x02);
|
||||
// hair color
|
||||
//buffer.writeInt(character.getAppearance().getHairColor().option);
|
||||
// buffer.writeInt(character.getAppearance().getHairColor().option);
|
||||
buffer.writeInt(0x03);
|
||||
// face
|
||||
//buffer.writeInt(character.getAppearance().getFace().option);
|
||||
// buffer.writeInt(character.getAppearance().getFace().option);
|
||||
buffer.writeInt(0x00);
|
||||
|
||||
buffer.writeDouble(30); // hp max
|
||||
@@ -164,7 +164,7 @@ public class CharacterSelectionListPacket extends AbstractServerPacket {
|
||||
|
||||
// buffer.writeInt(0x00);
|
||||
|
||||
//i++;
|
||||
// i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ public class CharacterTemplatePacket extends AbstractServerPacket {
|
||||
buffer.writeInt(template.getBaseAttributes().getStrength());
|
||||
buffer.writeInt(0x0a);
|
||||
buffer.writeInt(0x46);
|
||||
buffer.writeInt(template.getBaseAttributes().getDextry());
|
||||
buffer.writeInt(template.getBaseAttributes().getDexterity());
|
||||
buffer.writeInt(0x0a);
|
||||
buffer.writeInt(0x46);
|
||||
buffer.writeInt(template.getBaseAttributes().getConcentration());
|
||||
|
||||
@@ -10,7 +10,7 @@ import com.l2jserver.util.BufferUtils;
|
||||
*
|
||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||
*/
|
||||
public class UserinfoPacket extends AbstractServerPacket {
|
||||
public class UserInformationPacket extends AbstractServerPacket {
|
||||
/**
|
||||
* Message OPCODE
|
||||
*/
|
||||
@@ -18,7 +18,7 @@ public class UserinfoPacket extends AbstractServerPacket {
|
||||
|
||||
private String[] manors;
|
||||
|
||||
public UserinfoPacket(String... manors) {
|
||||
public UserInformationPacket(String... manors) {
|
||||
super(OPCODE);
|
||||
this.manors = manors;
|
||||
}
|
||||
Reference in New Issue
Block a user