1
0
mirror of https://github.com/Rogiel/l2jserver2 synced 2025-12-05 23:22:47 +00:00

Fixes small issues

This commit is contained in:
2011-12-24 16:38:31 -02:00
parent 5b658a2eea
commit 3fc66cecdc
8 changed files with 30 additions and 24 deletions

View File

@@ -150,7 +150,7 @@ public class Lineage2Client {
public boolean supports(ProtocolVersion version) {
if (version == null)
return false;
return version.supports(version);
return this.version.supports(version);
}
/**
@@ -405,4 +405,10 @@ public class Lineage2Client {
return (Lineage2PacketWriter) channel.getPipeline().get(
Lineage2PacketWriter.HANDLER_NAME);
}
@Override
public String toString() {
return "Lineage2Client [channel=" + channel + ", characterID="
+ characterID + ", session=" + session + ", version=" + version
+ "]";
}
}

View File

@@ -104,4 +104,11 @@ public class Lineage2Session {
public int getLoginKey2() {
return loginKey2;
}
@Override
public String toString() {
return "Lineage2Session [accountID=" + accountID + ", playKey1="
+ playKey1 + ", playKey2=" + playKey2 + ", loginKey1="
+ loginKey1 + ", loginKey2=" + loginKey2 + "]";
}
}

View File

@@ -87,7 +87,8 @@ public class CM_BYPASS extends AbstractClientPacket {
// parse command
final StringTokenizer tokenizer = new StringTokenizer(command, "_ ");
final String type = tokenizer.nextToken();
if (type.equals("npc")) {
switch (type) {
case "npc":
final int objectId = Integer.parseInt(tokenizer.nextToken());
final ObjectID<NPC> id = idResolver.resolve(objectId);
if (!(id instanceof NPCID)) {
@@ -107,8 +108,12 @@ public class CM_BYPASS extends AbstractClientPacket {
conn.sendSystemMessage(e.getSystemMessage());
conn.sendActionFailed();
}
} else {
log.warn("Client requested an bypass not supported by server");
return;
default:
log.warn(
"Client {} requested an bypass not supported by server: {}",
conn, type);
return;
}
}

View File

@@ -77,10 +77,12 @@ public abstract class BaseNPCController implements NPCController {
public void interact(NPC npc, L2Character character, final String... args)
throws L2Exception {
if (args.length == 2) {
if (args[0].equals("Chat")) {
switch(args[0]) {
case "Chat":
if (talk(npc, character,
Arrays.copyOfRange(args, 1, args.length)))
return;
break;
}
} else if (args.length == 0 || args.length == 1) {
// default action is talk

View File

@@ -46,7 +46,8 @@ public class TeleporterController extends BaseNPCController {
public void interact(NPC npc, L2Character character, String... args)
throws L2Exception {
if (args.length >= 2) {
if (args[0].equals("goto")) {
switch (args[0]) {
case "goto":
final TeleportationTemplate tele = teleportationIdProvider
.resolveID(Integer.parseInt(args[1])).getTemplate();
if (tele == null) {