Add files via upload

This commit is contained in:
Rabiator1
2016-10-24 02:09:13 +02:00
committed by GitHub
parent caeee7a51a
commit c699aa17c9
99 changed files with 10412 additions and 0 deletions
@@ -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;
}
}