Arcturus-Community/src/main/java/com/eu/habbo/messages/outgoing/friends/UpdateFriendComposer.java
2019-05-26 21:15:26 +03:00

68 lines
2.5 KiB
Java

package com.eu.habbo.messages.outgoing.friends;
import com.eu.habbo.habbohotel.messenger.MessengerBuddy;
import com.eu.habbo.habbohotel.users.Habbo;
import com.eu.habbo.habbohotel.users.HabboGender;
import com.eu.habbo.messages.ServerMessage;
import com.eu.habbo.messages.outgoing.MessageComposer;
import com.eu.habbo.messages.outgoing.Outgoing;
public class UpdateFriendComposer extends MessageComposer {
private MessengerBuddy buddy;
private Habbo habbo;
public UpdateFriendComposer(MessengerBuddy buddy) {
this.buddy = buddy;
}
public UpdateFriendComposer(Habbo habbo) {
this.habbo = habbo;
}
@Override
public ServerMessage compose() {
this.response.init(Outgoing.UpdateFriendComposer);
if (this.buddy != null) {
this.response.appendInt(0);
this.response.appendInt(1);
this.response.appendInt(0);
this.response.appendInt(this.buddy.getId());
this.response.appendString(this.buddy.getUsername());
this.response.appendInt(this.buddy.getGender().equals(HabboGender.M) ? 0 : 1);
this.response.appendBoolean(this.buddy.getOnline() == 1);
this.response.appendBoolean(this.buddy.inRoom()); //In room
this.response.appendString(this.buddy.getLook());
this.response.appendInt(0);
this.response.appendString(this.buddy.getMotto());
this.response.appendString("");
this.response.appendString("");
this.response.appendBoolean(false);
this.response.appendBoolean(false);
this.response.appendBoolean(false);
this.response.appendShort(this.buddy.getRelation());
} else {
this.response.appendInt(0);
this.response.appendInt(1);
this.response.appendInt(0);
this.response.appendInt(-1);
this.response.appendString("Staff Chat");
this.response.appendInt(0);
this.response.appendBoolean(true);
this.response.appendBoolean(false); //In room
this.response.appendString(this.habbo.getHabboInfo().getLook());
this.response.appendInt(0);
this.response.appendString("");
this.response.appendString("");
this.response.appendString("");
this.response.appendBoolean(false);
this.response.appendBoolean(false);
this.response.appendBoolean(false);
this.response.appendShort(0);
}
return this.response;
}
}