mirror of
https://github.com/ProjectSWGCore/NGECore2.git
synced 2026-10-15 05:13:14 -04:00
fixed friend list deltas
This commit is contained in:
@@ -7,6 +7,8 @@ def setup():
|
||||
def run(core, actor, target, commandString):
|
||||
actorFaction = actor.getFaction()
|
||||
|
||||
print 'test'
|
||||
|
||||
if commandString == ('imperial') and actorFaction != "imperial":
|
||||
actor.setFaction('imperial')
|
||||
actor.sendSystemMessage('You are aligned to the Imperial faction', 0)
|
||||
@@ -21,4 +23,6 @@ def run(core, actor, target, commandString):
|
||||
actor.setFaction('neutral')
|
||||
actor.sendSystemMessage('You aren\'t aligned to any faction.', 0)
|
||||
return
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
@@ -7,4 +7,5 @@ def run(core, actor, target, commandString):
|
||||
ghost = actor.getSlottedObject('ghost')
|
||||
chatSvc = core.chatService
|
||||
chatSvc.removeFriend(ghost, commandString, 1)
|
||||
return
|
||||
return
|
||||
|
||||
@@ -509,9 +509,12 @@ public class PlayerMessageBuilder extends ObjectMessageBuilder {
|
||||
|
||||
public IoBuffer buildFriendAddDelta(String friend) {
|
||||
|
||||
IoBuffer buffer = bufferPool.allocate(100, false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
IoBuffer buffer = bufferPool.allocate(13 + friend.length(), false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
PlayerObject player = (PlayerObject) object;
|
||||
|
||||
buffer.putInt(1);
|
||||
buffer.putInt(player.getFriendListUpdateCounter());
|
||||
|
||||
buffer.put((byte) 1); // updateType (SubType)
|
||||
|
||||
buffer.putShort((short) player.getFriendList().indexOf(friend));
|
||||
@@ -528,9 +531,12 @@ public class PlayerMessageBuilder extends ObjectMessageBuilder {
|
||||
|
||||
public IoBuffer buildFriendRemoveDelta(String friend) {
|
||||
|
||||
IoBuffer buffer = bufferPool.allocate(100, false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
IoBuffer buffer = bufferPool.allocate(11, false).order(ByteOrder.LITTLE_ENDIAN);
|
||||
PlayerObject player = (PlayerObject) object;
|
||||
|
||||
buffer.putInt(1);
|
||||
buffer.putInt(player.getFriendListUpdateCounter());
|
||||
|
||||
buffer.put((byte) 0); // updateType (SubType)
|
||||
|
||||
buffer.putShort((short) player.getFriendList().indexOf(friend));
|
||||
|
||||
@@ -376,12 +376,14 @@ public class PlayerObject extends SWGObject {
|
||||
|
||||
public void friendAdd(String friend) {
|
||||
synchronized(objectMutex) {
|
||||
setFriendListUpdateCounter(getFriendListUpdateCounter() + 1);
|
||||
getContainer().getClient().getSession().write(messageBuilder.buildFriendAddDelta(friend));
|
||||
}
|
||||
}
|
||||
|
||||
public void friendRemove(String friend) {
|
||||
synchronized(objectMutex) {
|
||||
setFriendListUpdateCounter(getFriendListUpdateCounter() + 1);
|
||||
getContainer().getClient().getSession().write(messageBuilder.buildFriendRemoveDelta(friend));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -78,8 +78,9 @@ public class CommandService implements INetworkDispatch {
|
||||
|
||||
BaseSWGCommand command = getCommandByCRC(commandEnqueue.getCommandCRC());
|
||||
|
||||
if(command == null)
|
||||
if(command == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: command filters for state, posture etc.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user