mirror of
https://github.com/Rogiel/l2jserver2
synced 2025-12-06 07:32:46 +00:00
Implemented ShortcutID and fixed compile warnings
Signed-off-by: Rogiel <rogiel@rogiel.com>
This commit is contained in:
@@ -1,8 +1,10 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<skill id="3" name="Power Strike" delay="3000" cooldown="720">
|
<skill id="3" name="Power Strike" delay="3000" cooldown="720" hitTime="3000">
|
||||||
<stats overhit="true" type="PHYSICAL_DAMAGE" range="40">
|
<stats overhit="true" type="PHYSICAL_DAMAGE" range="40">
|
||||||
<levels max="9">
|
<levels max="9" depend="1">
|
||||||
<level level="1" mpConsume="9" runSpeed="spd" abnormal="1" power="30" magic="3" />
|
<level level="1" mpConsume="9" runSpeed="spd" abnormal="1" power="30" magic="3">
|
||||||
|
<enchant magicLevel="1" power="2" />
|
||||||
|
</level>
|
||||||
<level level="2" mpConsume="9" power="32" magic="4" />
|
<level level="2" mpConsume="9" power="32" magic="4" />
|
||||||
<level level="3" mpConsume="10" power="35" magic="5" />
|
<level level="3" mpConsume="10" power="35" magic="5" />
|
||||||
<level level="4" mpConsume="11" power="46" magic="8" />
|
<level level="4" mpConsume="11" power="46" magic="8" />
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ public class CM_ADMIN_COMMAND extends AbstractClientPacket {
|
|||||||
/**
|
/**
|
||||||
* The command
|
* The command
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private String command;
|
private String command;
|
||||||
|
|
||||||
@Inject
|
@Inject
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
package com.l2jserver.model.game;
|
package com.l2jserver.model.game;
|
||||||
|
|
||||||
import com.l2jserver.model.AbstractModel;
|
import com.l2jserver.model.AbstractModel;
|
||||||
|
import com.l2jserver.model.id.ShortcutID;
|
||||||
import com.l2jserver.model.id.object.CharacterID;
|
import com.l2jserver.model.id.object.CharacterID;
|
||||||
import com.l2jserver.model.id.object.ItemID;
|
import com.l2jserver.model.id.object.ItemID;
|
||||||
import com.l2jserver.model.id.template.SkillTemplateID;
|
import com.l2jserver.model.id.template.SkillTemplateID;
|
||||||
@@ -25,10 +26,9 @@ import com.l2jserver.model.world.L2Character;
|
|||||||
/**
|
/**
|
||||||
* An shortcut in Lineage II game interface
|
* An shortcut in Lineage II game interface
|
||||||
*
|
*
|
||||||
* @author <a href="http://www.rogiel.com">Rogiel</a><br />
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
* TODO create the shortcut id
|
|
||||||
*/
|
*/
|
||||||
public class Shortcut extends AbstractModel {
|
public class Shortcut extends AbstractModel<ShortcutID> {
|
||||||
/**
|
/**
|
||||||
* The character id
|
* The character id
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -41,4 +41,18 @@ public class FriendID extends AbstractCompoundID<CharacterID, CharacterID> {
|
|||||||
@Assisted("id2") CharacterID id2) {
|
@Assisted("id2") CharacterID id2) {
|
||||||
super(id1, id2);
|
super(id1, id2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the character ID
|
||||||
|
*/
|
||||||
|
public CharacterID getCharacterID() {
|
||||||
|
return getID1();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the friend ID
|
||||||
|
*/
|
||||||
|
public CharacterID getFriendID() {
|
||||||
|
return getID2();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
94
src/main/java/com/l2jserver/model/id/ShortcutID.java
Normal file
94
src/main/java/com/l2jserver/model/id/ShortcutID.java
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
/*
|
||||||
|
* This file is part of l2jserver <l2jserver.com>.
|
||||||
|
*
|
||||||
|
* l2jserver is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* l2jserver is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with l2jserver. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
package com.l2jserver.model.id;
|
||||||
|
|
||||||
|
import com.google.inject.Inject;
|
||||||
|
import com.google.inject.assistedinject.Assisted;
|
||||||
|
import com.l2jserver.model.game.Shortcut;
|
||||||
|
import com.l2jserver.model.id.compound.AbstractCompoundID;
|
||||||
|
import com.l2jserver.model.id.object.CharacterID;
|
||||||
|
import com.l2jserver.model.id.object.ItemID;
|
||||||
|
import com.l2jserver.model.id.template.SkillTemplateID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Each {@link Shortcut} is identified by an {@link ID}.
|
||||||
|
*
|
||||||
|
* @author <a href="http://www.rogiel.com">Rogiel</a>
|
||||||
|
*/
|
||||||
|
public class ShortcutID extends AbstractCompoundID<CharacterID, ID<?>> {
|
||||||
|
/**
|
||||||
|
* Creates a new instance
|
||||||
|
*
|
||||||
|
* @param id1
|
||||||
|
* the first id
|
||||||
|
* @param id2
|
||||||
|
* the second id
|
||||||
|
*/
|
||||||
|
@Inject
|
||||||
|
public ShortcutID(@Assisted("id1") CharacterID id1,
|
||||||
|
@Assisted("id2") ID<?> id2) {
|
||||||
|
super(id1, id2);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the character ID
|
||||||
|
*/
|
||||||
|
public CharacterID getCharacterID() {
|
||||||
|
return getID1();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return the shortcut target ID
|
||||||
|
*/
|
||||||
|
public ID<?> getTargetID() {
|
||||||
|
return getID2();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if the {@link #getTargetID()} returns an
|
||||||
|
* {@link SkillTemplateID}
|
||||||
|
*/
|
||||||
|
public boolean isSkill() {
|
||||||
|
return getID2() instanceof SkillTemplateID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return return the {@link #getTargetID()} casted to
|
||||||
|
* {@link SkillTemplateID}
|
||||||
|
* @throws ClassCastException
|
||||||
|
* if {@link #isSkill()} returns null.
|
||||||
|
*/
|
||||||
|
public SkillTemplateID getSkillID() {
|
||||||
|
return (SkillTemplateID) getTargetID();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if the {@link #getTargetID()} returns an {@link ItemID}
|
||||||
|
*/
|
||||||
|
public boolean isItem() {
|
||||||
|
return getID2() instanceof ItemID;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return return the {@link #getTargetID()} casted to {@link ItemID}
|
||||||
|
* @throws ClassCastException
|
||||||
|
* if {@link #isItem()} returns null.
|
||||||
|
*/
|
||||||
|
public ItemID getItemID() {
|
||||||
|
return (ItemID) getTargetID();
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -19,6 +19,7 @@ package com.l2jserver.service.game.admin;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.l2jserver.game.net.Lineage2Connection;
|
import com.l2jserver.game.net.Lineage2Connection;
|
||||||
|
import com.l2jserver.game.net.packet.server.SM_HTML;
|
||||||
import com.l2jserver.model.id.object.CharacterID;
|
import com.l2jserver.model.id.object.CharacterID;
|
||||||
import com.l2jserver.model.world.L2Character;
|
import com.l2jserver.model.world.L2Character;
|
||||||
import com.l2jserver.service.AbstractService;
|
import com.l2jserver.service.AbstractService;
|
||||||
@@ -36,6 +37,6 @@ public class AdministratorServiceImpl extends AbstractService implements
|
|||||||
@Override
|
@Override
|
||||||
public void command(Lineage2Connection conn, L2Character character,
|
public void command(Lineage2Connection conn, L2Character character,
|
||||||
String command, String... args) {
|
String command, String... args) {
|
||||||
conn.sendCommunityHTML(new AdminHomeTemplate());
|
conn.write(new SM_HTML(null, new AdminHomeTemplate()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ public class NPCServiceImpl extends AbstractService implements NPCService {
|
|||||||
/**
|
/**
|
||||||
* The {@link CharacterService}
|
* The {@link CharacterService}
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private final CharacterService characterService;
|
private final CharacterService characterService;
|
||||||
/**
|
/**
|
||||||
* The {@link ThreadService}
|
* The {@link ThreadService}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public class GameGuardServiceImpl extends AbstractService implements
|
|||||||
/**
|
/**
|
||||||
* The valid GG SHA1 response
|
* The valid GG SHA1 response
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private static final byte[] VALID_KEY_SHA1 = { (byte) 0x88, 0x40, 0x1c,
|
private static final byte[] VALID_KEY_SHA1 = { (byte) 0x88, 0x40, 0x1c,
|
||||||
(byte) 0xa7, (byte) 0x83, 0x42, (byte) 0xe9, 0x15, (byte) 0xde,
|
(byte) 0xa7, (byte) 0x83, 0x42, (byte) 0xe9, 0x15, (byte) 0xde,
|
||||||
(byte) 0xc3, 0x68, (byte) 0xf6, 0x2d, 0x23, (byte) 0xf1, 0x3f,
|
(byte) 0xc3, 0x68, (byte) 0xf6, 0x2d, 0x23, (byte) 0xf1, 0x3f,
|
||||||
@@ -59,6 +60,7 @@ public class GameGuardServiceImpl extends AbstractService implements
|
|||||||
* <p>
|
* <p>
|
||||||
* <b>Access must be synchronized externally.
|
* <b>Access must be synchronized externally.
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unused")
|
||||||
private MessageDigest digester;
|
private MessageDigest digester;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user