mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-09-12 22:45:31 -04:00
friendAdd and friendRemove update PlayerObject FriendList now
This commit is contained in:
@@ -6,6 +6,6 @@ def setup():
|
||||
def run(core, actor, target, commandString):
|
||||
ghost = actor.getSlottedObject('ghost')
|
||||
chatSvc = core.chatService
|
||||
chatSvc.removeFriend(ghost, commandString, 1)
|
||||
chatSvc.removeFriend(ghost, commandString)
|
||||
return
|
||||
|
||||
@@ -417,6 +417,7 @@ public class PlayerObject extends SWGObject {
|
||||
public void friendAdd(String friend) {
|
||||
synchronized(objectMutex) {
|
||||
setFriendListUpdateCounter(getFriendListUpdateCounter() + 1);
|
||||
friendList.add(friend);
|
||||
getContainer().getClient().getSession().write(messageBuilder.buildFriendAddDelta(friend));
|
||||
}
|
||||
}
|
||||
@@ -424,6 +425,7 @@ public class PlayerObject extends SWGObject {
|
||||
public void friendRemove(String friend) {
|
||||
synchronized(objectMutex) {
|
||||
setFriendListUpdateCounter(getFriendListUpdateCounter() + 1);
|
||||
friendList.remove(friend);
|
||||
getContainer().getClient().getSession().write(messageBuilder.buildFriendRemoveDelta(friend));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -136,8 +136,6 @@ public class SimulationService implements INetworkDispatch {
|
||||
core.commandService.registerCommand("waypoint");
|
||||
core.commandService.registerCommand("setwaypointactivestatus");
|
||||
core.commandService.registerCommand("setwaypointname");
|
||||
core.commandService.registerCommand("addfriend");
|
||||
core.commandService.registerCommand("removefriend");
|
||||
core.commandService.registerCommand("getfriendlist");
|
||||
core.commandService.registerCommand("deathblow");
|
||||
core.commandService.registerCommand("endduel");
|
||||
|
||||
@@ -53,6 +53,7 @@ import protocol.swg.ChatFriendsListUpdate;
|
||||
import protocol.swg.ChatInstantMessageToCharacter;
|
||||
import protocol.swg.ChatInstantMessagetoClient;
|
||||
import protocol.swg.ChatOnAddFriend;
|
||||
import protocol.swg.ChatOnGetFriendsList;
|
||||
import protocol.swg.ChatOnSendInstantMessage;
|
||||
import protocol.swg.ChatOnSendPersistentMessage;
|
||||
import protocol.swg.ChatPersistentMessageToClient;
|
||||
@@ -75,6 +76,8 @@ public class ChatService implements INetworkDispatch {
|
||||
core.commandService.registerCommand("addignore");
|
||||
core.commandService.registerCommand("removeignore");
|
||||
core.commandService.registerCommand("findfriend");
|
||||
core.commandService.registerCommand("addfriend");
|
||||
core.commandService.registerCommand("removefriend");
|
||||
mailODB = core.getMailODB();
|
||||
}
|
||||
|
||||
@@ -356,7 +359,7 @@ public class ChatService implements INetworkDispatch {
|
||||
}
|
||||
}
|
||||
|
||||
public void removeFriend(PlayerObject actor, String friendName, boolean notify) {
|
||||
public void removeFriend(PlayerObject actor, String friendName) {
|
||||
|
||||
friendName = friendName.toLowerCase();
|
||||
|
||||
@@ -367,15 +370,17 @@ public class ChatService implements INetworkDispatch {
|
||||
|
||||
List<String> friendList = actor.getFriendList();
|
||||
|
||||
if (notify) {
|
||||
|
||||
if(friendList.contains(friendName)) {
|
||||
|
||||
actor.friendRemove(friendName);
|
||||
|
||||
ChatOnChangeFriendStatus removeMessage = new ChatOnChangeFriendStatus(actor.getContainer().getObjectID(), friendName, 0);
|
||||
actor.getContainer().getClient().getSession().write(removeMessage.serialize());
|
||||
|
||||
ChatOnGetFriendsList sendFriendsList = new ChatOnGetFriendsList(actor);
|
||||
actor.getContainer().getClient().getSession().write(sendFriendsList.serialize());
|
||||
|
||||
if(friendList.contains(friendName)) {
|
||||
actor.friendRemove(friendName);
|
||||
friendList.remove(friendName);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -422,19 +427,17 @@ public class ChatService implements INetworkDispatch {
|
||||
actorCreature.getClient().getSession().write(updateStatus.serialize());
|
||||
}
|
||||
}
|
||||
|
||||
actor.friendAdd(friendShortName);
|
||||
|
||||
friendList.add(friendShortName);
|
||||
|
||||
//actor.friendAdd(friendShortName);
|
||||
//actor.friendAdd(friendShortName);
|
||||
//if (actor.getFriendList().size() != 0) {
|
||||
//ChatOnGetFriendsList sendFriendsList = new ChatOnGetFriendsList(actor);
|
||||
//actorCreature.getClient().getSession().write(sendFriendsList.serialize());
|
||||
//}
|
||||
if (actor.getFriendList().size() != 0) {
|
||||
ChatOnGetFriendsList sendFriendsList = new ChatOnGetFriendsList(actor);
|
||||
actorCreature.getClient().getSession().write(sendFriendsList.serialize());
|
||||
}
|
||||
|
||||
actorCreature.sendSystemMessage(friendShortName + " has been added to your friends list.", (byte) 0);
|
||||
|
||||
//actor.friendAdd(friendShortName);
|
||||
|
||||
}
|
||||
|
||||
public void addToIgnoreList(SWGObject actor, String ignoreName) {
|
||||
|
||||
Reference in New Issue
Block a user