mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-10 09:22:49 +00:00
Implemented service dependencies
Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
@@ -31,9 +31,9 @@ public enum ProtocolVersion {
|
||||
*/
|
||||
FREYA(216, RELEASE),
|
||||
/**
|
||||
* High5(217)
|
||||
* High5(268)
|
||||
*/
|
||||
HIGH5(217, FREYA);
|
||||
HIGH5(268, FREYA);
|
||||
|
||||
public final ProtocolVersion parent;
|
||||
public final int version;
|
||||
|
||||
@@ -22,6 +22,11 @@ import com.l2jserver.game.net.Lineage2Connection;
|
||||
import com.l2jserver.game.net.packet.AbstractClientPacket;
|
||||
import com.l2jserver.game.net.packet.server.GameGuardQueryPacket;
|
||||
import com.l2jserver.game.net.packet.server.UserInformationPacket;
|
||||
import com.l2jserver.model.id.object.CharacterID;
|
||||
import com.l2jserver.service.game.chat.ChatService;
|
||||
import com.l2jserver.service.game.chat.channel.ChatChannel;
|
||||
import com.l2jserver.service.game.chat.channel.ChatChannelListener;
|
||||
import com.l2jserver.service.game.chat.channel.PublicChatChannel;
|
||||
|
||||
/**
|
||||
* The client is requesting a logout. Currently, when this packet is received
|
||||
@@ -35,6 +40,21 @@ public class EnterWorld extends AbstractClientPacket {
|
||||
*/
|
||||
public static final int OPCODE = 0x11;
|
||||
|
||||
/**
|
||||
* The chat service
|
||||
*/
|
||||
private final ChatService chatService;
|
||||
|
||||
/**
|
||||
* Creates a new instance
|
||||
*
|
||||
* @param chatService
|
||||
* the chat service
|
||||
*/
|
||||
public EnterWorld(ChatService chatService) {
|
||||
this.chatService = chatService;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(Lineage2Connection conn, ChannelBuffer buffer) {
|
||||
buffer.readBytes(new byte[32]); // Unknown Byte Array
|
||||
@@ -52,8 +72,20 @@ public class EnterWorld extends AbstractClientPacket {
|
||||
|
||||
@Override
|
||||
public void process(final Lineage2Connection conn) {
|
||||
if (conn.getCharacter().getClanID() != null) {
|
||||
final PublicChatChannel clanChannel = chatService.getChannel(conn
|
||||
.getCharacter().getClanID());
|
||||
clanChannel.addChatChannelListener(new ChatChannelListener() {
|
||||
@Override
|
||||
public void onMessage(ChatChannel channel, CharacterID source,
|
||||
String message) {
|
||||
// TODO write message
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
conn.write(new UserInformationPacket(conn.getCharacter()));
|
||||
conn.write(new GameGuardQueryPacket());
|
||||
//conn.write(new InventoryPacket(conn.getCharacter().getInventory()));
|
||||
// conn.write(new InventoryPacket(conn.getCharacter().getInventory()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user