mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-06 07:32:46 +00:00
@@ -9,13 +9,13 @@ import com.l2jserver.util.Coordinate;
|
|||||||
public abstract class AbstractCharacterTemplate extends CharacterTemplate {
|
public abstract class AbstractCharacterTemplate extends CharacterTemplate {
|
||||||
protected AbstractCharacterTemplate(CharacterTemplateID id,
|
protected AbstractCharacterTemplate(CharacterTemplateID id,
|
||||||
CharacterClass characterClass, int intelligence, int strength,
|
CharacterClass characterClass, int intelligence, int strength,
|
||||||
int concentration, int mentality, int dextry, int witness,
|
int concentration, int mentality, int dexterity, int witness,
|
||||||
int physicalAttack, int magicalAttack, int physicalDefense,
|
int physicalAttack, int magicalAttack, int physicalDefense,
|
||||||
int magicalDefense, int attackSpeed, int castSpeed, int accuracy,
|
int magicalDefense, int attackSpeed, int castSpeed, int accuracy,
|
||||||
int criticalChance, int evasionChance, int moveSpeed,
|
int criticalChance, int evasionChance, int moveSpeed,
|
||||||
int maxWeigth, boolean craft, Coordinate spawnLocation) {
|
int maxWeigth, boolean craft, Coordinate spawnLocation) {
|
||||||
super(id, characterClass, intelligence, strength, concentration,
|
super(id, characterClass, intelligence, strength, concentration,
|
||||||
mentality, dextry, witness, physicalAttack, magicalAttack,
|
mentality, dexterity, witness, physicalAttack, magicalAttack,
|
||||||
physicalDefense, magicalDefense, attackSpeed, castSpeed,
|
physicalDefense, magicalDefense, attackSpeed, castSpeed,
|
||||||
accuracy, criticalChance, evasionChance, maxWeigth, moveSpeed,
|
accuracy, criticalChance, evasionChance, maxWeigth, moveSpeed,
|
||||||
craft, spawnLocation);
|
craft, spawnLocation);
|
||||||
|
|||||||
@@ -8,13 +8,13 @@ import com.l2jserver.util.Coordinate;
|
|||||||
public abstract class HumanCharacterTemplate extends AbstractCharacterTemplate {
|
public abstract class HumanCharacterTemplate extends AbstractCharacterTemplate {
|
||||||
protected HumanCharacterTemplate(CharacterTemplateID id,
|
protected HumanCharacterTemplate(CharacterTemplateID id,
|
||||||
CharacterClass characterClass, int intelligence, int strength,
|
CharacterClass characterClass, int intelligence, int strength,
|
||||||
int concentration, int mentality, int dextry, int witness,
|
int concentration, int mentality, int dexterity, int witness,
|
||||||
int physicalAttack, int magicalAttack, int physicalDefense,
|
int physicalAttack, int magicalAttack, int physicalDefense,
|
||||||
int magicalDefense, int attackSpeed, int castSpeed, int accuracy,
|
int magicalDefense, int attackSpeed, int castSpeed, int accuracy,
|
||||||
int criticalChance, int evasionChance, int moveSpeed,
|
int criticalChance, int evasionChance, int moveSpeed,
|
||||||
int maxWeigth, boolean craft, Coordinate spawnLocation) {
|
int maxWeigth, boolean craft, Coordinate spawnLocation) {
|
||||||
super(id, characterClass, intelligence, strength, concentration,
|
super(id, characterClass, intelligence, strength, concentration,
|
||||||
mentality, dextry, witness, physicalAttack, magicalAttack,
|
mentality, dexterity, witness, physicalAttack, magicalAttack,
|
||||||
physicalDefense, magicalDefense, attackSpeed, castSpeed,
|
physicalDefense, magicalDefense, attackSpeed, castSpeed,
|
||||||
accuracy, criticalChance, evasionChance, moveSpeed, maxWeigth,
|
accuracy, criticalChance, evasionChance, moveSpeed, maxWeigth,
|
||||||
false, spawnLocation);
|
false, spawnLocation);
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class Lineage2Connection {
|
|||||||
private L2Character character;
|
private L2Character character;
|
||||||
private Lineage2Session session;
|
private Lineage2Session session;
|
||||||
private ConnectionState state = ConnectionState.CONNECTED;
|
private ConnectionState state = ConnectionState.CONNECTED;
|
||||||
|
|
||||||
public enum ConnectionState {
|
public enum ConnectionState {
|
||||||
CONNECTED, AUTHENTICATED, IN_GAME;
|
CONNECTED, AUTHENTICATED, IN_GAME;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,13 +36,15 @@ public class Lineage2PipelineFactory implements ChannelPipelineFactory {
|
|||||||
new Lineage2Encrypter());
|
new Lineage2Encrypter());
|
||||||
pipeline.addLast(Lineage2Decrypter.HANDLER_NAME,
|
pipeline.addLast(Lineage2Decrypter.HANDLER_NAME,
|
||||||
new Lineage2Decrypter());
|
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.writer", new Lineage2PacketWriter());
|
||||||
pipeline.addLast("packet.reader", new Lineage2PacketReader(injector));
|
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());
|
pipeline.addLast("packet.handler", new Lineage2PacketHandler());
|
||||||
|
|
||||||
|
|||||||
@@ -53,8 +53,8 @@ public class AuthLoginPacket extends AbstractClientPacket {
|
|||||||
|
|
||||||
final List<L2Character> chars = characterDao.selectByAccount(conn
|
final List<L2Character> chars = characterDao.selectByAccount(conn
|
||||||
.getSession().getUsername());
|
.getSession().getUsername());
|
||||||
// conn.write(CharacterSelectionListPacket.fromL2Session(
|
// conn.write(CharacterSelectionListPacket.fromL2Session(
|
||||||
// conn.getSession(), chars.toArray(new L2Character[0])));
|
// conn.getSession(), chars.toArray(new L2Character[0])));
|
||||||
conn.write(new CharacterEnterWorldPacket(chars.get(0), playKey1));
|
conn.write(new CharacterEnterWorldPacket(chars.get(0), playKey1));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ public class CharacterCreatePacket extends AbstractClientPacket {
|
|||||||
private int strength;
|
private int strength;
|
||||||
private int concentration;
|
private int concentration;
|
||||||
private int mentality;
|
private int mentality;
|
||||||
private int dextry;
|
private int dexterity;
|
||||||
private int witness;
|
private int witness;
|
||||||
|
|
||||||
private CharacterHairStyle hairStyle;
|
private CharacterHairStyle hairStyle;
|
||||||
@@ -80,7 +80,7 @@ public class CharacterCreatePacket extends AbstractClientPacket {
|
|||||||
strength = buffer.readInt();
|
strength = buffer.readInt();
|
||||||
concentration = buffer.readInt();
|
concentration = buffer.readInt();
|
||||||
mentality = buffer.readInt();
|
mentality = buffer.readInt();
|
||||||
dextry = buffer.readInt();
|
dexterity = buffer.readInt();
|
||||||
witness = buffer.readInt();
|
witness = buffer.readInt();
|
||||||
|
|
||||||
hairStyle = CharacterHairStyle.fromOption(buffer.readInt());
|
hairStyle = CharacterHairStyle.fromOption(buffer.readInt());
|
||||||
|
|||||||
@@ -41,11 +41,10 @@ public class ProtocolVersionPacket extends AbstractClientPacket {
|
|||||||
// generate a new key
|
// generate a new key
|
||||||
final byte[] key = conn.getDecrypter().enable();
|
final byte[] key = conn.getDecrypter().enable();
|
||||||
log.debug("Decrypter has been enabled");
|
log.debug("Decrypter has been enabled");
|
||||||
|
|
||||||
log.debug("Client protocol version: {}", version);
|
log.debug("Client protocol version: {}", version);
|
||||||
if (L2JConstants.SUPPORTED_PROTOCOL != version) {
|
if (L2JConstants.SUPPORTED_PROTOCOL != version) {
|
||||||
log.info(
|
log.info("Incorrect protocol version: {0}. Only {1} is supported.",
|
||||||
"Incorrect protocol version: {0}. Only {1} is supported.",
|
|
||||||
version, L2JConstants.SUPPORTED_PROTOCOL);
|
version, L2JConstants.SUPPORTED_PROTOCOL);
|
||||||
// notify wrong protocol and close connection
|
// notify wrong protocol and close connection
|
||||||
conn.write(new KeyPacket(key, false)).addListener(
|
conn.write(new KeyPacket(key, false)).addListener(
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class RequestManorList extends AbstractClientPacket {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void process(final Lineage2Connection conn) {
|
public void process(final Lineage2Connection conn) {
|
||||||
conn.write(new ManorListPacket("gludio", "dion", "giran", "oren", "aden",
|
conn.write(new ManorListPacket("gludio", "dion", "giran", "oren",
|
||||||
"innadril", "goddard", "rune", "schuttgart"));
|
"aden", "innadril", "goddard", "rune", "schuttgart"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ public class CharacterEnterWorldPacket extends AbstractServerPacket {
|
|||||||
buffer.writeInt(character.getAttributes().getStrength()); // STR
|
buffer.writeInt(character.getAttributes().getStrength()); // STR
|
||||||
buffer.writeInt(character.getAttributes().getConcentration()); // CON
|
buffer.writeInt(character.getAttributes().getConcentration()); // CON
|
||||||
buffer.writeInt(character.getAttributes().getMentality()); // MEN
|
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(character.getAttributes().getWitness()); // WIT
|
||||||
|
|
||||||
buffer.writeInt(250); // game time
|
buffer.writeInt(250); // game time
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ public class CharacterSelectionListPacket extends AbstractServerPacket {
|
|||||||
buffer.writeInt(0x07); // max chars
|
buffer.writeInt(0x07); // max chars
|
||||||
buffer.writeByte(0x00);
|
buffer.writeByte(0x00);
|
||||||
|
|
||||||
//int i = 0;
|
// int i = 0;
|
||||||
for (final L2Character character : characters) {
|
for (final L2Character character : characters) {
|
||||||
BufferUtils.writeString(buffer, character.getName());
|
BufferUtils.writeString(buffer, character.getName());
|
||||||
buffer.writeInt(character.getID().getID());
|
buffer.writeInt(character.getID().getID());
|
||||||
@@ -128,13 +128,13 @@ public class CharacterSelectionListPacket extends AbstractServerPacket {
|
|||||||
// buffer.writeInt(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_BELT));
|
// buffer.writeInt(charInfoPackage.getPaperdollItemId(Inventory.PAPERDOLL_BELT));
|
||||||
|
|
||||||
// hair style
|
// hair style
|
||||||
//buffer.writeInt(character.getAppearance().getHairStyle().option);
|
// buffer.writeInt(character.getAppearance().getHairStyle().option);
|
||||||
buffer.writeInt(0x02);
|
buffer.writeInt(0x02);
|
||||||
// hair color
|
// hair color
|
||||||
//buffer.writeInt(character.getAppearance().getHairColor().option);
|
// buffer.writeInt(character.getAppearance().getHairColor().option);
|
||||||
buffer.writeInt(0x03);
|
buffer.writeInt(0x03);
|
||||||
// face
|
// face
|
||||||
//buffer.writeInt(character.getAppearance().getFace().option);
|
// buffer.writeInt(character.getAppearance().getFace().option);
|
||||||
buffer.writeInt(0x00);
|
buffer.writeInt(0x00);
|
||||||
|
|
||||||
buffer.writeDouble(30); // hp max
|
buffer.writeDouble(30); // hp max
|
||||||
@@ -164,7 +164,7 @@ public class CharacterSelectionListPacket extends AbstractServerPacket {
|
|||||||
|
|
||||||
// buffer.writeInt(0x00);
|
// buffer.writeInt(0x00);
|
||||||
|
|
||||||
//i++;
|
// i++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ public class CharacterTemplatePacket extends AbstractServerPacket {
|
|||||||
buffer.writeInt(template.getBaseAttributes().getStrength());
|
buffer.writeInt(template.getBaseAttributes().getStrength());
|
||||||
buffer.writeInt(0x0a);
|
buffer.writeInt(0x0a);
|
||||||
buffer.writeInt(0x46);
|
buffer.writeInt(0x46);
|
||||||
buffer.writeInt(template.getBaseAttributes().getDextry());
|
buffer.writeInt(template.getBaseAttributes().getDexterity());
|
||||||
buffer.writeInt(0x0a);
|
buffer.writeInt(0x0a);
|
||||||
buffer.writeInt(0x46);
|
buffer.writeInt(0x46);
|
||||||
buffer.writeInt(template.getBaseAttributes().getConcentration());
|
buffer.writeInt(template.getBaseAttributes().getConcentration());
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import com.l2jserver.util.BufferUtils;
|
|||||||
*
|
*
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
*/
|
*/
|
||||||
public class UserinfoPacket extends AbstractServerPacket {
|
public class UserInformationPacket extends AbstractServerPacket {
|
||||||
/**
|
/**
|
||||||
* Message OPCODE
|
* Message OPCODE
|
||||||
*/
|
*/
|
||||||
@@ -18,7 +18,7 @@ public class UserinfoPacket extends AbstractServerPacket {
|
|||||||
|
|
||||||
private String[] manors;
|
private String[] manors;
|
||||||
|
|
||||||
public UserinfoPacket(String... manors) {
|
public UserInformationPacket(String... manors) {
|
||||||
super(OPCODE);
|
super(OPCODE);
|
||||||
this.manors = manors;
|
this.manors = manors;
|
||||||
}
|
}
|
||||||
@@ -36,7 +36,7 @@ public abstract class CharacterTemplate extends AbstractTemplate<L2Character> {
|
|||||||
|
|
||||||
public CharacterTemplate(CharacterTemplateID id,
|
public CharacterTemplate(CharacterTemplateID id,
|
||||||
CharacterClass characterClass, int intelligence, int strength,
|
CharacterClass characterClass, int intelligence, int strength,
|
||||||
int concentration, int mentality, int dextry, int witness,
|
int concentration, int mentality, int dexterity, int witness,
|
||||||
int physicalAttack, int magicalAttack, int physicalDefense,
|
int physicalAttack, int magicalAttack, int physicalDefense,
|
||||||
int magicalDefense, int attackSpeed, int castSpeed, int accuracy,
|
int magicalDefense, int attackSpeed, int castSpeed, int accuracy,
|
||||||
int criticalChance, int evasionChance, int moveSpeed,
|
int criticalChance, int evasionChance, int moveSpeed,
|
||||||
@@ -46,7 +46,7 @@ public abstract class CharacterTemplate extends AbstractTemplate<L2Character> {
|
|||||||
this.characterClass = characterClass;
|
this.characterClass = characterClass;
|
||||||
this.spawnLocation = spawnLocation;
|
this.spawnLocation = spawnLocation;
|
||||||
baseAttributes = new CharacterBaseAttributes(intelligence, strength,
|
baseAttributes = new CharacterBaseAttributes(intelligence, strength,
|
||||||
concentration, mentality, dextry, witness, physicalAttack,
|
concentration, mentality, dexterity, witness, physicalAttack,
|
||||||
magicalAttack, physicalDefense, magicalDefense, attackSpeed,
|
magicalAttack, physicalDefense, magicalDefense, attackSpeed,
|
||||||
castSpeed, accuracy, criticalChance, evasionChance, moveSpeed,
|
castSpeed, accuracy, criticalChance, evasionChance, moveSpeed,
|
||||||
maxWeigth, craft);
|
maxWeigth, craft);
|
||||||
@@ -133,10 +133,10 @@ public abstract class CharacterTemplate extends AbstractTemplate<L2Character> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @return
|
* @return
|
||||||
* @see com.l2jserver.model.world.character.CharacterBaseAttributes#getDextry()
|
* @see com.l2jserver.model.world.character.CharacterBaseAttributes#getDexterity()
|
||||||
*/
|
*/
|
||||||
public int getDextry() {
|
public int getDextry() {
|
||||||
return baseAttributes.getDextry();
|
return baseAttributes.getDexterity();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -22,9 +22,9 @@ public interface CharacterAttributes {
|
|||||||
public int getMentality();
|
public int getMentality();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the dextry
|
* @return the dexterity
|
||||||
*/
|
*/
|
||||||
public int getDextry();
|
public int getDexterity();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the witness
|
* @return the witness
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ public class CharacterBaseAttributes implements CharacterAttributes {
|
|||||||
/**
|
/**
|
||||||
* The character dextry
|
* The character dextry
|
||||||
*/
|
*/
|
||||||
private final int dextry;
|
private final int dexterity;
|
||||||
/**
|
/**
|
||||||
* The character witness
|
* The character witness
|
||||||
*/
|
*/
|
||||||
@@ -132,7 +132,7 @@ public class CharacterBaseAttributes implements CharacterAttributes {
|
|||||||
this.strength = strength;
|
this.strength = strength;
|
||||||
this.concentration = concentration;
|
this.concentration = concentration;
|
||||||
this.mentality = mentality;
|
this.mentality = mentality;
|
||||||
this.dextry = dextry;
|
this.dexterity = dextry;
|
||||||
this.witness = witness;
|
this.witness = witness;
|
||||||
this.physicalAttack = physicalAttack;
|
this.physicalAttack = physicalAttack;
|
||||||
this.magicalAttack = magicalAttack;
|
this.magicalAttack = magicalAttack;
|
||||||
@@ -179,8 +179,8 @@ public class CharacterBaseAttributes implements CharacterAttributes {
|
|||||||
/**
|
/**
|
||||||
* @return the dextry
|
* @return the dextry
|
||||||
*/
|
*/
|
||||||
public int getDextry() {
|
public int getDexterity() {
|
||||||
return dextry;
|
return dexterity;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -27,8 +27,8 @@ public class CharacterCalculatedAttributes implements CharacterAttributes {
|
|||||||
return baseAttributes.getMentality();
|
return baseAttributes.getMentality();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getDextry() {
|
public int getDexterity() {
|
||||||
return baseAttributes.getDextry();
|
return baseAttributes.getDexterity();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getWitness() {
|
public int getWitness() {
|
||||||
|
|||||||
@@ -35,9 +35,9 @@ public class RGBColor {
|
|||||||
public byte[] toByteArray() {
|
public byte[] toByteArray() {
|
||||||
return new byte[] { red, green, blue };
|
return new byte[] { red, green, blue };
|
||||||
}
|
}
|
||||||
|
|
||||||
public int toInteger() {
|
public int toInteger() {
|
||||||
return red + green >> 8 + blue >> 16;
|
return red + green >> 8 + blue >> 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RGBColor fromByteArray(byte[] rgb) {
|
public static RGBColor fromByteArray(byte[] rgb) {
|
||||||
|
|||||||
Reference in New Issue
Block a user