2018-07-06 15:30:00 +02:00
|
|
|
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;
|
|
|
|
|
2019-05-26 20:14:53 +02:00
|
|
|
public class UpdateFriendComposer extends MessageComposer {
|
2018-07-06 15:30:00 +02:00
|
|
|
private MessengerBuddy buddy;
|
|
|
|
|
|
|
|
private Habbo habbo;
|
|
|
|
|
2019-05-26 20:14:53 +02:00
|
|
|
public UpdateFriendComposer(MessengerBuddy buddy) {
|
2018-07-06 15:30:00 +02:00
|
|
|
this.buddy = buddy;
|
|
|
|
}
|
|
|
|
|
2018-07-08 23:32:00 +02:00
|
|
|
|
2019-05-26 20:14:53 +02:00
|
|
|
public UpdateFriendComposer(Habbo habbo) {
|
2018-07-06 15:30:00 +02:00
|
|
|
this.habbo = habbo;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override
|
2019-05-26 20:14:53 +02:00
|
|
|
public ServerMessage compose() {
|
2018-07-06 15:30:00 +02:00
|
|
|
|
|
|
|
this.response.init(Outgoing.UpdateFriendComposer);
|
2019-05-26 20:14:53 +02:00
|
|
|
if (this.buddy != null) {
|
2018-07-06 15:30:00 +02:00
|
|
|
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());
|
2019-05-26 20:14:53 +02:00
|
|
|
} else {
|
2018-07-06 15:30:00 +02:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
}
|