mirror of
https://github.com/Rabiator1/SWG-Station-Chat.git
synced 2026-07-13 21:01:11 -04:00
Add files via upload
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
package chat.protocol.message;
|
||||
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import chat.ChatAvatar;
|
||||
import chat.protocol.GenericRequest;
|
||||
import chat.util.ChatUnicodeString;
|
||||
|
||||
public class MFriendLogout extends GenericRequest {
|
||||
|
||||
private ChatAvatar friendAvatar;
|
||||
private ChatUnicodeString friendAddress;
|
||||
private int destAvatarId;
|
||||
|
||||
public MFriendLogout() {
|
||||
type = MESSAGE_FRIENDLOGOUT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ByteBuffer serialize() {
|
||||
byte[] avatarBuf = friendAvatar.serialize();
|
||||
ByteBuffer buf = ByteBuffer.allocate(18 + avatarBuf.length + friendAddress.getStringLength() * 2).order(ByteOrder.LITTLE_ENDIAN);
|
||||
buf.putInt(0);
|
||||
buf.putShort(type);
|
||||
buf.putInt(0);
|
||||
buf.put(avatarBuf);
|
||||
buf.put(friendAddress.serialize());
|
||||
buf.putInt(destAvatarId);
|
||||
writeSize(buf);
|
||||
return buf;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuffer buf) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
public ChatAvatar getFriendAvatar() {
|
||||
return friendAvatar;
|
||||
}
|
||||
|
||||
public void setFriendAvatar(ChatAvatar friendAvatar) {
|
||||
this.friendAvatar = friendAvatar;
|
||||
}
|
||||
|
||||
public ChatUnicodeString getFriendAddress() {
|
||||
return friendAddress;
|
||||
}
|
||||
|
||||
public void setFriendAddress(ChatUnicodeString friendAddress) {
|
||||
this.friendAddress = friendAddress;
|
||||
}
|
||||
|
||||
public int getDestAvatarId() {
|
||||
return destAvatarId;
|
||||
}
|
||||
|
||||
public void setDestAvatarId(int destAvatarId) {
|
||||
this.destAvatarId = destAvatarId;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user