Changed PR based on Oblique's comments.

Also Added .db-journal to git ignore (file created by a 3d party SQLite GUI program)
This commit is contained in:
Iosnowore
2017-04-04 14:01:55 -07:00
parent d872ac4c87
commit 77231fa85c
4 changed files with 13 additions and 8 deletions
+1
View File
@@ -9,3 +9,4 @@
packets.txt
log.txt
/target/
*.db-journal
+2
View File
@@ -5,6 +5,8 @@ function executeCommand(galacticManager, player, target, args) {
if (player.getCreatureObject().sentDuelRequestToPlayer(target) && !player.getCreatureObject().isInDuelWithPlayer(target)) {
new DuelPlayerIntent(player.getCreatureObject(), target, DuelEventType.CANCEL).broadcast();
} else if (target.getSentDuelRequestToPlayer(player.getCreatureObject()) && !player.getCreatureObject.sentDuelRequestToPlayer(target)) {
new DuelPlayerIntent(player.getCreatureObject(), target, DuelEventType.DECLINE).broadcast();
} else {
new DuelPlayerIntent(player.getCreatureObject(), target, DuelEventType.END).broadcast();
}
@@ -30,6 +30,7 @@ package resources.objects.creature;
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.Locale;
import java.util.function.Predicate;
@@ -79,13 +80,13 @@ public class CreatureObject extends TangibleObject {
private long statesBitmask = 0;
private long lastTransform = 0;
private SWGSet<String> skills = new SWGSet<String>(1, 3, StringType.ASCII);
private SWGSet<String> skills = new SWGSet<String>(1, 3, StringType.ASCII);
private SWGList<Integer> baseAttributes = new SWGList<Integer>(1, 2);
private SWGList<Integer> baseAttributes = new SWGList<Integer>(1, 2);
private ArrayList<CreatureObject> activeDuels = new ArrayList<CreatureObject>();
private List<CreatureObject> activeDuels = new ArrayList<>();
private ArrayList<CreatureObject> sentDuels = new ArrayList<CreatureObject>();
private List<CreatureObject> sentDuels = new ArrayList<>();
public CreatureObject(long objectId) {
super(objectId, BaselineType.CREO);
@@ -810,11 +811,11 @@ public class CreatureObject extends TangibleObject {
return activeDuels.contains(player);
}
public ArrayList<CreatureObject> getActiveDuels() {
public List<CreatureObject> getActiveDuels() {
return activeDuels;
}
public ArrayList<CreatureObject> getSentDuels() {
public List<CreatureObject> getSentDuels() {
return sentDuels;
}
+3 -2
View File
@@ -25,7 +25,6 @@
* along with Holocore. If not, see <http://www.gnu.org/licenses/>. *
* *
***********************************************************************************/
package services.combat;
import intents.chat.ChatBroadcastIntent;
@@ -86,7 +85,9 @@ public class DuelPlayerService extends Service {
}
private void handleDeclineDuel(CreatureObject decliner, CreatureObject target) {
// TODO: Implement
target.getSentDuels().remove(decliner);
sendSystemMessage(decliner, target, "reject_self");
sendSystemMessage(target, decliner, "reject_target");
}
private void handleRequestDuel(CreatureObject requester, CreatureObject target) {