1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-10 09:22:49 +00:00

Completed documentation

Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
2011-05-14 13:27:28 -03:00
parent e9c6f1b027
commit 4b9d52e724
56 changed files with 716 additions and 26 deletions

View File

@@ -0,0 +1,49 @@
package com.l2jserver.game;
/**
* Represents the protocol version used by the client
*
* @author <a href="http://www.rogiel.com">Rogiel</a>
*/
public enum ProtocolVersion {
/**
* Release version
*/
RELEASE(0),
/**
* Freya(216)
*/
FREYA(216, RELEASE),
/**
* High5(217)
*/
HIGH5(217, FREYA);
public final ProtocolVersion parent;
public final int version;
ProtocolVersion(int version) {
this(version, null);
}
ProtocolVersion(int version, ProtocolVersion parent) {
this.version = version;
this.parent = parent;
}
public boolean supports(ProtocolVersion version) {
if (this == version)
return true;
if (this.parent == null)
return false;
return this.parent.supports(version);
}
public static ProtocolVersion fromVersion(int version) {
for (ProtocolVersion v : values()) {
if (v.version == version)
return v;
}
return null;
}
}

View File

@@ -3,7 +3,7 @@ package com.l2jserver.game.net;
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelFuture;
import com.l2jserver.ProtocolVersion;
import com.l2jserver.game.ProtocolVersion;
import com.l2jserver.game.net.codec.Lineage2Decrypter;
import com.l2jserver.game.net.codec.Lineage2Encrypter;
import com.l2jserver.game.net.codec.Lineage2PacketReader;
@@ -135,7 +135,7 @@ public class Lineage2Connection {
*
* @param version
* @return true if version is supported by the client
* @see com.l2jserver.ProtocolVersion#supports(com.l2jserver.ProtocolVersion)
* @see com.l2jserver.game.ProtocolVersion#supports(com.l2jserver.game.ProtocolVersion)
*/
public boolean supports(ProtocolVersion version) {
if (version == null)

View File

@@ -7,7 +7,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.l2jserver.L2JConstants;
import com.l2jserver.ProtocolVersion;
import com.l2jserver.game.ProtocolVersion;
import com.l2jserver.game.net.Lineage2Connection;
import com.l2jserver.game.net.Lineage2CryptographyKey;
import com.l2jserver.game.net.packet.AbstractClientPacket;

View File

@@ -2,7 +2,7 @@ package com.l2jserver.game.net.packet.server;
import org.jboss.netty.buffer.ChannelBuffer;
import com.l2jserver.ProtocolVersion;
import com.l2jserver.game.ProtocolVersion;
import com.l2jserver.game.net.Lineage2Connection;
import com.l2jserver.game.net.Lineage2Session;
import com.l2jserver.game.net.packet.AbstractServerPacket;